Перейти к основному содержимому

API Endpoints

This page is the route map for the current backend API.

Use it when you already know what part of the product you are touching and need the exact path, auth expectation, or response shape.

All REST endpoints are versioned under /v1/. Successful mutations with no response body return 204 No Content. JSON field names use snake_case.

How To Read This Page

The table near the top is the quickest way to find a route.

The sections below it add more detail:

  • public endpoints first
  • then auth and user endpoints
  • then workspace, agent, conversation, integration, notification, and support endpoints
  • realtime (Socket.IO) at the end

If you are new, start with the endpoint summary and the response envelope, then jump only to the section you need.

Endpoint Summary

MethodPathAuthDescription
GET/v1/healthHealth check
GET/v1/legalLegal documents
POST/v1/fcm-tokenYesSave push token
POST/v1/auth/sign-inYesSign in
POST/v1/auth/sign-upYesSign up
DELETE/v1/auth/deleteYesDelete account
GET/v1/users/profileYesGet user profile
PATCH/v1/usersYesUpdate user profile
GET/v1/users/legalYesGet user legal status
POST/v1/users/legal/acceptYesAccept legal documents
GET/v1/workspacesYesList workspaces
GET/v1/workspaces/{id}YesGet workspace
POST/v1/workspacesYesCreate workspace
PATCH/v1/workspaces/{id}YesUpdate workspace
DELETE/v1/workspaces/{id}YesDelete workspace
GET/v1/workspaces/{workspaceId}/agentsYesList agents in workspace
GET/v1/agents/{id}YesGet agent
GET/v1/agents/{id}/detailsYesGet agent details
GET/v1/agents/{id}/historyYesGet agent conversation history
GET/v1/agents/{id}/settingsYesGet agent settings
GET/v1/workspaces/{workspaceId}/conversationsYesList conversations
GET/v1/workspaces/{workspaceId}/conversations/{id}YesGet conversation
GET/v1/workspaces/{workspaceId}/conversations/{id}/messagesYesList messages
POST/v1/workspaces/{workspaceId}/conversations/{id}/messagesYesSend message
POST/v1/workspaces/{workspaceId}/messages/{id}/actionYesRespond to action card
GET/v1/integrationsYesList tools and integrations
POST/v1/integrations/connectYesGet OAuth config
POST/v1/integrations/callbackYesSend OAuth auth code
GET/v1/integrations/{provider}/accountsYesList connected accounts
DELETE/v1/integrations/{provider}/accounts/{accountId}YesDisconnect account
PATCH/v1/tools/{name}YesToggle tool
GET/v1/notificationsYesList notifications
POST/v1/notifications/{id}/readYesMark notification read
POST/v1/notifications/read-allYesMark all notifications read
GET/v1/notifications/preferencesYesGet notification preferences
PATCH/v1/notifications/preferencesYesUpdate notification preferences
POST/v1/support/ticketYesSubmit support ticket
WS/socket.io/ (/v1 namespace)YesRealtime Socket.IO transport

Response Envelope

Most successful REST responses are wrapped in a data envelope:

{ "data": { ... } }

Mutations that produce no body return 204 No Content.

Error Response

Errors are returned as a structured object:

{
"message": "string",
"code": "string",
"extra": {}
}

extra may be null when no additional context is available.

Common Enums

EnumValues
RuntimeStatusprovisioning, ready, offline, failed
RuntimePhasePending, Progressing, Ready, Error
AgentStatusonline, busy, pending, error, offline
AgentSkillweb_search, analysis, fact_check, news, sources, coding, writing, translation, summarization, planning
AgentModelflash, sonnet, opus
ResponseLengthauto, short, medium, long
ConversationTypeswarm, agent
MessageRoleuser, agent, system
MessageStatuspending, delivered, failed
MessageContentTypetext, action_card, tool_status, system, loading
AttachmentTypeimage, video, audio, file
ActionStyleprimary, secondary, destructive
ToolStaterunning, completed, failed
IntegrationItemTypetool, app
IntegrationProvidergoogle_calendar, gmail, slack, jira, notion, asana, github, zoom
NotificationTypeagentMessage, systemAlert, workspaceUpdate

Core

