Error Reference
The Agentix API uses standard HTTP status codes and returns errors in a consistent JSON format.Error Response Format
All error responses follow this structure:HTTP Status Codes
Success Codes
| Code | Meaning | When |
|---|---|---|
200 | OK | Request succeeded (GET, PATCH, PUT, DELETE) |
201 | Created | Resource created successfully (POST) |
Client Error Codes
| Code | Meaning | Common Causes |
|---|---|---|
400 | Bad Request | Malformed JSON, missing required fields, invalid field values |
401 | Unauthorized | Missing or expired session cookie, missing x-tenant-id header |
403 | Forbidden | User lacks permission (e.g., Agent role trying to publish a workflow) |
404 | Not Found | Resource does not exist or belongs to a different workspace |
409 | Conflict | Duplicate resource (e.g., creating a contact with an existing phone number, creating a tag with an existing name) |
422 | Unprocessable Entity | Request is well-formed but semantically invalid (e.g., publishing a workflow with validation errors) |
429 | Too Many Requests | Rate limit exceeded — see Rate Limiting |
Server Error Codes
| Code | Meaning | What to Do |
|---|---|---|
500 | Internal Server Error | Unexpected server failure. Retry after a brief delay. If persistent, contact support. |
Common Error Scenarios
Authentication Errors (401)
x-tenant-id header on every request.
Permission Errors (403)
Validation Errors (400 / 422)
details array for specific field errors. Correct the request body and retry.
Conflict Errors (409)
Rate Limit Errors (429)
Retry-After response header before retrying. See Rate Limiting for details on limits per endpoint.
Workflow Validation Errors (422)
When publishing a workflow, the platform validates the graph structure:Error Handling Best Practices
- Always check the status code before parsing the response body
- Parse the
errorfield for a human-readable description - Check
detailson 400/422 responses for field-level validation errors - Implement retry with backoff for 429 and 500 responses
- Log the full response for debugging — include status code, headers, and body