List workspace roles
curl --request GET \
--url https://{platformHost}/api/public/v1/workspaces/{workspaceId}/roles \
--header 'X-API-Key: <api-key>'{
"success": true,
"data": {
"roles": [
{
"roleId": "builtin.workspace.restricted_member",
"name": "RESTRICTED_MEMBER",
"assignableAt": [
"workspace"
],
"permissions": [
"<string>"
],
"effectivePermissions": [
"<string>"
],
"assignableByCaller": true,
"id": "<string>",
"description": "<string>",
"parentRoleId": "<string>",
"apiAssignable": true,
"reasons": [
"<string>"
],
"revision": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}List workspace roles
Lists the built-in workspace roles with their permissions and whether a key may assign each. Custom roles are not returned.
Required scope: workspace.roles.read
GET
/
api
/
public
/
v1
/
workspaces
/
{workspaceId}
/
roles
List workspace roles
curl --request GET \
--url https://{platformHost}/api/public/v1/workspaces/{workspaceId}/roles \
--header 'X-API-Key: <api-key>'{
"success": true,
"data": {
"roles": [
{
"roleId": "builtin.workspace.restricted_member",
"name": "RESTRICTED_MEMBER",
"assignableAt": [
"workspace"
],
"permissions": [
"<string>"
],
"effectivePermissions": [
"<string>"
],
"assignableByCaller": true,
"id": "<string>",
"description": "<string>",
"parentRoleId": "<string>",
"apiAssignable": true,
"reasons": [
"<string>"
],
"revision": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"messages": [
"<string>"
],
"retryable": true,
"details": {}
}
}Use this endpoint to list the built-in workspace roles, their permissions, and whether a platform key can assign each role. The endpoint does not return custom roles.
Check
assignableByCaller before you assign a role. It is the source of truth. A key can assign only builtin.workspace.restricted_member and builtin.workspace.workbench_manager. The request needs the workspace.roles.read scope.Was this page helpful?