Open Inventory / Docs
EndpunkteAccess controlApiAccessRolesKey

Update an access role

Die API läuft auf deiner Anwendungsinstanz. Schemas und Feldnamen stammen unverändert aus der OpenAPI-Spezifikation. Browsergebundene Aufrufe benötigen eine Sitzung auf der Instanz.

PATCH
/api/access/roles/{key}

Requires an authenticated browser session with the roles.manage permission. Changing permissions revokes user-bound API tokens for members of this role. The built-in Admin role must retain every permission.

Authentifizierung

adminSession
cookieauthjs.session-token<token>

Authenticated Auth.js browser session cookie; each operation declares its required permission. Not restricted to administrators. HTTPS deployments use the secure-prefixed cookie variant.

Pfadparameter

key*string

Stable role key.

Muster^[a-z][a-z0-9_-]{0,63}$
Länge1 <= length <= 64

Header-Parameter

X-Organization-ID?string

Organization membership selected for this request. User-bound credentials may select any active membership; standalone tokens may only repeat their pinned organization ID.

Formatuuid

Anfrageinhalt

application/json
  1. body
Eigenschaften1 <= properties
name?string
Länge1 <= length <= 120
description?string
Längelength <= 1000
permissions?array<>
Einträgeitems <= 30

Antwortinhalt

Role updated

application/json
  1. response
role*
Beispielanfrage
curl -X PATCH 'https://example.com/api/access/roles/editor' \  -H 'Content-Type: application/json' \  -d '{}'
Beispielantwort
{  "role": {    "key": "editor",    "name": "string",    "description": "string",    "permissions": [      "inventory.read"    ],    "isSystem": true,    "memberCount": 0,    "createdBy": "string",    "updatedBy": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}