Error Response Format
All API errors follow a consistent JSON structure:HTTP Status Codes
The API uses standard HTTP status codes to indicate the success or failure of requests:OK
Request succeeded
Created
Resource created successfully
Bad Request
Invalid request parameters or payload
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions for the requested action
Not Found
Requested resource does not exist
Conflict
Resource already exists (e.g., duplicate link code)
Unprocessable Entity
Request payload validation failed
Too Many Requests
Rate limit exceeded
Internal Server Error
Unexpected server error
Common Error Codes
Authentication Errors
401
The provided API key is missing, malformed, or invalid
401
The API key has expired and needs to be regenerated
403
The API key does not have permission to perform this action
Validation Errors
422
Request payload failed validation. Check the
details field for specific issues.400
Query parameters are invalid or out of acceptable range
422
A required field is missing from the request payload
Resource Errors
404
The requested link does not exist or you don’t have access to it
409
A link with the specified code already exists
410
The link has expired and is no longer accessible
Rate Limiting
429
You have exceeded your API rate limit. Wait before making more requests.
Subscription Errors
402
An active subscription is required to perform this action
402
You have reached your subscription’s usage limits
402
Payment is required to continue using the service
Error Handling Best Practices
1. Check the success Field
Always check the success field in the response to determine if the request was successful:
2. Handle Specific Error Codes
Different error codes may require different handling strategies:3. Implement Retry Logic
For transient errors (5xx status codes, rate limits), implement retry logic with exponential backoff:4. Log Errors for Debugging
Always log errors with sufficient context for debugging:Rate Limiting Details
When you exceed your rate limit, the API returns a429 status code with additional headers:
X-RateLimit-Limit: Your rate limit per hourX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: Unix timestamp when the rate limit resets