Skip to content

Set Role Permissions

POST/web/v1/workspaces/{workspaceId}/roles/{roleId}/permissions JWT

Sets the permissions assigned to a workspace role. This is a replace operation: all existing permissions are removed and replaced with the provided list.

Required Headers

HeaderExample ValueDescription
Content-Typeapplication/jsonRequest content type
Acceptapplication/jsonExpected response type
X-Client-HashClient device fingerprint
Accept-Languageen, zh, zh-Hant, ja, viResponse language (default: en)
AuthorizationBearerJWT access token
X-Workspace-IdTarget workspace ID

Request Parameters

NameTypeRequiredInDescription
workspaceIdStringRequiredpathBusiness ID of the workspace
roleIdStringRequiredpathBusiness ID of the role

Request Body

json
{
  "permissionCodes": ["workspace:read", "workspace:write"]
}

Request Example

json
{
  "permissionCodes": ["workspace:read", "workspace:write", "role:read"]
}

Success Response

Status: 200 OK

Returns the updated role object with the new permission codes.

Success 200
{
  "version": "1.3.0",
  "timestamp": 1709337600000,
  "success": true,
  "code": "2000",
  "message": "SUCCESS",
  "data": {
    "bizId": "ROLE_CUSTOM_TEST_001",
    "workspaceBizId": "WS_ROLE_TEST_001",
    "roleName": "Editor",
    "roleType": {
      "value": 10010902,
      "name": "CUSTOM",
      "code": "CUSTOM"
    },
    "description": "Editor role",
    "permissionCodes": [
      "workspace:read",
      "workspace:write"
    ],
    "createdAt": "2026-03-22T10:30:00Z",
    "updatedAt": "2026-03-22T11:00:00Z"
  }
}

Error Responses

Unauthorized 401
{
  "success": false,
  "code": "4010",
  "message": "Invalid or expired token"
}

Notes

  • This is a full replace operation, not an append. Send the complete desired permission list.
  • Only CUSTOM roles can have permissions set. OWNER roles implicitly have all permissions.
  • Requires workspace:role:write permission.

SlaunchX Internal Documentation