Assign user consent scopes to application.

POST /api/applications/{applicationId}/user-consent-scopes

Assign the user consent scopes to an application by application id

Path parameters

application/json

Body Required

  • organizationScopes array[string]

    A list of organization scope id to assign to the application. Throws error if any given organization scope is not found.

  • resourceScopes array[string]

    A list of resource scope id to assign to the application. Throws error if any given resource scope is not found.

  • A list of organization resource scope id to assign to the application. Throws error if any given resource scope is not found.

  • userScopes array[string]

    A list of user scope enum value to assign to the application.

    Values are profile, email, phone, address, custom_data, identities, roles, urn:logto:scope:organizations, or urn:logto:scope:organization_roles.

Responses

  • 201 application/json

    All the user consent scopes are assigned to the application successfully

  • Bad Request

  • Unauthorized

  • Forbidden

  • The application is not found

  • Any of the given organization scope, resource scope or user scope is not found

POST /api/applications/{applicationId}/user-consent-scopes
curl \
 -X POST https://[tenant_id].logto.app/api/applications/{applicationId}/user-consent-scopes \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"organizationScopes":["string"],"resourceScopes":["string"],"organizationResourceScopes":["string"],"userScopes":["profile"]}'
Request examples
{
  "organizationScopes": [
    "string"
  ],
  "resourceScopes": [
    "string"
  ],
  "organizationResourceScopes": [
    "string"
  ],
  "userScopes": [
    "profile"
  ]
}