Link scopes to role

POST /api/roles/{id}/scopes

Link a list of API resource scopes (permissions) to a role. The original linked scopes will be kept.

Path parameters

  • id string Required

    The unique identifier of the role.

application/json

Body Required

  • scopeIds array[string] Required

    An array of API resource scope IDs to be linked.

    Minimum length of each is 1.

Responses

  • The role was linked to the scopes successfully.

  • 201 application/json

    Created

    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.

    • resourceId string Required

      Minimum length is 1, maximum length is 21.

    • name string Required

      Minimum length is 1, maximum length is 256.

    • description string | null Required
    • createdAt number Required
  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unprocessable Content

POST /api/roles/{id}/scopes
curl \
 -X POST https://[tenant_id].logto.app/api/roles/{id}/scopes \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"scopeIds":["string"]}'
Request examples
{
  "scopeIds": [
    "string"
  ]
}
Response examples (201)
[
  {
    "tenantId": "string",
    "id": "string",
    "resourceId": "string",
    "name": "string",
    "description": "string",
    "createdAt": 42.0
  }
]