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

    The role was assigned to the users successfully.

  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

  • 404

    Not Found

  • 422

    Unprocessable Content

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