Workspaces API
CRUD operations for workspaces.
List Workspaces
Get all workspaces for the current user.
GET /api/workspaces
Authorization: Bearer <token>Response
{
"workspaces": [
{
"id": "workspace-id",
"name": "Marketing",
"icon": "📁",
"color": "#3B82F6",
"ownerId": "user-id",
"createdAt": "2025-01-10T10:00:00Z"
}
]
}Get Workspace
Get a single workspace.
GET /api/workspaces/:id
Authorization: Bearer <token>Response
{
"id": "workspace-id",
"name": "Marketing",
"icon": "📁",
"color": "#3B82F6",
"ownerId": "user-id",
"createdAt": "2025-01-10T10:00:00Z",
"updatedAt": "2025-01-15T09:00:00Z"
}Create Workspace
Create a new workspace.
POST /api/workspaces
Authorization: Bearer <token>Request Body
{
"name": "Engineering",
"icon": "🔧",
"color": "#10B981"
}Response
{
"success": true,
"workspace": {
"id": "new-workspace-id",
"name": "Engineering",
"icon": "🔧",
"color": "#10B981",
"ownerId": "current-user-id",
"createdAt": "2025-01-15T10:00:00Z"
}
}Update Workspace
Update workspace properties.
PATCH /api/workspaces/:id
Authorization: Bearer <token>Request Body
{
"name": "Updated Name",
"icon": "🚀",
"color": "#8B5CF6"
}Response
{
"success": true,
"workspace": {
"id": "workspace-id",
"name": "Updated Name",
"icon": "🚀",
"color": "#8B5CF6",
...
}
}Delete Workspace
Delete a workspace and all its boards.
DELETE /api/workspaces/:id
Authorization: Bearer <token>Response
{
"success": true,
"message": "Workspace deleted"
}⚠️ Warning: This permanently deletes all boards and tasks in the workspace.