API Reference
The Agentix Public API lets you interact with agents, manage conversations, and retrieve configurations programmatically.
Base URL
https://app.agentix.clAll endpoints are prefixed with /api/public/.
Authentication
Every request must include an API key. See Authentication for details.
# Bearer token
Authorization: Bearer agx_live_YOUR_KEY
# Or X-API-Key header
X-API-Key: agx_live_YOUR_KEYContent Type
All POST and PATCH requests must include:
Content-Type: application/jsonEndpoints Overview
| Method | Endpoint | Description |
|---|---|---|
POST | /api/public/agents/{agentId}/chat | Send a message and get a response |
GET | /api/public/agents/{agentId} | Get agent configuration |
GET | /api/public/agents/{agentId}/widget | Get widget-specific configuration |
GET | /api/public/agents/{agentId}/conversations/{sessionId} | Get conversation history |
PATCH | /api/public/agents/{agentId}/conversations/{sessionId} | Update conversation metadata |
POST | /api/public/teams/{teamId}/chat | Send a message to an agent team |
CORS
All public endpoints support CORS. The API responds to OPTIONS preflight requests and includes appropriate Access-Control-* headers. If your agent has domain restrictions configured, CORS will only allow requests from those domains.
Common Error Codes
| Status | Code | Description |
|---|---|---|
400 | INVALID_AGENT_ID | The agent ID is missing or empty |
400 | INVALID_REQUEST_DATA | The request body is invalid |
400 | INVALID_JSON | The request body is not valid JSON |
401 | MISSING_API_KEY | No authentication provided |
401 | INVALID_API_KEY | The API key is invalid or revoked |
403 | AGENT_NOT_PUBLIC | The agent is not publicly accessible |
403 | AGENT_INACTIVE | The agent is not in an active state |
403 | ORG_MISMATCH | API key organization does not match agent organization |
403 | DOMAIN_NOT_ALLOWED | Request origin is not in the agent’s allowed domains |
404 | AGENT_NOT_FOUND | No agent exists with the given ID |
404 | CONVERSATION_NOT_FOUND | No conversation found for the given session |
429 | RATE_LIMITED | Too many requests |
500 | INTERNAL_ERROR | Server error |
Error Response Format
All errors return a consistent JSON structure:
{
"error": "Human-readable error message",
"code": "MACHINE_READABLE_CODE"
}OpenAPI Specification
A full OpenAPI 3.1 specification is available at /openapi.json for use with API clients, code generators, and documentation tools.
Last updated on