Skip to content

Workspaces ​

Workspaces ​

GET /workspaces ​

List workspaces accessible to the authenticated user.

Authentication: JWT Bearer token

Request ​

No path, query, or body parameters.

Response ​

Response Example ​
json
{
  "data": [
    {
      "id": "ws-abcd-efgh",
      "name": "Product Development",
      "accountId": "acc-1234-5678",
      "isActive": true,
      "isDefault": true,
      "createdAt": "2026-01-20T09:00:00.000Z"
    },
    {
      "id": "ws-ijkl-mnop",
      "name": "Marketing",
      "accountId": "acc-1234-5678",
      "isActive": true,
      "isDefault": false,
      "createdAt": "2026-02-05T14:00:00.000Z"
    }
  ],
  "meta": {
    "total": 2
  },
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringWorkspace ID
namestringWorkspace display name
accountIdstringID of the account this workspace belongs to
isActivebooleanWhether the workspace is currently active
isDefaultbooleanWhether this is the user's default workspace
createdAtstringISO 8601 timestamp of workspace creation

Code Examples ​

curl "https://api.chainabit.com/api/v1/workspaces" \
  -H "Authorization: Bearer $TOKEN"

POST /workspaces ​

Create a new workspace in the authenticated account.

Authentication: JWT Bearer token

Request ​

FieldTypeRequiredConstraintsDescription
slugstringYesURL-safe identifierWorkspace slug
namestringYesNon-empty stringDisplay name for the workspace
descriptionstringNoMax 1024 charsOptional description
settingsobjectNoJSON objectOptional workspace settings

Response ​

Response Example ​
json
{
  "data": {
    "id": "ws-qrst-uvwx",
    "name": "Engineering",
    "accountId": "acc-1234-5678",
    "isActive": true,
    "isDefault": false,
    "createdAt": "2026-03-17T11:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringNewly created workspace ID
namestringWorkspace display name
accountIdstringID of the account this workspace belongs to
isActivebooleanAlways true on creation
isDefaultbooleanWhether this is the default workspace
createdAtstringISO 8601 timestamp of workspace creation

Code Examples ​

curl -X POST "https://api.chainabit.com/api/v1/workspaces" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "engineering",
    "name": "Engineering"
  }'

GET /workspaces/:id ​

Get a workspace by ID. The authenticated user must be a member of the workspace.

Authentication: JWT Bearer token (must be a workspace member)

Request ​

Replace $WORKSPACE_ID below with the id from a List Workspaces or Create Workspace response.

Response ​

Response Example ​
json
{
  "data": {
    "id": "ws-abcd-efgh",
    "name": "Product Development",
    "accountId": "acc-1234-5678",
    "isActive": true,
    "isDefault": true,
    "membersCount": 4,
    "createdAt": "2026-01-20T09:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringWorkspace ID
namestringWorkspace display name
accountIdstringID of the account this workspace belongs to
isActivebooleanWhether the workspace is currently active
isDefaultbooleanWhether this is the default workspace
membersCountnumberTotal number of members in this workspace
createdAtstringISO 8601 timestamp of workspace creation

Code Examples ​

curl "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID" \
  -H "Authorization: Bearer $TOKEN"

PATCH /workspaces/:id ​

Update a workspace's name or settings. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

Replace $WORKSPACE_ID below with the id from a List Workspaces or Create Workspace response.

FieldTypeRequiredConstraintsDescription
namestringNoNon-empty stringNew display name for the workspace

Response ​

Response Example ​
json
{
  "data": {
    "id": "ws-abcd-efgh",
    "name": "Product & Design",
    "updatedAt": "2026-03-17T11:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringWorkspace ID
namestringUpdated workspace display name
updatedAtstringISO 8601 timestamp of this update

Code Examples ​

curl -X PATCH "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product & Design"
  }'

PATCH /workspaces/:id/activation ​

Activate or deactivate a workspace. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

Replace $WORKSPACE_ID below with the id from a List Workspaces or Create Workspace response.

FieldTypeRequiredConstraintsDescription
isActivebooleanYestrue or falseWhether the workspace should be active

Response ​

Response Example ​
json
{
  "data": {
    "id": "ws-abcd-efgh",
    "isActive": false,
    "updatedAt": "2026-03-17T12:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringWorkspace ID
isActivebooleanUpdated activation status
updatedAtstringISO 8601 timestamp of this update

Code Examples ​

curl -X PATCH "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/activation" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "isActive": false
  }'

PUT /workspaces/:id/default ​

Set a workspace as the default workspace. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

Replace $WORKSPACE_ID below with the id from a List Workspaces or Create Workspace response.

Response ​

Response Example ​
json
{
  "data": {
    "id": "ws-abcd-efgh",
    "name": "Product Development",
    "isDefault": true,
    "updatedAt": "2026-03-17T12:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringWorkspace ID
namestringWorkspace display name
isDefaultbooleanAlways true after this operation
updatedAtstringISO 8601 timestamp of this update

Code Examples ​

curl -X PUT "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/default" \
  -H "Authorization: Bearer $TOKEN"

PUT /workspaces/:id/active ​

Mark a workspace as the caller's active workspace right now. This is a UX hint, not an access-control check — it lets other signed-in devices or sessions pick up which workspace you're currently looking at on their next load. It does not affect isDefault, membership, or permissions.

Authentication: JWT Bearer token (must be a workspace member)

Request ​

Replace $WORKSPACE_ID below with the id from a List Workspaces or Create Workspace response.

No body.

Response ​

Response Example ​
json
{
  "data": {
    "id": "ws-abcd-efgh",
    "name": "Product Development",
    "accountId": "acc-1234-5678",
    "isActive": true,
    "isDefault": true,
    "createdAt": "2026-01-20T09:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringWorkspace ID
namestringWorkspace display name
accountIdstringID of the account this workspace belongs to
isActivebooleanWhether the workspace is currently active
isDefaultbooleanWhether this is the user's default workspace
createdAtstringISO 8601 timestamp of workspace creation

Code Examples ​

curl -X PUT "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/active" \
  -H "Authorization: Bearer $TOKEN"

Workspace Members ​

GET /workspaces/:id/members ​

List all members of a workspace.

Authentication: JWT Bearer token (must be a workspace member)

Request ​

Replace $WORKSPACE_ID below with the id from a List Workspaces or Create Workspace response.

Response ​

Response Example ​
json
{
  "data": [
    {
      "chainerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "username": "alice_j",
      "fullName": "Alice Johnson",
      "role": "owner",
      "joinedAt": "2026-01-20T09:00:00.000Z"
    },
    {
      "chainerId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "username": "bob_dev",
      "fullName": "Bob Smith",
      "role": "admin",
      "joinedAt": "2026-02-25T16:00:00.000Z"
    }
  ],
  "meta": {
    "total": 2
  },
  "error": null
}
Response Fields ​
FieldTypeDescription
chainerIdstringMember's user ID
usernamestringMember's username
fullNamestringMember's full name
rolestringMember's role in this workspace (owner, admin, member, analyst, billing, viewer)
joinedAtstringISO 8601 timestamp of when the member joined

Code Examples ​

curl "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/members" \
  -H "Authorization: Bearer $TOKEN"

POST /workspaces/:id/members ​

Add a member to a workspace. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

Replace $WORKSPACE_ID below with the id from a List Workspaces or Create Workspace response. chainerId is the user's own ID — get it from Identity / Chainers.

FieldTypeRequiredConstraintsDescription
chainerIdstringYesValid user IDID of the user to add. Obtain this value from the Identity / Chainers endpoint.
rolestringYesOne of owner, admin, member, analyst, billing, viewerRole to assign within the workspace

Response ​

Response Example ​
json
{
  "data": {
    "chainerId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "role": "member",
    "joinedAt": "2026-03-17T11:10:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
chainerIdstringAdded member's user ID
rolestringAssigned role
joinedAtstringISO 8601 timestamp of when the member was added

Code Examples ​

curl -X POST "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/members" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "chainerId": "<user-id>",
    "role": "member"
  }'

PATCH /workspaces/:id/members/:chainerId ​

Update a workspace member's role. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Role changes take effect immediately.

Assigning owner or admin is reserved for the workspace owner and needs a recent passkey verification. Without one the API answers 403 with STEP_UP_REQUIRED and a challenge to complete first; an account with no passkey gets 403 VERIFICATION_METHOD_UNAVAILABLE. Another caller asking for owner gets 400 enterprise_workspace_owner_role_restricted, and one asking for admin gets 403 enterprise_workspace_role_required. See Account and workspace roles.

Request ​

Replace $WORKSPACE_ID with the workspace id and $CHAINER_ID with the member's chainerId from a List Members response.

FieldTypeRequiredConstraintsDescription
rolestringYesOne of owner, admin, member, analyst, billing, viewerNew role for the member

Response ​

Response Example ​
json
{
  "data": {
    "chainerId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "role": "admin",
    "updatedAt": "2026-03-17T11:15:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
chainerIdstringMember's user ID
rolestringUpdated role
updatedAtstringISO 8601 timestamp of this update

Code Examples ​

curl -X PATCH "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/members/$CHAINER_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "admin"
  }'

DELETE /workspaces/:id/members/:chainerId ​

Remove a member from a workspace. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Removal takes effect immediately, so access is removed on the next request.

Request ​

Replace $WORKSPACE_ID with the workspace id and $CHAINER_ID with the member's chainerId from a List Members response.

Response ​

Response Example ​
json
{
  "data": {
    "chainerId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "removedAt": "2026-03-17T11:20:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
chainerIdstringRemoved member's user ID
removedAtstringISO 8601 timestamp of when the member was removed

Code Examples ​

curl -X DELETE "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/members/$CHAINER_ID" \
  -H "Authorization: Bearer $TOKEN"

Built with purpose. chainabit.com