Workspaces API
Workspaces organize surveys, dashboards, and reports into logical groups. Most data endpoints require a workspace_id parameter.
List Workspaces
GET /api/workspaces
Returns all workspaces the authenticated user has access to.
Response:
{
"success": 1,
"data": [
{
"workspace_id": 1,
"workspace_name": "Brand Tracking",
"workspace_color": "#6366f1",
"workspace_visibility": 2,
"workspace_inserted": "2025-01-10T08:00:00.000Z"
}
]
}
Get Current Workspace
GET /api/workspaces/current
Switch Workspace
PUT /api/workspaces/current/:id
Get Workspace
GET /api/workspaces/:id
Create Workspace
POST /api/workspaces
| Field | Type | Required | Description |
|---|---|---|---|
workspace_name |
string | Yes | Workspace name |
workspace_color |
string | No | Hex color (default: #6366f1) |
workspace_visibility |
integer | No | 1=Private, 2=Team, 3=Shared (default: 1) |
Update Workspace
PUT /api/workspaces/:id
Delete Workspace
DELETE /api/workspaces/:id
Workspace Members
List Members
GET /api/workspaces/:id/members
Add Member
POST /api/workspaces/:id/members
| Field | Type | Description |
|---|---|---|
user_id |
integer | User to add |
role |
string | viewer or editor |
Remove Member
DELETE /api/workspaces/:id/members/:userId
Visibility Levels
| Value | Name | Description |
|---|---|---|
1 |
Private | Only the owner can see |
2 |
Team | All organization members can see |
3 |
Shared | Private + specific invited members |