Getting Started

Everything you need to start building with the Ergon API.

Authentication

All API requests require a Bearer token in the Authorization header. Authenticate using API keys with the client credentials flow.

Obtaining API Keys

Create API keys in the Ergon console under IAM → API Keys. Each API key consists of a client_id and a client_secret. You can scope API keys to specific services and set expiration dates.

Your client_secret is only shown once at creation time. Store it securely — it cannot be retrieved later.

Getting an Access Token

Exchange your API key credentials for a short-lived access token:

curl -X POST https://platform.ergondata.ai/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your-client-id",
    "client_secret": "your-client-secret"
  }'

Response:

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "token_type": "bearer",
  "expires_in": 3600
}

Using the Token

Include the access token as a Bearer token in the Authorization header of every request:

curl https://platform.ergondata.ai/api/v1/agents/companies/{company_id}/llm-configs \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Tokens expire after the duration specified in expires_in (seconds). Request a new token when the current one expires.

Base URL

All API requests are made to the following base URL. Each service is accessed via its own path prefix:

https://platform.ergondata.ai
ServiceAPI PrefixExample
IAM/v1/authhttps://platform.ergondata.ai/v1/auth/token
Agent Hub/api/v1/agentshttps://platform.ergondata.ai/api/v1/agents/llm-providers
Workflows/api/v1/workflowshttps://platform.ergondata.ai/api/v1/workflows/...
Automations/api/v1/automationshttps://platform.ergondata.ai/api/v1/automations/...
Channels/api/v1/channelshttps://platform.ergondata.ai/api/v1/channels/...
Buckets/api/v1/bucketshttps://platform.ergondata.ai/api/v1/buckets/...
Worksheets/api/v1/worksheetshttps://platform.ergondata.ai/api/v1/worksheets/...
Conversations/api/v1/conversationshttps://platform.ergondata.ai/api/v1/conversations/...
Event Streams/api/v1/event-streamshttps://platform.ergondata.ai/api/v1/event-streams/...

Common Headers

Required Headers

NameTypeDescription
Authorization*
stringBearer token from the client credentials endpoint. Format: "Bearer {token}"
Content-Type*
stringSet to application/json for all request bodies.Default: application/json
x-company-id
string (UUID)Required by some Channels endpoints. Specifies which organization context to operate in.

Error Handling

The API uses standard HTTP status codes. Errors return a JSON body with a detail field describing the issue.

{
  "detail": "Not found"
}
CodeStatusDescription
200OKRequest succeeded.
201CreatedResource was created successfully.
202AcceptedRequest accepted for asynchronous processing.
204No ContentSuccessful deletion, no response body.
400Bad RequestInvalid request parameters.
401UnauthorizedMissing or invalid authentication token.
403ForbiddenInsufficient permissions for this action.
404Not FoundThe requested resource does not exist.
422Unprocessable EntityRequest body failed validation.
500Internal Server ErrorAn unexpected error occurred.

Pagination

List endpoints support offset-based pagination using limit and offset query parameters. Some endpoints use page and limit instead.

Pagination Parameters

NameTypeDescription
limit
integerMaximum number of results to return.Default: 50
offset
integerNumber of results to skip.Default: 0
page
integerPage number (1-based). Used by activity endpoints.Default: 1

Paginated responses include a total count:

{
  "items": [...],
  "total": 142,
  "limit": 50,
  "offset": 0
}

WebSockets

Several services provide real-time updates via WebSocket connections. Authenticate by passing your access token as a query parameter.

# Agent conversation streaming
wscat -c "wss://platform.ergondata.ai/api/v1/conversations/ws/conversations/{conversation_id}/stream?token={access_token}"

# Workflow live updates
wscat -c "wss://platform.ergondata.ai/api/v1/workflows/ws/workflows/{workflow_id}/live?token={access_token}"

# Buckets live updates
wscat -c "wss://platform.ergondata.ai/api/v1/buckets/ws/buckets/{bucket_id}/live?token={access_token}"

# Worksheet collaboration
wscat -c "wss://platform.ergondata.ai/api/v1/worksheets/ws/worksheets/{worksheet_id}/live?token={access_token}"
ServiceWebSocket PathPurpose
Conversations/api/v1/conversations/ws/conversations/{id}/streamStream conversation messages in real-time
Workflows/api/v1/workflows/ws/workflows/{id}/liveLive item and phase updates
Workflows/api/v1/workflows/ws/companies/{id}/liveCompany-wide workflow events
Buckets/api/v1/buckets/ws/buckets/{id}/liveFile upload and processing status for a bucket
Buckets/api/v1/buckets/ws/files/{id}/liveSingle file processing events
Worksheets/api/v1/worksheets/ws/worksheets/{id}/liveReal-time cell updates
Worksheets/api/v1/worksheets/ws/folders/{id}/liveFolder-level worksheet events
Event Streams/api/v1/event-streams/ws/companies/{id}/liveCentralized event stream for a company