Replace a custom role
Built-in roles cannot be edited. Duplicate one to customise it.
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
roleId*stringuuidIdempotency-Key?stringMakes retries safe. A repeated key with the same request returns the first result and sets
Idempotent-Replayed: true. The same key with a different request answers 409
idempotency.key_reused, and while the first request is still running 409
idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack
of sign-in or permission are not kept, so a retry runs again.
^[A-Za-z0-9_.:-]+$1 <= length <= 255application/json- body
name*string1 <= length <= 80description*stringlength <= 500granted*string"org""scope"permissions*array<string>The updated role.
application/json- response
id*stringuuidname*stringdescription*stringgranted*stringGiven org-wide, or on a scope.
"org""scope"builtin*booleanBuilt-in roles can be duplicated but not edited or deleted.
permissions*array<string>Permission keys. * is everything, *:read every read.
bindingCount*integerint64minOrgRole?OrgRoleThe lowest organization role a person needs for this role to count. Below it the role is paused.
"owner""admin""contributor""viewer"placeKinds?array<>The kinds of place this role can be granted on.
curl -X PUT 'https://wardn.example.com/api/v1/roles/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "description": "string", "granted": "org", "permissions": [ "string" ]}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "granted": "org", "builtin": true, "permissions": [ "string" ], "bindingCount": 0, "minOrgRole": "owner", "placeKinds": [ "org" ]}