latestOpenAPI 3.1.02026-08-194237902.5 MB

563848e0ecc0

Role

Add permissions to a role without removing existing ones

Adds one or more permissions to the role identified by roleId, leaving any existing permissions intact. Use this when you want to expand a role's permission set without affecting what it already has; to simultaneously add and remove permissions in one call use PATCH /roles/{roleId}/permissions/bulk. Requires the tenant-id header (returns 400 if absent or blank). The request body must include a permissionIds array of permission ID strings; obtain valid permission IDs from the permissions list endpoints. Returns 200 with the complete, updated list of all permissions now assigned to the role — not just the newly added ones. Note: if the role does not exist, the current implementation returns 500 rather than 404 (tracked in CP-36405).

post/roles/{roleId}/permissions

Path parameters

roleIdstring required

Headers

tenant-idstring

Request body

permissionIdsstring[] required

IDs of the permissions to add to the role

Example request

{
  "permissionIds": [
    "2c5ea4c0-4067-4c5f-9dd1-3f4a0d2c5b09",
    "7a1e9c3d-8b2f-4a6e-9d3c-1f5b7e2a4c88"
  ]
}

Response

Permissions added successfully

idstring

Server-assigned unique identifier for the permission.

resourcestring

Name of the resource this permission governs (e.g. 'user', 'roster'). Mirrors the resource value supplied when the permission was created or last replaced.

actionstring

Name of the action this permission grants on the resource (e.g. 'read', 'create'). Mirrors the action value supplied when the permission was created or last replaced.

descriptionstring

Human-readable explanation of what the permission allows. Optional; may be null if it was not supplied at creation.

createdAtstring date-time
updatedAtstring date-time

Example response

[
  {
    "id": "perm-123-456-789",
    "resource": "user",
    "action": "read",
    "description": "Allows reading user profiles",
    "createdAt": "2022-03-10T12:15:50-04:00",
    "updatedAt": "2022-03-10T12:15:50-04:00"
  }
]