Skip to main content
PATCH
/
workspaces
/
{workspace_id}
/
roles
/
{role_id}
Update workspace role
curl --request PATCH \
  --url https://api.wacht.dev/workspaces/{workspace_id}/roles/{role_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Senior Developer",
  "permissions": [
    "read:projects",
    "write:projects",
    "deploy:production",
    "deploy:staging"
  ]
}
'
{
  "id": "5555555555",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-20T15:45:00Z",
  "name": "Developer",
  "permissions": [
    "read:projects",
    "write:projects",
    "deploy:production"
  ],
  "is_deployment_level": false
}

Authorizations

Authorization
string
header
required

API key authentication (Bearer token)

Path Parameters

workspace_id
string
required

Workspace ID (integer as string)

role_id
string
required

Role ID (integer as string)

Body

application/json
name
string

Role name

Example:

"Senior Developer"

permissions
string[]

List of permissions

Example:
[
  "read:projects",
  "write:projects",
  "deploy:production",
  "deploy:staging"
]

Response

Role updated successfully

id
string
required

Role ID (integer serialized as string)

Example:

"5555555555"

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:

"Developer"

permissions
string[]
required

List of permissions granted by this role

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

Whether this is a deployment-level role

Example:

false