Always check the HTTP status code first, then parse the
detail field for specific error information.HTTP Status Codes
| Status Code | Description |
|---|---|
200 OK | Request succeeded |
201 Created | Resource created |
204 No Content | Succeeded with no body |
400 Bad Request | Invalid request or validation error |
401 Unauthorized | Missing or invalid API key |
403 Forbidden | Insufficient scopes |
404 Not Found | Resource doesn’t exist |
409 Conflict | Resource already exists |
422 Unprocessable | Validation error |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Unexpected server error |
503 Service Unavailable | Temporarily unavailable |
Error Response Format
All errors return adetail field:
Simple error:
detail field contains either a simple string or an array of validation failures with loc (field path), msg (human-readable), and type (error category).
Authentication Errors
Missing API Key
Status:401 Unauthorized
X-API-Key: cs_live_your_key in every request.
Invalid or Revoked Key
Status:401 Unauthorized
Insufficient Permissions
Status:403 Forbidden
Validation Errors
Field Required
Status:422 Unprocessable Entity (via FastAPI) or 400 Bad Request
Value Constraint Violated
- Campaign name: 8-255 characters
- Daily limit per inbox: 1-100
- Variant distribution: must sum to 100%
Invalid Format
Campaign Errors
Campaign Not Found
Status:404 Not Found
- Campaign ID is a valid UUID
- Campaign belongs to your team
- Campaign hasn’t been deleted
Campaign Not Modifiable
Status:400 Bad Request
POST /api/public/v1/campaigns/{id}/pause, then make updates.
Missing Launch Requirements
When you setlaunch: true, the API validates and may return:
Variant Distribution Mismatch
distribution_percent values must sum to exactly 100.
Sender Account Errors
Email Already Exists
Status:409 Conflict
Connection Failed
Status:400 Bad Request
- Verify SMTP/IMAP hostnames and ports match your provider’s config
- Check credentials — use app-specific passwords, not main passwords
- See Provider Configuration for recommended settings
Inbox In Use
Status:400 Bad Request
Rate Limit Error
Status:429 Too Many Requests
Best Practices
- Check status codes — Differentiate 4xx (client errors, fix the request) from 5xx (server errors, retry with backoff).
- Implement retry logic — Retry on 429 and 5xx with exponential backoff. Don’t retry 4xx errors (except 409/422 with fixes).
- Log errors — Include timestamps, request IDs, and context in your logs.
- Display user-friendly messages — Convert technical errors into actionable guidance.
- Use separate keys per integration — Makes debugging scope issues easier.
Next Steps
Authentication
API keys and security.
Rate Limits
Learn about rate limiting and retry strategies.

