Organizations

Assign roles to a user in an organization

Assign roles to a user in the specified organization with the provided data.

post/api/organizations/{id}/users/{userId}/roles

Request

  • Base URL: https://[tenant_id].logto.app
  • URL: https://[tenant_id].logto.app/api/organizations/{id}/users/{userId}/roles
  • Auth: OAuth 2 (client credentials, token URL /oidc/token, scopes: all)

Path parameters

idstring required

The unique identifier of the organization.

userIdstring required

The unique identifier of the user.

Request body

organizationRoleIdsstring[]

An array of organization role IDs to assign to the user. User existed roles assignment will be ignored.

organizationRoleNamesstring[]

An array of organization role names to assign to the user. User existed roles assignment will be ignored.

Response

Roles were assigned to the user successfully.

organizationRoleIdsstring[] required

An array of organization role IDs that were assigned to the user, deduplicated and resolved from any provided role names.

Changes

No recorded changes to this operation across all 8 revisions of this API.