Workspaces
REST endpoints for workspaces. Bearer-auth required.
GET /api/workspaces
List workspaces.
Query parameters
limit(optional): Page size (1–100, default 100).after(optional): Keyset cursor — return the page after this row (next page).before(optional): Keyset cursor — return the page before this row (prev page).ids(optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).filter(optional): Nested filter expression (<Entity>Filter): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.orderBy(optional): Multi-key sort (<Entity>OrderBy[]): array of{ field: direction }applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.organization_id(optional): Filter to workspaces in this organization.handle(optional): Filter to a workspace with this handle. Combine withorganization_idfor org-scoped handle lookup.include_deleted(optional): Soft-deleted workspace visibility.false(default) — active rows only.true— active plus soft-deleted.only— soft-deleted only.owner_id(optional): Shorthand: filter whereownerIdequals this value.default_service_user_id(optional): Shorthand: filter wheredefaultServiceUserIdequals this value.retention_tier(optional): Shorthand: filter whereretentionTierequals this value.
Response
JSON
{
"data": [
{
"id": "<...>",
"organizationId": "<...>",
"name": "<...>",
"handle": "<...>",
"ownerId": "<...>",
"defaultServiceUserId": "<...>",
"deletedAt": "<...>",
"retentionTier": "<...>",
"createdAt": "<...>",
"updatedAt": "<...>"
}
],
"pageInfo": {
"total": "number",
"hasNextPage": "boolean",
"hasPreviousPage": "boolean",
"startCursor": "string",
"endCursor": "string"
}
}POST /api/workspaces
Create workspace
Request body
JSON
{
"organizationId": "string",
"name": "string",
"handle": "string"
}Response
JSON
{
"id": "string",
"organizationId": "string",
"name": "string",
"handle": "string",
"ownerId": "string",
"defaultServiceUserId": "string",
"deletedAt": "string",
"retentionTier": "any",
"createdAt": "string",
"updatedAt": "string"
}GET /api/workspaces/{id}
Get a workspace by ID.
Path parameters
id(required): Workspace to retrieve.
Response
JSON
{
"id": "string",
"organizationId": "string",
"name": "string",
"handle": "string",
"ownerId": "string",
"defaultServiceUserId": "string",
"deletedAt": "string",
"retentionTier": "any",
"createdAt": "string",
"updatedAt": "string"
}PATCH /api/workspaces/{id}
Update workspace
Path parameters
id(required): The workspace's prefixed ID.
Request body
JSON
{
"name?": "string",
"handle?": "string"
}Response
JSON
{
"id": "string",
"organizationId": "string",
"name": "string",
"handle": "string",
"ownerId": "string",
"defaultServiceUserId": "string",
"deletedAt": "string",
"retentionTier": "any",
"createdAt": "string",
"updatedAt": "string"
}DELETE /api/workspaces/{id}
Soft-delete a workspace.
Path parameters
id(required): Workspace to soft-delete.
Response
JSON
{
"success": "boolean"
}GET /api/workspaces/{id}/email
Get workspace email settings
Returns the workspace's email gateway address, enabled state, and config.
Path parameters
id(required): The workspace's prefixed ID.
Response
JSON
{
"address": "string",
"enabled": "boolean",
"config": {
"maxBytes?": "<...>",
"allowedSenders?": "<...>"
}
}PATCH /api/workspaces/{id}/email
Update workspace email settings
Patch the workspace's email gateway settings (enable/disable, allowed senders, max bytes, etc.). Workspace admins only.
Path parameters
id(required): The workspace's prefixed ID.
Request body
JSON
{
"enabled?": "boolean",
"config?": {
"maxBytes?": "integer",
"allowedSenders?": ["<...>"]
}
}Response
JSON
{
"address": "string",
"enabled": "boolean",
"config": {
"maxBytes?": "<...>",
"allowedSenders?": "<...>"
}
}DELETE /api/workspaces/{id}/purge
Permanently delete a soft-deleted workspace.
Path parameters
id(required): Soft-deleted workspace to permanently delete.
Response
JSON
{
"success": "boolean"
}POST /api/workspaces/{id}/restore
Restore a soft-deleted workspace.
Path parameters
id(required): Soft-deleted workspace to restore.
Response
JSON
{
"id": "string",
"organizationId": "string",
"name": "string",
"handle": "string",
"ownerId": "string",
"defaultServiceUserId": "string",
"deletedAt": "string",
"retentionTier": "any",
"createdAt": "string",
"updatedAt": "string"
}