Create Workspace
POST /workspaces
Authentication: JWT cookie
curl -X POST "https://api.vaani.ai/workspaces" \
-H "Content-Type: application/json" \
-H "Cookie: access_token=YOUR_TOKEN" \
-d '{
"name": "Acme Corp",
"type": "team"
}'
The creator is automatically assigned the Admin role. A URL-safe slug is auto-generated from the workspace name.
List My Workspaces
GET /workspaces
Returns all workspaces the authenticated user belongs to.
curl -X GET "https://api.vaani.ai/workspaces" \
-H "Cookie: access_token=YOUR_TOKEN"
Switch Active Workspace
POST /workspaces/{workspace_id}/switch
Updates the user’s current_workspace_id so subsequent requests use this workspace by default.
curl -X POST "https://api.vaani.ai/workspaces/ws_550e8400/switch" \
-H "Cookie: access_token=YOUR_TOKEN"
List Members
GET /workspaces/{workspace_id}/members
Authentication: JWT cookie (Member+)
curl -X GET "https://api.vaani.ai/workspaces/ws_550e8400/members" \
-H "Cookie: access_token=YOUR_TOKEN"
Invite Member
POST /workspaces/{workspace_id}/invite
Authentication: JWT cookie (Admin)
curl -X POST "https://api.vaani.ai/workspaces/ws_550e8400/invite" \
-H "Content-Type: application/json" \
-H "Cookie: access_token=YOUR_TOKEN" \
-d '{
"email": "[email protected]",
"role": "developer"
}'
If the email is not registered on Vaani, the invite is silently ignored in the current implementation. Full email-based invite flow is planned.
Remove Member
DELETE /workspaces/{workspace_id}/members/{user_id}
Authentication: JWT cookie (Admin)
curl -X DELETE "https://api.vaani.ai/workspaces/ws_550e8400/members/u_002" \
-H "Cookie: access_token=YOUR_TOKEN"
Delete Workspace
DELETE /workspaces/{workspace_id}
Authentication: JWT cookie (Admin)
This permanently deletes the workspace and all associated data (agents, calls, phone numbers). This action cannot be undone.
curl -X DELETE "https://api.vaani.ai/workspaces/ws_550e8400" \
-H "Cookie: access_token=YOUR_TOKEN"