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| Service | API Prefix | Example |
|---|---|---|
| IAM | /v1/auth | https://platform.ergondata.ai/v1/auth/token |
| Agent Hub | /api/v1/agents | https://platform.ergondata.ai/api/v1/agents/llm-providers |
| Workflows | /api/v1/workflows | https://platform.ergondata.ai/api/v1/workflows/... |
| Automations | /api/v1/automations | https://platform.ergondata.ai/api/v1/automations/... |
| Channels | /api/v1/channels | https://platform.ergondata.ai/api/v1/channels/... |
| Buckets | /api/v1/buckets | https://platform.ergondata.ai/api/v1/buckets/... |
| Worksheets | /api/v1/worksheets | https://platform.ergondata.ai/api/v1/worksheets/... |
| Conversations | /api/v1/conversations | https://platform.ergondata.ai/api/v1/conversations/... |
| Event Streams | /api/v1/event-streams | https://platform.ergondata.ai/api/v1/event-streams/... |
Common Headers
Required Headers
| Name | Type | Description |
|---|---|---|
Authorization* | string | Bearer token from the client credentials endpoint. Format: "Bearer {token}" |
Content-Type* | string | Set 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"
}| Code | Status | Description |
|---|---|---|
200 | OK | Request succeeded. |
201 | Created | Resource was created successfully. |
202 | Accepted | Request accepted for asynchronous processing. |
204 | No Content | Successful deletion, no response body. |
400 | Bad Request | Invalid request parameters. |
401 | Unauthorized | Missing or invalid authentication token. |
403 | Forbidden | Insufficient permissions for this action. |
404 | Not Found | The requested resource does not exist. |
422 | Unprocessable Entity | Request body failed validation. |
500 | Internal Server Error | An 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
| Name | Type | Description |
|---|---|---|
limit | integer | Maximum number of results to return.Default: 50 |
offset | integer | Number of results to skip.Default: 0 |
page | integer | Page 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}"| Service | WebSocket Path | Purpose |
|---|---|---|
| Conversations | /api/v1/conversations/ws/conversations/{id}/stream | Stream conversation messages in real-time |
| Workflows | /api/v1/workflows/ws/workflows/{id}/live | Live item and phase updates |
| Workflows | /api/v1/workflows/ws/companies/{id}/live | Company-wide workflow events |
| Buckets | /api/v1/buckets/ws/buckets/{id}/live | File upload and processing status for a bucket |
| Buckets | /api/v1/buckets/ws/files/{id}/live | Single file processing events |
| Worksheets | /api/v1/worksheets/ws/worksheets/{id}/live | Real-time cell updates |
| Worksheets | /api/v1/worksheets/ws/folders/{id}/live | Folder-level worksheet events |
| Event Streams | /api/v1/event-streams/ws/companies/{id}/live | Centralized event stream for a company |