GET /v1/health

No authentication.

{ "data": { "online": true, "version": "1.0.0" } }

GET /v1/legal

No authentication. Returns the current legal document content and versions.

{
"data": {
"terms_of_service": "string",
"privacy_policy": "string",
"has_agreed_with_terms": false,
"has_agreed_with_privacy_policy": false,
"terms_of_service_version": "string",
"privacy_policy_version": "string"
}
}

POST /v1/fcm-token

Saves the device push token for Firebase Cloud Messaging.

Request:

{ "push_token": "string" }

Response:

{ "success": true }

Authentication

All auth endpoints require a Firebase ID token in the X-Token header.

POST /v1/auth/sign-in

No body. Response: 204 No Content.

POST /v1/auth/sign-up

No body. Response: 204 No Content.

DELETE /v1/auth/delete

Request:

{ "reason": "string", "description": "string" }

Response: 204 No Content.

User

GET /v1/users/profile

Returns the authenticated user's full profile.

{
"data": {
"email": "string",
"firebase_uid": "string",
"nickname": "string",
"name": "string",
"surname": "string",
"avatar_url": "string",
"country_code": "string",
"date_of_birth": "ISO8601 | null",
"created_at": "ISO8601",
"is_deleted": false,
"is_banned": false,
"has_agreed_with_terms": false,
"has_agreed_with_privacy_policy": false,
"preferences": {
"platform_theme": "string",
"platform_language": "string",
"currency_code": "string"
},
"subscription": {
"name": "string",
"code": "string",
"expires_at": "ISO8601 | null"
}
}
}

PATCH /v1/users

All fields optional. Response: 204 No Content.

{
"nickname": "string",
"country_code": "string",
"surname": "string",
"name": "string",
"date_of_birth": "ISO8601",
"preferences": {
"platform_theme": "string",
"platform_language": "string",
"currency_code": "string"
}
}

GET /v1/users/legal

Returns the current legal document versions plus the user's acceptance state.

{
"data": {
"terms_of_service": "string",
"privacy_policy": "string",
"has_agreed_with_terms": false,
"has_agreed_with_privacy_policy": false,
"terms_of_service_version": "string",
"privacy_policy_version": "string"
}
}

POST /v1/users/legal/accept

Accepts one or both legal document versions. All fields optional.

Request:

{
"terms_of_service_version": "string",
"privacy_policy_version": "string"
}

Response: 204 No Content.

Workspaces

Each workspace response includes a runtime object representing the current swarm status.

Workspace shape:

{
"id": "string",
"name": "string",
"created_at": "ISO8601",
"updated_at": "ISO8601",
"runtime": {
"status": "provisioning | ready | offline | failed",
"phase": "Pending | Progressing | Ready | Error",
"verified": false,
"total_agents": 0,
"last_message_preview": {
"text": "string",
"sender_name": "string",
"timestamp": "ISO8601"
}
}
}

GET /v1/workspaces

Returns all workspaces owned by the authenticated user.

{ "data": [ ...workspaces ] }

GET /v1/workspaces/{id}

Returns a single workspace by ID.

{ "data": workspace }

POST /v1/workspaces

Creates a new workspace.

Request:

{ "name": "string" }

Response:

{ "data": workspace }

PATCH /v1/workspaces/{id}

Updates workspace properties. All fields optional.

Request:

{ "name": "string" }

Response: 204 No Content.

DELETE /v1/workspaces/{id}

Deletes a workspace permanently.

Response: 204 No Content.

Agents

GET /v1/workspaces/{workspaceId}/agents

Returns all agents belonging to the workspace.

{
"data": [
{
"id": "string",
"name": "string",
"role": "string",
"slug": "string",
"avatar": "string",
"status": "online | busy | pending | error | offline"
}
]
}

GET /v1/agents/{id}

Returns a single agent summary (same shape as the list item above).

{
"data": {
"id": "string",
"name": "string",
"role": "string",
"slug": "string",
"avatar": "string",
"status": "online | busy | pending | error | offline"
}
}

GET /v1/agents/{id}/details

Returns the full agent profile including skills and stats.

