Skip to content

Update custom role

PATCH
/api/v1/organizations/{orgId}/roles/{id}
curl --request PATCH \
--url http://localhost:3000/api/v1/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roles/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "name": "Senior Device Operator", "description": "Can view and manage devices and deployments", "permissions": [ "devices:read", "devices:write", "deployments:read", "deployments:write" ] }'

Updates an existing custom role. System roles cannot be modified.

id
required
string format: uuid

Role UUID

orgId
required
string format: uuid

Organization UUID

Media type application/json
object
name

Role display name

string
>= 2 characters <= 50 characters
Example
Senior Device Operator
description

Role description

string
<= 200 characters
Example
Can view and manage devices and deployments
permissions

List of permission keys assigned to this role

Array<string>
Example
[
"devices:read",
"devices:write",
"deployments:read",
"deployments:write"
]

Role updated successfully

Media type application/json
object
id
required

Unique role identifier

string format: uuid
name
required

Role display name

string
description

Role description

string
permissions
required

List of permission keys assigned to this role

Array<string>
isSystem
required

Whether this is a system-defined role (cannot be modified)

boolean
organizationId

Organization ID (null for system roles)

string format: uuid
createdAt
required

When the role was created

string format: date-time
updatedAt
required

When the role was last updated

string format: date-time
Example
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Device Operator",
"description": "Can view and manage devices but not deployments",
"permissions": [
"devices:read",
"devices:write",
"deployments:read"
],
"isSystem": false,
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-06-20T14:45:00Z"
}

Invalid input data or cannot modify system role

Unauthorized

Forbidden - Insufficient permissions

Role not found