Skip to main content
All error responses share the same JSON envelope:
{
  "success": 0,
  "error": ["field: reason", "another: issue"],
  "message": "Human-readable summary",
  "code": 400
}
FieldTypeDescription
success0Always 0 for errors
errorstring[]Machine-readable list of individual error details
messagestringShort human-readable description
codenumberHTTP status code, mirrored in the body

HTTP status codes

CodeMeaningCommon causes
400Bad RequestFailed Zod validation, missing required field, business rule violation
401UnauthorizedMissing, expired, or invalid credential
403ForbiddenAuthenticated but wrong role (e.g. non-admin hitting admin route)
404Not FoundResource ID doesn’t exist or doesn’t belong to the caller
429Too Many RequestsRate limit exceeded — back off and retry
500Internal Server ErrorUnexpected server-side failure

Validation errors (400)

Validation uses Zod. Each failed field is a separate entry in the error array using the format fieldPath: message:
{
  "success": 0,
  "error": [
    "base_url: Invalid url",
    "auth_type: Invalid enum value. Expected 'bearer' | 'api_key'"
  ],
  "message": "Validation Error",
  "code": 400
}

Rate limiting (429)

Affiliate and Reseller endpoints are rate-limited per API token / JWT.
{
  "success": 0,
  "error": ["rate limit exceeded"],
  "message": "rate limit exceeded",
  "code": 429
}
When you hit a 429, inspect the Retry-After response header (if present) and wait that many seconds before retrying.