Docs
Workspaces

Workspaces

Create a workspace, see what deleting one would remove, and delete it.

A workspace holds everything else — assistants, numbers, contacts, calls. A token belongs to exactly one workspace and cannot switch. These endpoints act on the token's own workspace, except create, which makes a new one owned by the token's user.

Beta. This API is documented but not yet frozen. Response fields and error codes may change without a version bump. Pin your integration to the fields you use, and expect additions.

Ownership, not membership

Billing is per user: a workspace runs on its owner's subscription, and one subscription funds every workspace that user owns, up to the plan's limit. So:

  • Create needs no role in any workspace — any signed-in user may create one, until they own as many as their plan allows (SUBSCRIPTION_LIMIT_EXCEEDED).
  • Read the deletion summary and delete need the OWNER role in the token's workspace.
  • You cannot delete the last workspace you own, even if you belong to others (MUST_HAVE_ONE_WORKSPACE).

Deleting is destructive

Deleting a workspace releases its dBel-provisioned numbers and takes them off the owner's subscription. It detaches imported numbers and tears down its SIP trunks. If you connected a Twilio account, it also removes the trunk setup dBel made in that account. It removes the workspace's assistants, functions, contacts, calls and knowledge bases. It revokes the workspace's API tokens, webhook secrets and integration tokens — including the token that made the call — and cancels pending invitations. Members lose access. Read the deletion summary first — it tells you how many numbers and members are affected.

A 204 means the workspace and its contents are gone, and every number in it is off the bill and out of the workspace. If a number cannot be taken off the bill or removed, or the database step that removes the contents fails, the workspace is kept and the call answers WORKSPACE_DELETE_FAILED (502). Numbers handled before the failure may already be released. Retry the delete: a retry is safe, and it finishes the numbers that are left.

Some steps are best-effort and do not change a 204: releasing a provisioned number at Twilio (we retry it later), removing a number from our call routing, detaching an imported number, the SIP trunk and Twilio account cleanup, and clearing the search index.

Endpoints

GET/api/workspaces

What deleting the token's workspace would remove.

Auth: Bearer token · workspace OWNER

Responses

200 JSON body:

FieldTypeNotes
provisionedNumbersnumber
importedNumbersnumber
otherMembersnumber

Errors

Problem Details (RFC 9457). Each code links to its reference page.

Plus the auth-layer codes every endpoint can return

POST/api/workspaces

Create a workspace owned by the calling user.

No workspace membership is checked — any signed-in user may create one, up to their plan's workspace limit.

Auth: Bearer token · any signed-in user (no workspace role checked)

Request body

application/json

Plus an optional updateCurrent: boolean (app/api/workspaces/route.ts:createWorkspaceSchema) — true makes the new workspace the one the user's dashboard opens. It does not move the calling token, which stays bound to its own workspace. To use the API on the new workspace, create a token for it in the dashboard.

FieldTypeNotes
name *stringmin 3, max 32

Responses

201 JSON body:

FieldTypeNotes
workspaceobject
workspace.idstring
workspace.namestring
workspace.timezonestring | null
workspace.createdAtdatetime
workspace.updatedAtdatetime
workspace.outboundCallingEnabledboolean
workspace.outboundComplianceAckAtdatetime | null
workspace.outboundComplianceAckByUserIdstring | null
workspace.businessNamestring | null
workspace.callbackNumberstring | null
workspace.termsUrlstring | null
workspace.privacyUrlstring | null
workspace.businessAddressstring | null
workspace.stopHandlingConfirmedboolean
workspace.stopHandlingAckAtdatetime | null
workspace.stopHandlingAckByUserIdstring | null
redirectstring

Errors

Problem Details (RFC 9457). Each code links to its reference page.

Plus the auth-layer codes every endpoint can return

DELETE/api/workspaces

Delete the token's workspace and everything in it.

Releases dBel-provisioned numbers and removes their Stripe items. Refused when it is the owner's last workspace.

Auth: Bearer token · workspace OWNER

Responses

204 No body.

Errors

Problem Details (RFC 9457). Each code links to its reference page.

  • 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
  • 400 MUST_HAVE_ONE_WORKSPACE — You cannot delete your last workspace. Create another workspace before deleting this one.
  • 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
  • 502 WORKSPACE_DELETE_FAILED — The workspace was not deleted. Some of its phone numbers may already be released. Please try again. A retry is safe.
Plus the auth-layer codes every endpoint can return