Users

Assign roles to user

Assign API resource roles to the user. The roles will be added to the existing roles.

post/api/users/{userId}/roles

Request

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

Path parameters

userIdstring required

The unique identifier of the user.

Request body

roleIdsstring[] required

An array of API resource role IDs to assign.

Response

The API resource roles has been assigned to the user.

roleIdsstring[] required

An array of API resource role IDs requested for assignment.

addedRoleIdsstring[] required

An array of API resource role IDs newly assigned to the user.

Changes

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