Skip to content

Update a role

PATCH/teams/{team}/roles/{role}

Overview

Replaces a role's name, description and permissions and returns the updated role. Send all three fields. Omitted permissions are removed from every member on their next request. Creation limits apply. Built-in roles and unknown permission keys return 422. You cannot edit a role with more permissions than yours or grant permissions you do not hold.

Permissions

Requires the account permission teams.manage (Manage teams).

curl --request PATCH \
  --url 'https://console.advinservers.com/api/v1/client/teams/{team}/roles/{role}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Research Associate",
  "description": "Runs the test chamber servers and takes snapshots before each experiment, but cannot delete, reinstall or spend money.",
  "permissions": [
    "team.read",
    "server.read",
    "server.power",
    "server.console",
    "server.update",
    "backup.read",
    "backup.create",
    "snapshot.read",
    "snapshot.create",
    "firewall.read",
    "firewall.update",
    "network.read",
    "sshkey.read",
    "sshkey.update"
  ]
}'
{
  "id": "18f11680-0831-4d41-9d71-824c99009cbf",
  "uuid_short": "Uuid short",
  "name": "Research Associate",
  "description": "Runs the test chamber servers and takes snapshots before each experiment, but cannot delete, reinstall or spend money.",
  "permissions": [
    "team.read",
    "server.read",
    "server.power",
    "server.console",
    "server.update",
    "backup.read",
    "backup.create",
    "snapshot.read",
    "snapshot.create",
    "firewall.read",
    "firewall.update",
    "network.read",
    "sshkey.read",
    "sshkey.update"
  ],
  "type": "custom",
  "system_key": null,
  "is_system": false,
  "members_count": 1,
  "created_at": "2026-01-09T20:14:52+00:00"
}

Authorization

Authorizationstringheaderrequired

Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

Send it as Bearer <token>.

Path parameters

teamstringrequired

The team uuid short

rolestringrequired

The role uuid short

Body

application/json
namestringrequired

The name shown to customers.

1 to 64 characters

Must match ^[^\p{C}]+$

descriptionstring | null

An optional description shown to customers.

At most 512 characters

Must match ^[^\p{C}\n\r]*$

permissionsstring[]required

The value of permissions.

At most 44 items

Response 200

application/json

The record, as a JSON object. There is no envelope.

idstringrequired

The id ID.

uuid_shortstringrequired

The value of uuid_short.

namestringrequired

The name shown to customers.

descriptionstring | nullrequired

An optional description shown to customers.

permissionsstring[]required

Read through the model rather than off the column: a seeded role resolves its permissions from the catalogue every time, so it picks up anything added in a later release, and a key that no longer exists is dropped instead of being shown.

typestringrequired

The role type: system or custom.

One of: system, custom

system_keystring | nullrequired

The value of system_key.

is_systembooleanrequired

The three seeded roles are readable and assignable but never editable or deletable, so an account always has a working set to hand out.

members_countinteger | nullrequired

Only present when the listing asked for it; a role fetched on its own does not pay for the count.

created_atstring | nullrequired

The date and time for created at, in UTC.

Errors

401
The key was missing, malformed, revoked, or belongs to an account that no longer exists.
403
Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
404
The resource was not found in the selected team. Resources in another account or team also return 404.
422
A field is missing or invalid, or the resource cannot accept this change in its current state. Check message for details. Field validation also includes an errors object keyed by field name.
429
Too many requests. The Retry-After header says how many seconds to wait. Limits are per account, so several keys on one account share them.