BackendWorkspaces & Teams
API Endpoints
REST API for managing workspaces, teams, and memberships.
Workspaces
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/workspaces/ | List user's workspaces |
| POST | /api/workspaces/ | Create a workspace |
| GET | /api/workspaces/{id}/ | Retrieve workspace |
| PUT/PATCH | /api/workspaces/{id}/ | Update workspace (owner or admin), including status to archive it |
| DELETE | /api/workspaces/{id}/ | Delete workspace (owner only) |
| POST | /api/workspaces/{id}/transfer-ownership/ | Make another member the owner (owner only) |
| POST | /api/workspaces/{id}/leave/ | Leave the workspace (not the owner) |
| GET | /api/workspaces/{id}/credit-usage/ | The workspace's AI credit and how much is used |
| GET | /api/workspaces/{id}/plan/ | The plan, who pays for it, and usage: everything the billing page shows |
| GET | /api/workspaces/{id}/ai-models/ | The chat models on offer, whether the plan includes each, and their settings |
Create Workspace
POST /api/workspaces/{
"name": "My Project"
}The slug is auto-generated from the name. The authenticated user becomes the owner, with an admin membership.
Transfer Ownership
POST /api/workspaces/{id}/transfer-ownership/{
"user": 42
}user is the id of another member. Returns the workspace.
Credit Usage
GET /api/workspaces/{id}/credit-usage/{
"credit_limit": 8.0,
"total_cost_used": 2.4183,
"percentage_used": 30.23
}Any member can read it. See AI Usage & Credit.
Plan
GET /api/workspaces/{id}/plan/{
"plan": {
"key": "pro",
"name": "Pro",
"monthly_price_cents": 2000,
"ai_credit": 8.0,
"max_documents": 500,
"max_storage_bytes": 2147483648,
"max_file_size_bytes": 26214400,
"model_tiers": ["fast", "standard"]
},
"interval": "month",
"subscription": {
"status": "trialing",
"trial_end": "2026-10-11T09:00:00Z",
"period_end": "2026-10-11T09:00:00Z",
"cancel_at": null,
"cancel_at_period_end": false
},
"billing_contact": { "id": 42, "name": "Jane Doe", "email": "jane@example.com" },
"viewer": { "can_manage_billing": true, "is_billing_contact": true },
"usage": {
"documents": 112,
"storage_bytes": 431000000,
"credit_used": 0.42,
"credit_limit": 1.0,
"credit_renews_at": "2026-10-11T09:00:00Z"
}
}subscriptionisnullandplan.keyisfreeunless a subscription grants access (active, trialing or past due).billing_contactis the person paying: only they can open the billing portal for the workspace.viewer.can_manage_billingis true for the owner and admins, who can start checkout.credit_renews_atis the trial's end while trialing, the start of the next credit month on a paid plan, andnullon Free.
Any member can read it.
AI Models
GET /api/workspaces/{id}/ai-models/[
{
"id": "claude-haiku-4-5-20251001",
"label": "Claude Haiku 4.5",
"provider": "anthropic",
"tier": "fast",
"included": true,
"is_default": false,
"max_output_tokens": 8192,
"controls": {
"temperature": { "max": 1.0 },
"top_p": true,
"top_k": true,
"penalties": false,
"seed": false,
"stop": "stop_sequences",
"reasoning_effort": [],
"thinking": true,
"temperature_or_top_p": true
}
}
]Every model on offer, from the backend's model catalog, with included according to the workspace's plan and is_default for the plan's default. controls lists the settings the model takes; the chat paths send it nothing else. See AI Models. Any member can read it.
Teams
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/teams/ | List teams |
| POST | /api/teams/ | Create a team (workspace owner or admin) |
| GET | /api/teams/{id}/ | Retrieve team |
| PUT | /api/teams/{id}/ | Update team (team or workspace owner/admin) |
| DELETE | /api/teams/{id}/ | Delete team (team or workspace owner/admin) |
Workspace Memberships
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/workspacememberships/ | List memberships |
| GET | /api/workspacememberships/{id}/ | Retrieve membership |
| GET | /api/workspacememberships/mine/ | The current user's memberships |
| PUT | /api/workspacememberships/{id}/ | Change role (owner or admin; not your own, not the owner's) |
| DELETE | /api/workspacememberships/{id}/ | Remove member (owner or admin; not the owner) |
There's no endpoint to add a member: people join by accepting an invitation.
Team Memberships
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/teammemberships/ | List team memberships |
| GET | /api/teammemberships/mine/ | The current user's team memberships |
| PUT | /api/teammemberships/{id}/ | Change role |
| DELETE | /api/teammemberships/{id}/ | Remove from team |
People join a team by invitation too.
User Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users/me/ | The current user, with their workspaces and role in each |
| PATCH | /api/users/{id}/ | Update your own name |
Account management (email, password, deletion) is under /auth/users/.