Error Codes
Standard error response format and codes.
Error Response Format
{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Human-readable error message",
"requestId": "req_abc123"
}
}
HTTP Status Codes
| Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Conflict |
| 422 | Validation Error |
| 429 | Rate Limited |
| 500 | Server Error |
Error Codes
Authentication Errors
| Code | Description |
|---|---|
UNAUTHORIZED | Missing or invalid authentication |
FORBIDDEN | Insufficient permissions |
TOKEN_EXPIRED | JWT token has expired |
INVALID_SCOPE | Missing required scope |
Resource Errors
| Code | Description |
|---|---|
RESOURCE_NOT_FOUND | Requested resource does not exist |
DUPLICATE_RESOURCE | Resource already exists |
RESOURCE_CONFLICT | Conflicting state (e.g., campaign already active) |
Validation Errors
| Code | Description |
|---|---|
VALIDATION_ERROR | Request body failed validation |
INVALID_FIELD | Unknown field in request |
MISSING_FIELD | Required field not provided |
INVALID_FORMAT | Field format incorrect |
Segment Errors
| Code | Description |
|---|---|
INVALID_SEGMENT_RULE | Segment rule syntax invalid |
UNKNOWN_FIELD | Field not available for segmentation |
INVALID_OPERATOR | Operator not supported for field type |
Campaign Errors
| Code | Description |
|---|---|
CAMPAIGN_ALREADY_ACTIVE | Cannot modify active campaign |
CAMPAIGN_NOT_SCHEDULED | Campaign must be scheduled first |
SEGMENT_REQUIRED | Campaign requires a target segment |
INVALID_SCHEDULE | Scheduled time is in the past |
Social Errors
| Code | Description |
|---|---|
CONNECTION_EXPIRED | Social connection token expired |
PUBLISHING_FAILED | Failed to publish to platform |
RATE_LIMIT_EXCEEDED | Platform rate limit hit |
CONTENT_REJECTED | Platform rejected content |
Rate Limiting
When rate limited, response includes:
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1734184800
Retry-After: 60
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please retry after 60 seconds.",
"retryAfter": 60
}
}