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

  • 200 application/json

    The role was linked to the scopes successfully.

    Hide response attributes Show response attributes object
    • 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
  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

  • 404

    Not Found

  • 422

    Unprocessable Content

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