Assign role to users

POST /api/roles/{id}/users

Assign a role to a list of users. The role must have the type User.

Path parameters

  • id string Required

    The unique identifier of the role.

application/json

Body Required

  • userIds array[string] Required

    An array of user IDs to be assigned.

    Minimum length of each is 1.

Responses

  • 201 application/json

    The role was assigned to the users successfully.

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unprocessable Content

POST /api/roles/{id}/users
curl \
 -X POST https://[tenant_id].logto.app/api/roles/{id}/users \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"userIds":["string"]}'
Request examples
{
  "userIds": [
    "string"
  ]
}