Skip to Content

Create a workspace role

You're viewing API version 2026-09, which is deprecated and stops working on October 1, 2027. To move your integration, see Upgrading to 2026-10.
POST
/api/v1/workspace-roles

Create a custom workspace role with a set of permission keys. Discover valid permission keys via GET /api/v1/workspace-permissions. Granting the ADMINISTRATOR permission requires that you already hold it.

Permission required: MANAGE_WORKSPACE_ROLES on the workspace.

Authorization

headerAuthorizationBearer <token>

Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.

Header Parameters

authorization*string

Bearer token for API authentication

Idempotency-Key?string

Makes retries safe. A retry with the same key and the same request replays the stored response for 24 hours (header Idempotent-Replayed: true); the same key with a different request returns 400.

Lengthlength <= 255

Request Body

Body

application/json
  1. body

Create a workspace role

name*string

Role name

Length1 <= length
permissions*array<>

Permission keys to grant. Discover valid keys via GET /api/v1/workspace-permissions.

Default[]

Response Body

Workspace role

application/json
  1. response

Workspace role

id*string

Immutable role identifier — pass this to addMember

name*string

Human-readable role name. Editable by org admins.

isDefault*boolean

True for the role that newly-invited members get by default

permissions*array<>

Permission keys granted by this role

memberCount*number

Number of workspace members currently assigned this role

createdAt*unknown
updatedAt*unknown
Example Request
curl -X POST 'https://app.sajn.se/api/v1/workspace-roles' \  -H 'authorization: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "permissions": []}'
Example Response
{  "id": "string",  "name": "string",  "isDefault": true,  "permissions": [    "READ_DOCUMENT"  ],  "memberCount": 0,  "createdAt": null,  "updatedAt": null}

Was this page helpful?