Workspaces API
The Workspaces API lets you manage workspaces programmatically.
List Workspaces
Section titled “List Workspaces”Get all workspaces for the authenticated user.
GET /api/workspaceQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Description |
|---|---|---|
page | number | Page number (default: 1) |
limit | number | Results per page (default: 50, max: 100) |
Response
Section titled “Response”{ "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Personal", "userId": "880e8400-e29b-41d4-a716-446655440003", "isDefault": true, "totalStorageBytes": 1048576, "createdAt": "2024-01-01T00:00:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z", "contentCounts": { "notes": 42, "groups": 5, "todos": 23 }, "storageUsage": 1048576, "formattedStorageUsage": "1.0 MB" } ], "pagination": { "page": 1, "limit": 50, "total": 2, "totalPages": 1 }, "count": 2}Example
Section titled “Example”curl -X GET "https://sidvy.com/api/workspace" \ -H "Authorization: Bearer sidvy_abc123..."Create Workspace
Section titled “Create Workspace”Create a new workspace. Users are limited to 2 workspaces on the free plan.
POST /api/workspaceRequest Body
Section titled “Request Body”{ "name": "Side Project"}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Workspace name (must be unique per user) |
Response
Section titled “Response”{ "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Side Project", "userId": "880e8400-e29b-41d4-a716-446655440003", "isDefault": false, "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z", "storageUsage": 0, "formattedStorageUsage": "0 B" }, "count": 1}Example
Section titled “Example”curl -X POST "https://sidvy.com/api/workspace" \ -H "Authorization: Bearer sidvy_abc123..." \ -H "Content-Type: application/json" \ -d '{"name": "Side Project"}'Update Workspace
Section titled “Update Workspace”Update a workspace’s name.
PUT /api/workspaceRequest Body
Section titled “Request Body”{ "workspaceId": "550e8400-e29b-41d4-a716-446655440000", "name": "Renamed Workspace"}| Field | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID to update |
name | string | No | New workspace name |
Response
Section titled “Response”Returns the updated workspace object in the same format as create, including storage usage fields.
Example
Section titled “Example”curl -X PUT "https://sidvy.com/api/workspace" \ -H "Authorization: Bearer sidvy_abc123..." \ -H "Content-Type: application/json" \ -d '{"workspaceId": "550e8400-e29b-41d4-a716-446655440000", "name": "New Name"}'Delete Workspace
Section titled “Delete Workspace”Delete a workspace and all its contents.
DELETE /api/workspaceRequest Body
Section titled “Request Body”{ "workspaceId": "550e8400-e29b-41d4-a716-446655440000"}| Field | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID to delete |
Response
Section titled “Response”{ "data": { "deleted": true, "workspaceId": "550e8400-e29b-41d4-a716-446655440000", "deletedContent": { "notes": 42, "groups": 5, "todos": 23 } }, "count": 1}Example
Section titled “Example”curl -X DELETE "https://sidvy.com/api/workspace" \ -H "Authorization: Bearer sidvy_abc123..." \ -H "Content-Type: application/json" \ -d '{"workspaceId": "550e8400-e29b-41d4-a716-446655440000"}'Errors
Section titled “Errors”403 Workspace Limit Reached
Section titled “403 Workspace Limit Reached”{ "error": "FORBIDDEN", "message": "Maximum number of workspaces reached (2)"}403 Cannot Delete Default Workspace
Section titled “403 Cannot Delete Default Workspace”{ "error": "FORBIDDEN", "message": "Cannot delete default workspace"}404 Not Found
Section titled “404 Not Found”{ "error": "NOT_FOUND", "message": "Workspace not found"}400 Duplicate Name
Section titled “400 Duplicate Name”{ "error": "VALIDATION_ERROR", "message": "Workspace name already exists"}