API Reference
Complete reference for all Futurity API endpoints.
Base URL
Section titled “Base URL”https://api.futurity.work/v1Authentication
Section titled “Authentication”All endpoints require authentication. See Authentication.
Authorization: Bearer YOUR_TOKENGet Current User
Section titled “Get Current User”Get information about the authenticated user.
GET /whoamiResponse:
{ "data": { "id": "user_abc123", "email": "user@example.com", "name": "John Doe", "avatar_url": "https://...", "organization_id": "org_xyz789", "created_at": "2024-01-01T00:00:00Z" }}List Chats
Section titled “List Chats”Get all conversations for the current user.
GET /chatsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
limit | number | Max items (default: 20) |
offset | number | Pagination offset |
archived | boolean | Include archived chats |
Response:
{ "data": [ { "id": "chat_123", "title": "Q3 Report Discussion", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T14:22:00Z", "archived": false } ], "pagination": { "total": 45, "limit": 20, "offset": 0, "hasMore": true }}Create Chat
Section titled “Create Chat”Start a new conversation.
POST /chatsBody:
{ "title": "New Project Discussion"}Response:
{ "data": { "id": "chat_456", "title": "New Project Discussion", "created_at": "2024-01-16T09:00:00Z" }}Get Chat
Section titled “Get Chat”Get a specific conversation with messages.
GET /chats/:idResponse:
{ "data": { "id": "chat_123", "title": "Q3 Report Discussion", "messages": [ { "id": "msg_001", "role": "user", "content": "Help me analyze the Q3 report", "created_at": "2024-01-15T10:30:00Z" }, { "id": "msg_002", "role": "assistant", "content": "I'd be happy to help...", "created_at": "2024-01-15T10:30:05Z" } ] }}Send Message
Section titled “Send Message”Send a message in a conversation.
POST /chats/:id/messagesBody:
{ "content": "What were the key findings?", "attachments": [ { "file_id": "file_abc", "type": "vault_file" } ]}Response:
{ "data": { "id": "msg_003", "role": "user", "content": "What were the key findings?", "created_at": "2024-01-15T10:35:00Z" }}Delete Chat
Section titled “Delete Chat”Delete a conversation.
DELETE /chats/:idResponse: 204 No Content
List Files
Section titled “List Files”Get files in Vault.
GET /vault/filesQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
folder_id | string | Filter by folder |
search | string | Search filename |
type | string | Filter by file type |
limit | number | Max items |
offset | number | Pagination offset |
Response:
{ "data": [ { "id": "file_abc", "name": "Q3-Report.pdf", "type": "application/pdf", "size": 245000, "folder_id": "folder_123", "created_at": "2024-01-10T08:00:00Z", "updated_at": "2024-01-10T08:00:00Z" } ]}Upload File
Section titled “Upload File”Upload a file to Vault.
POST /vault/filesContent-Type: multipart/form-dataForm Data:
| Field | Type | Description |
|---|---|---|
file | file | The file to upload |
folder_id | string | Destination folder (optional) |
name | string | Override filename (optional) |
Response:
{ "data": { "id": "file_xyz", "name": "uploaded-file.pdf", "type": "application/pdf", "size": 123456, "created_at": "2024-01-16T10:00:00Z" }}Get File
Section titled “Get File”Get file details.
GET /vault/files/:idResponse:
{ "data": { "id": "file_abc", "name": "Q3-Report.pdf", "type": "application/pdf", "size": 245000, "folder_id": "folder_123", "download_url": "https://...", "shared_with": [], "created_at": "2024-01-10T08:00:00Z" }}Download File
Section titled “Download File”Get a download URL for a file.
GET /vault/files/:id/downloadResponse:
{ "data": { "url": "https://signed-url...", "expires_at": "2024-01-16T11:00:00Z" }}Delete File
Section titled “Delete File”Delete a file (moves to trash).
DELETE /vault/files/:idResponse: 204 No Content
Workflows
Section titled “Workflows”List Workflows
Section titled “List Workflows”Get all workflows.
GET /workflowsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status |
limit | number | Max items |
offset | number | Pagination offset |
Response:
{ "data": [ { "id": "wf_123", "name": "Daily Report", "status": "active", "trigger_type": "schedule", "created_at": "2024-01-01T00:00:00Z", "last_run": "2024-01-16T09:00:00Z" } ]}Create Workflow
Section titled “Create Workflow”Create a new workflow.
POST /workflowsBody:
{ "name": "New Workflow", "description": "Description of what it does", "trigger": { "type": "manual" }, "nodes": []}Response:
{ "data": { "id": "wf_456", "name": "New Workflow", "status": "draft", "created_at": "2024-01-16T10:00:00Z" }}Get Workflow
Section titled “Get Workflow”Get workflow details including nodes.
GET /workflows/:idResponse:
{ "data": { "id": "wf_123", "name": "Daily Report", "status": "active", "trigger": { "type": "schedule", "config": { "cron": "0 9 * * *" } }, "nodes": [ { "id": "node_1", "type": "ai_task", "config": {...} } ] }}Update Workflow
Section titled “Update Workflow”Update a workflow.
PUT /workflows/:idBody:
{ "name": "Updated Name", "status": "active"}Delete Workflow
Section titled “Delete Workflow”Delete a workflow.
DELETE /workflows/:idResponse: 204 No Content
Run Workflow
Section titled “Run Workflow”Manually trigger a workflow.
POST /workflows/:id/runBody:
{ "inputs": { "customer_id": "cust_123" }}Response:
{ "data": { "execution_id": "exec_789", "status": "running", "started_at": "2024-01-16T10:30:00Z" }}Dashboards
Section titled “Dashboards”List Dashboards
Section titled “List Dashboards”Get all dashboards.
GET /dashboardsResponse:
{ "data": [ { "id": "dash_123", "name": "Sales Overview", "created_at": "2024-01-01T00:00:00Z" } ]}Create Dashboard
Section titled “Create Dashboard”Create a new dashboard.
POST /dashboardsBody:
{ "name": "New Dashboard", "widgets": []}Get Dashboard
Section titled “Get Dashboard”Get dashboard with widgets.
GET /dashboards/:idResponse:
{ "data": { "id": "dash_123", "name": "Sales Overview", "widgets": [ { "id": "widget_1", "type": "metric", "config": {...}, "position": {"x": 0, "y": 0, "w": 2, "h": 1} } ] }}Error Codes
Section titled “Error Codes”| Code | Description |
|---|---|
UNAUTHORIZED | Invalid or missing authentication |
FORBIDDEN | Insufficient permissions |
NOT_FOUND | Resource doesn’t exist |
VALIDATION_ERROR | Invalid request body |
RATE_LIMITED | Too many requests |
INTERNAL_ERROR | Server error |