{
"data": {
"id": "string",
"workspace_id": "string",
"name": "string",
"role": "string",
"slug": "string",
"created_at": "ISO8601",
"updated_at": "ISO8601 | null",
"description": "string",
"avatar_url": "string",
"status": "online | busy | pending | error | offline",
"sort_order": 0,
"skills": [
"web_search",
"analysis",
"fact_check",
"news",
"sources",
"coding",
"writing",
"translation",
"summarization",
"planning"
],
"stats": {
"total_messages": 0,
"memory_used_pct": 0
}
}
}

GET /v1/agents/{id}/history

Returns the agent's past conversation summaries. Supports offset-based pagination.

Query params: limit (int), offset (int)

{
"items": [
{
"conversation_id": "string",
"title": "string",
"subtitle": "string",
"created_at": "ISO8601 | null"
}
]
}

GET /v1/agents/{id}/settings

Returns the agent's model configuration and available system prompts.

{
"data": {
"model": "flash | sonnet | opus",
"response_length": "auto | short | medium | long",
"prompts": [
{
"id": "string",
"name": "string",
"description": "string",
"content": "string"
}
]
}
}

Conversations and Messages

GET /v1/workspaces/{workspaceId}/conversations

Lists conversations for a workspace. Each item includes the last message and unread count.

{
"data": [
{
"id": "string",
"type": "swarm | agent",
"title": "string",
"created_at": "ISO8601",
"updated_at": "ISO8601",
"unread_count": 0,
"agent": {
"id": "string",
"name": "string",
"role": "string",
"slug": "string",
"avatar": "string",
"status": "string"
},
"last_message": "MessageData | null"
}
]
}

agent is null for swarm conversations.

GET /v1/workspaces/{workspaceId}/conversations/{id}

Returns one conversation (same shape as a list item).

GET /v1/workspaces/{workspaceId}/conversations/{id}/messages

Lists messages with cursor-based pagination.

Query params: scrollId (string, cursor token), limit (int), direction ("forward" or "backward")

{
"data": [
{
"id": "string",
"conversation_id": "string",
"role": "user | agent | system",
"content": "MessageContent (see below)",
"status": "pending | delivered | failed",
"created_at": "ISO8601",
"updated_at": "ISO8601",
"local_id": "string | null",
"agent": "AgentData | null",
"attachments": [
{
"id": "string",
"url": "string",
"type": "image | video | audio | file",
"name": "string",
"size": 0,
"mime_type": "string",
"duration": "int | null"
}
],
"mentions": [
{
"agent_id": "string",
"agent_name": "string",
"offset": 0,
"length": 0
}
]
}
],
"pagination": {
"next_scroll_id": "string",
"prev_scroll_id": "string",
"has_next": true,
"has_prev": false
}
}

MessageContent

content is a discriminated union on the type field:

typeFields
texttext: string
action_cardtitle: string, description: string, actions: [{ id, label, style }], selected_action_id: string?
tool_statustool: string, description: string, state: running | completed | failed
systemtext: string
loading(no additional fields)

ActionStyle values: primary, secondary, destructive.

POST /v1/workspaces/{workspaceId}/conversations/{id}/messages

Sends a new message to a conversation.

Request:

{
"local_id": "string",
"content": { "type": "text", "text": "Hello" },
"attachments": [],
"mentions": []
}

Response: returns the created MessageData object.

POST /v1/workspaces/{workspaceId}/messages/{id}/action

Responds to an action card by selecting one of its actions.

Request:

{ "action_id": "string" }

Response: returns the updated MessageData object.

Integrations

The integrations routes describe both built-in tools and OAuth-backed external apps.

GET /v1/integrations

Returns categories and a flat item list containing both tools and integrations.

{
"data": {
"categories": [
{
"id": "string",
"name": "string",
"image_url": "string"
}
],
"items": [
{
"name": "string",
"description": "string",
"icon_url": "string",
"category_id": "string",
"type": "tool | app",
"provider": "google_calendar | gmail | slack | jira | notion | asana | github | zoom | null",
"enabled": true
}
]
}
}

provider is null for built-in tools. category_id may be absent on integration-type items.

POST /v1/integrations/connect

Requests the OAuth configuration for a provider.

Request:

{ "provider": "gmail" }

