Skip to main content
PATCH
/
organizations
/
{organization_id}
/
roles
/
{role_id}
Update organization role
curl --request PATCH \
  --url https://api.wacht.dev/organizations/{organization_id}/roles/{role_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Senior Project Manager",
  "permissions": [
    "read:projects",
    "write:projects",
    "delete:projects",
    "manage:team"
  ]
}
'
{
  "id": "3333333333",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-20T15:45:00Z",
  "name": "Project Manager",
  "permissions": [
    "read:projects",
    "write:projects",
    "delete:projects"
  ],
  "is_deployment_level": false
}

Authorizations

Authorization
string
header
required

API key authentication (Bearer token)

Path Parameters

organization_id
string
required

Organization ID (integer as string)

role_id
string
required

Role ID (integer as string)

Body

application/json
name
string

Role name

Example:

"Senior Project Manager"

permissions
string[]

List of permissions

Example:
[
"read:projects",
"write:projects",
"delete:projects",
"manage:team"
]

Response

Role updated successfully

id
string
required

Role ID (integer serialized as string)

Example:

"3333333333"

created_at
string<date-time>
required
Example:

"2024-01-15T10:30:00Z"

updated_at
string<date-time>
required
Example:

"2024-01-20T15:45:00Z"

name
string
required

Role name

Example:

"Project Manager"

permissions
string[]
required

List of permissions granted by this role

Example:
[
"read:projects",
"write:projects",
"delete:projects"
]
is_deployment_level
boolean
required

Whether this is a deployment-level role

Example:

false