Identity & Access Management

Preview — pending review

This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.

Edit a custom role

PATCH
/scopes/{scopeId}/iam/roles/{roleId}

Updates a custom role's display name, description, assignable scope levels and/or permission matrix ("Edit" / "Edit role" in the Roles page and the role detail page; also exposed as a bulk action on selected rows). Built-in roles are managed and immutable. Changes to the permission matrix affect every principal currently assigned the role; the resulting state is available to subsequent reads. Validation: role must exist and be visible (else 404 NOT_FOUND); builtIn: true roles reject any update with 409 LOCKED; if name is supplied it must remain unique in the tenant; permissions keys must be known resource keys with values manage|read|none and assignableScopes entries subscription|project — violations → 422 VALIDATION_FAILED. Async & state: Synchronous. Every edit — name, description, assignable scopes and the permission matrix alike — is applied inline and returns 200 with the updated RoleDef. A permission-matrix change additionally stages the OpenStack re-projection of every holder in the same transaction; it runs after the response and is not tracked by an Operation here (the edit is recorded as an already-SUCCEEDED iam.role.update Operation in the activity feed). Errors: 401 unauthenticated; 403 when the caller lacks iam:manage; 404 unknown role; 409 LOCKED when targeting a built-in role; 422 for invalid fields; 500 on internal failure. Idempotency/Concurrency: This operation does not use Idempotency-Key; it may be omitted and a sent one is ignored. A repeated identical PATCH applies the same fields again (same end state) and returns 200 with the role; each call records another iam.role.update audit Operation and, when permissions is sent, stages another OpenStack re-projection. This operation does not check If-Match; a sent one is ignored and the last write wins.

Authorization

bearerToken
headerAuthorizationBearer <token>

An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.

Path Parameters

scopeId*string

Opaque ownership+authorization scope resolving to tenant + subscription + project.

roleId*string

Role identifier of the custom role to update.

Request Body

application/json
  1. body

Partial update for a custom role. Omitted fields are left unchanged. Built-in roles reject all updates.

name?string

New display name; must remain unique within the tenant.

Match^[^\p{C}\p{Z}\x{10000}-\x{10FFFF}](?:[^\p{C}\p{Zl}\p{Zp}\x{10000}-\x{10FFFF}]*[^\p{C}\p{Z}\x{10000}-\x{10FFFF}])?$
Length1 <= length <= 255
description?string

New human-readable summary.

Lengthlength <= 255
assignableScopes?array<>

Replacement set of scope levels the role may be assigned at.

permissions?

Replacement permission matrix entries (resourceKey → access level); keys not present are left unchanged.

Response Body

Edit applied synchronously (metadata and permission matrix alike); returns the updated role.

application/json
  1. response

IAM role definition — built-in (owner, contributor, reader, billing-ops) or custom — with its permission matrix over platform resource keys.

id*string

Role identifier. Built-in ids are owner, contributor, reader, billing-ops; custom roles receive generated ids.

name*string

Display name, e.g. "Owner".

description*string

Human-readable summary of what the role allows.

custom*boolean

True when the role was created or cloned by the tenant.

members*integer

Number of principals currently assigned this role.

assignableScopes*array<>

Scope levels this role can be assigned at.

builtIn*boolean

Built-in roles are managed and cannot be edited or deleted.

createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
permissions*

Permission matrix — resourceKey (compute, storage, network, loadbalancer, kubernetes, observability, billing, budgets, iam, tokens, branding, audit) → access level.

curl -X PATCH "https://example.com/scopes/string/iam/roles/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "description": "string",  "custom": true,  "members": 0,  "assignableScopes": [    "tenant"  ],  "builtIn": true,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "permissions": {    "property1": "manage",    "property2": "manage"  }}