Create a custom workspace role
Creates a new RBAC role scoped to the given workspace. `displayName` is the human-readable label (case-insensitive unique per workspace, max 120 chars). `permissions` must be a subset of the catalog returned by `GET /api/v2/permissions/catalog`.
Authorization
BearerAuthObject Machine tokens only: a personal API token or a product robot token (POST /api/v2/products/{uid}/robot-tokens). A session JWT here is 401 — the web app uses the b2t_access cookie.
In: header
Path Parameters
Workspace UUID
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v2/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/roles" \ -H "Content-Type: application/json" \ -d '{}'{ "id": "wsr_67890abc", "name": "QA Lead", "isSystem": false, "priority": 250, "permissions": [ "SourceIndex" ], "usersCount": 0}{ "message": { "error": "Your request was made with invalid credentials." }}{ "message": { "error": "You are not allowed to perform this action." }}{ "message": { "error": "Page not found" }}{ "errors": { "langBcp": "Language already exists" }}