Skip to main content

Errors & Rate Limits

This page covers HTTP status codes, error response format, rate limiting, and common troubleshooting steps.

Error Response Format

All API errors return a consistent JSON structure:

{
"detail": "Campaign not found",
"error_code": "RESOURCE_NOT_FOUND",
"status": 404
}

Validation errors include a fields array:

{
"detail": "Validation failed",
"error_code": "VALIDATION_ERROR",
"status": 422,
"fields": [
{ "field": "commission_amount", "message": "Must be a positive number" },
{ "field": "name", "message": "Required field" }
]
}

HTTP Status Codes

CodeMeaningCommon Cause
200OKRequest succeeded
201CreatedResource created successfully
204No ContentDelete succeeded
400Bad RequestMalformed JSON or invalid parameters
401UnauthorizedMissing or expired token
403ForbiddenInsufficient permissions or scopes
404Not FoundResource does not exist
409ConflictDuplicate resource or state conflict
422Unprocessable EntityValidation errors
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error (contact support)

Error Codes

Error CodeDescription
TOKEN_EXPIREDAccess token has expired; refresh it
TOKEN_INVALIDToken is malformed or revoked
INSUFFICIENT_SCOPEAPI key lacks the required scope
RESOURCE_NOT_FOUNDThe requested resource does not exist
VALIDATION_ERROROne or more fields failed validation
DUPLICATE_RESOURCEA resource with the same unique key exists
RATE_LIMIT_EXCEEDEDToo many requests; slow down
CAMPAIGN_NOT_ACTIVEAction requires an active campaign
AFFILIATE_NOT_APPROVEDAffiliate must be approved first
PAYMENT_REQUIREDFeature requires a paid plan
QUOTA_EXCEEDEDPlan limit reached (e.g., max links)

Rate Limits

Rate limits are applied per API key or per user token:

PlanRequests per MinuteRequests per Day
Free301,000
Starter605,000
Pro30050,000
Business600200,000
EnterpriseCustomCustom

Rate limit headers are included in every response:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1711036800

When rate limited, you receive a 429 response:

{
"detail": "Rate limit exceeded. Retry after 42 seconds.",
"error_code": "RATE_LIMIT_EXCEEDED",
"retry_after": 42
}

Troubleshooting

ProblemSolution
401 on every requestCheck that your token is in the Authorization: Bearer <token> header
401 after working previouslyYour access token expired; use the refresh token
403 with a valid tokenVerify your API key has the required scopes
404 for a known resourceCheck the resource ID and ensure you have access
422 validation errorsReview the fields array for specific issues
429 rate limitedImplement exponential backoff; check retry_after
500 server errorRetry once after 5 seconds; contact support if persistent

Best Practices

  • Implement automatic retry with exponential backoff for 429 and 5xx errors.
  • Log the error_code field for programmatic error handling.
  • Monitor X-RateLimit-Remaining to proactively throttle requests.
  • Use the narrowest API key scopes to minimize the blast radius of a leaked key.

Next Steps