Workspaces API
Create, manage, and collaborate on workspaces programmatically.
Overview
Workspaces are containers for related projects. These routes manage workspaces, invite members, and read workspace analytics.
Note
These are the web app's own routes under
https://app.fairlx.com/api. They accept only a signed-in session and may change. Programmatic access goes through the Fairlx MCP endpoint.List Workspaces
Retrieve all workspaces the authenticated user has access to.
Request
GET /api/workspacesResponse
{
"data": {
"documents": [
{
"$id": "ws_abc123",
"name": "Engineering",
"imageUrl": "https://...",
"inviteCode": "XY7K9M",
"userId": "user_123",
"organizationId": "org_456",
"$createdAt": "2024-01-15T10:00:00Z"
}
],
"total": 1
}
}Get Workspace
Retrieve details for a specific workspace.
Request
GET /api/workspaces/:workspaceIdCreate Workspace
Create a new workspace. Uses form data for file uploads.
Request
POST /api/workspaces
Content-Type: multipart/form-data
name=Engineering
image=(file)Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Workspace name |
| image | File | No | Workspace logo image |
Update Workspace
Update an existing workspace. Requires Admin or Owner role.
Request
PATCH /api/workspaces/:workspaceId
Content-Type: multipart/form-data
name=Engineering TeamDelete Workspace
Delete a workspace and all related data. Requires the workspace Owner or Admin role.
Warning
Deleting a workspace permanently removes all projects, tasks, time logs, and member associations. This action cannot be undone.
Request
DELETE /api/workspaces/:workspaceIdWorkspace Analytics
Get task analytics for a workspace, including monthly comparisons.
Request
GET /api/workspaces/:workspaceId/analyticsResponse
{
"data": {
"taskCount": 45,
"taskDifference": 12,
"assignedTaskCount": 15,
"assignedTaskDifference": 3,
"completedTaskCount": 28,
"completedTaskDifference": 8,
"incompleteTaskCount": 17,
"incompleteTaskDifference": 4,
"overdueTaskCount": 3,
"overdueTaskDifference": -2
}
}Join Workspace
Join a workspace using an invite code.
Request
POST /api/workspaces/:workspaceId/join
Content-Type: application/json
{"code": "XY7K9M"}Additional Endpoints
POST /workspaces/:id/reset-invite-code— Reset the invite code (Admin/Owner)GET /workspaces/:id/info— Get basic workspace info for an invite page (signed in)