Response:

{
"client_id": "string",
"redirect_url": "string",
"authorization_endpoint": "string",
"token_endpoint": "string",
"scopes": ["string"],
"additional_parameters": { "key": "value" }
}

POST /v1/integrations/callback

Sends the OAuth authorization code to the backend to complete the connection flow.

Request:

{
"provider": "gmail",
"authorization_code": "string",
"code_verifier": "string",
"redirect_url": "string"
}

Response: 204 No Content.

GET /v1/integrations/{provider}/accounts

Lists accounts the user has connected for a given provider.

{
"data": [
{
"id": "string",
"name": "string",
"email": "string",
"provider": "gmail"
}
]
}

DELETE /v1/integrations/{provider}/accounts/{accountId}

Disconnects a specific provider account.

Response: 204 No Content.

PATCH /v1/tools/{name}

Toggles a built-in tool on or off for the current user.

Request:

{ "enabled": true }

Response: 204 No Content.

Notifications

GET /v1/notifications

Lists notifications with cursor-based pagination.

Query params: scrollId (string), limit (int)

{
"data": [
{
"id": "string",
"title": "string",
"body": "string",
"type": "agentMessage | systemAlert | workspaceUpdate",
"created_at": "ISO8601",
"is_read": false,
"action_url": "string | null"
}
],
"pagination": {
"next_scroll_id": "string",
"prev_scroll_id": "string",
"has_next": true,
"has_prev": false
}
}

POST /v1/notifications/{id}/read

Marks a single notification as read.

Response: 204 No Content.

POST /v1/notifications/read-all

Marks all notifications as read.

Response: 204 No Content.

GET /v1/notifications/preferences

Returns the user's notification preference flags.

{
"data": {
"push_enabled": true,
"agent_messages": true,
"system_alerts": true,
"workspace_updates": true
}
}

PATCH /v1/notifications/preferences

Updates notification preferences. All fields optional.

Request:

{
"push_enabled": true,
"agent_messages": true,
"system_alerts": true,
"workspace_updates": true
}

Response: 204 No Content.

Support

POST /v1/support/ticket

Submits a support ticket. Content-Type must be multipart/form-data.

Form parts:

FieldTypeRequired
app_versionstringYes
subjectstringYes
descriptionstringYes
attachmentsfile[]No

Response: 204 No Content.

Realtime

The Socket.IO transport endpoint is /socket.io/, and the mobile client connects to namespace /v1.

Authentication uses the same security headers as HTTP (X-Token, X-Signature, X-Device-Info, X-Device-ID, X-Version, X-Timezone, X-Timestamp).

Client → Server Events

EventPayload
workspace.subscribe{ "workspace_ids": ["string"] }
workspace.unsubscribe{ "workspace_ids": ["string"] }

Server → Client Events

EventPayload
message.new{ "message": MessageData }
message.updated{ "message": MessageData }
agent.typing{ "conversation_id": "string", "agent_id": "string", "is_typing": true }
agent.status{ "agent_id": "string", "status": "AgentStatus" }
workspace.subscribed{ "workspace_ids": ["string"] }

API Configuration Reference

SettingValue
Base URLCompile-time env constant
WebSocket{baseUrl}/v1 via Socket.IO
Auth headerX-Token (Firebase ID token)
HMAC headerX-Signature = HMAC-SHA256({token}:{timestamp}, hmacSecret)
Extra headersX-Device-Info, X-Device-ID, X-Version, X-Timezone, X-Timestamp
Connect timeout10s
Send timeout10s
Receive timeout60s
JSON casingsnake_case

🔗 Terms On This Page

If a term below is unfamiliar, open its glossary entry. For the full list, go to Internal Glossary.

  • Firebase JWT: The signed Firebase identity token used to authenticate a user request.
  • FCM: Firebase Cloud Messaging, used for device push notifications.
  • UserSwarm: The Crawbl custom resource that represents one user runtime and its lifecycle.
  • Socket.IO: The realtime transport layer used to push events from the backend to connected clients.
  • Cursor Pagination: A pagination style that returns opaque cursor tokens instead of page numbers.
  • OAuth: The delegated login and consent flow used to connect external apps without storing user passwords.