Skip to content

Create and select a workspace ​

Create a workspace in an account you administer, then read it back using its returned identity. A workspace groups resources and access; creating one does not automatically grant every member a paid AI entitlement.

Prerequisites ​

  • An interactive access token.
  • An existing account where you are allowed to create workspaces, normally an account owner or administrator.
  • curl and jq, with TOKEN set as in prerequisites.
  • The account UUID as ACCOUNT_ID. Use an actual account from your accessible accounts.

Step 1: Inspect existing workspaces ​

curl --fail-with-body -sS "https://api.chainabit.com/api/v1/workspaces" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Account-Id: $ACCOUNT_ID" | jq .

The result contains accessible workspaces under data. Do not assume a new account's list is empty; it may already have a default workspace.

Step 2: Create a workspace ​

Both name and slug are required. Choose an unused slug in your account.

WORKSPACE_RESPONSE="$(curl --fail-with-body -sS -X POST "https://api.chainabit.com/api/v1/workspaces" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Account-Id: $ACCOUNT_ID" \
  -H "Content-Type: application/json" \
  -d '{"slug":"launch-review","name":"Launch review","description":"Prepare and review launch work."}')"
printf '%s\n' "$WORKSPACE_RESPONSE" | jq .
export WORKSPACE_ID="$(printf '%s\n' "$WORKSPACE_RESPONSE" | jq -er '.data.id')"

Expect 201 Created. Capture the real data.id; it is the workspace UUID used in later requests.

FieldRequirement
slug3–64 lowercase letters, digits, or hyphens; begin and end with a letter or digit.
name2–180 characters.
descriptionOptional; at most 1,024 characters.
settingsOptional object.

Creation is also subject to account access and workspace limits. Inspect the returned error before retrying with another slug.

Step 3: Select and verify it ​

curl --fail-with-body -sS "https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Account-Id: $ACCOUNT_ID" \
  -H "X-Workspace-Id: $WORKSPACE_ID" | jq .

Expect 200 OK. Confirm that data.id matches the UUID you captured. Use these account and workspace headers where subsequent endpoints require explicit context.

This selects context for the request. Changing a saved default workspace is a separate operation and can require additional verification; it is not needed to finish this tutorial.

Add collaborators deliberately ​

Account membership, workspace membership, workspace role, and paid seat access are separate responsibilities. Use invitations and the workspace member reference for the appropriate flow.

Do not assume knowing a public username or profile is enough to add a person to a workspace. Confirm their account membership and your authority before changing access.

What you built ​

A workspace created with a valid slug, its returned UUID, and an explicit account/workspace context verified by a read request.

Next steps ​

Create a project or workspace agent, using the permissions and usage access that operation requires.

Built with purpose. chainabit.com