Update roles for user

PUT /api/users/{userId}/roles

Update API resource roles assigned to the user. This will replace the existing roles.

Path parameters

  • userId string Required

    The unique identifier of the user.

application/json

Body Required

  • roleIds array[string] Required

    An array of API resource role IDs to assign.

    Minimum length of each is 1.

Responses

  • 200 application/json

    The API resource roles has been updated for the user successfully.

  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

  • 404

    Not Found

  • 422

    Unprocessable Content

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