Get roles for user

GET /api/users/{userId}/roles

Get API resource roles assigned to the user with pagination.

Path parameters

  • userId string Required

    The unique identifier of the user.

Query parameters

Responses

  • 200 application/json

    An array of API resource roles assigned to the user.

    Hide response attributes Show response attributes object
    • tenantId string Required

      Maximum length is 21.

    • id string Required

      Minimum length is 1, maximum length is 21.

    • name string Required

      Minimum length is 1, maximum length is 128.

    • description string Required

      Minimum length is 1, maximum length is 128.

    • type string Required

      Values are User or MachineToMachine.

    • isDefault boolean Required
  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

GET /api/users/{userId}/roles
curl \
 -X GET https://[tenant_id].logto.app/api/users/{userId}/roles \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
[
  {
    "tenantId": "string",
    "id": "string",
    "name": "string",
    "description": "string",
    "type": "User",
    "isDefault": true
  }
]