The Lofty API uses standard HTTP status codes combined with a code field in the response body for detailed error identification.
Error responses follow this structure:
HTTP status codes
Authentication & permission errors
Validation errors (400)
Resource not found (404)
Lead errors (400)
Transaction errors (400)
Agent lifecycle errors (200 with error code)
POST /v2.0/agents/{agentId}/deactivate and POST /v2.0/agents/{agentId}/reactivate always return HTTP 200 once authentication passes. Check the response body’s code field (absent or 0 means success) rather than the status code.
Task errors (400)
Team & custom field errors (400)
Routing errors (400)
Webhook errors (400)
Rate limit (429)
When rate limited, the response includes:
See Rate Limiting for details.
Handling errors
Always check both the HTTP status code and the code field in the response body. Some business errors return specific codes (like 200100) that provide more detail than the HTTP status alone.