Grant a list of organization access of a user for a application.

PUT /api/applications/{id}/users/{userId}/consent-organizations

Grant a list of organization access of a user for a application by application id and user id.
The user must be a member of all the organizations.
Only third-party application needs to be granted access to organizations, all the other applications can request for all the organizations' access by default.

Path parameters

  • id string Required

    The unique identifier of the application.

  • userId string Required

    The unique identifier of the user.

application/json

Body Required

  • organizationIds array[string] Required

    A list of organization ids to be granted.
    All the existing organizations' access will be revoked if not in the list.
    If the list is empty, all the organizations' access will be revoked.

    Minimum length of each is 1.

Responses

  • All the request organizations's access are granted to the user for the application.

  • Bad Request

  • Unauthorized

  • Forbidden

  • The application or user is not found.

  • The user is not a member of one of the organizations, or the application is not a third-party application.

PUT /api/applications/{id}/users/{userId}/consent-organizations
curl \
 -X PUT https://[tenant_id].logto.app/api/applications/{id}/users/{userId}/consent-organizations \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"organizationIds":["string"]}'
Request examples
{
  "organizationIds": [
    "string"
  ]
}