Skip to main contentSkip to Content
Workspaces

Workspaces

Workspaces are the top-level multi-tenant boundary in CampaignOS. All contacts, campaigns, segments, and other resources belong to a workspace.

List Workspaces

GET /api/workspaces

Returns all workspaces the authenticated user is a member of.

Auth: Session required

Response:

[ { "id": "ws_abc123", "name": "My Company", "slug": "my-company", "settings": {}, "createdAt": "2026-01-15T10:00:00.000Z", "role": "OWNER" } ]

Create Workspace

POST /api/workspaces

Creates a new workspace. The authenticated user becomes the OWNER.

Auth: Session required

Request Body:

{ "name": "My Company", "slug": "my-company" }
FieldTypeRequiredDescription
namestringYesDisplay name of the workspace
slugstringYesURL-friendly identifier (unique)

Response (201):

{ "id": "ws_abc123", "name": "My Company", "slug": "my-company", "settings": {}, "createdAt": "2026-01-15T10:00:00.000Z", "members": [ { "userId": "usr_123", "role": "OWNER" } ] }

Errors:

  • 409 — Slug already taken

Get Workspace

GET /api/workspaces/{workspaceId}

Auth: Session + membership required

Response: Full workspace object.

Update Workspace

PATCH /api/workspaces/{workspaceId}

Auth: Session + membership required

Request Body: Partial workspace fields (name, settings, etc.)

Response: Updated workspace object.

Delete Workspace

DELETE /api/workspaces/{workspaceId}

Auth: Session + OWNER role required

Response:

{ "success": true }

Only the workspace owner can delete a workspace. This permanently removes all associated data.

Last updated on