Error Response Format
All API errors return a consistent JSON structure:HTTP Status Codes
The Stanna API uses standard HTTP status codes:| Status Code | Meaning | Description |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Invalid request parameters or format |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Valid API key but insufficient permissions |
| 404 | Not Found | Resource or endpoint doesn’t exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error (contact support) |
| 502 | Bad Gateway | Temporary server issue |
| 503 | Service Unavailable | Maintenance or temporary outage |
Common Error Codes
Authentication Errors
AUTH_MISSING_KEY
Status: 401
AUTH_INVALID_KEY
Status: 401
AUTH_WORKSPACE_MISMATCH
Status: 403
workspaceId parameter matches your API key’s workspace.
Request Errors
VALIDATION_ERROR
Status: 400
RESOURCE_NOT_FOUND
Status: 404
INVALID_WORKSPACE
Status: 404
Rate Limiting Errors
RATE_LIMIT_EXCEEDED
Status: 429
Data Errors
DATA_NOT_READY
Status: 404
INTEGRATION_NOT_CONNECTED
Status: 400
INSUFFICIENT_DATA
Status: 404
Server Errors
INTERNAL_ERROR
Status: 500
INTEGRATION_ERROR
Status: 502
Error Handling Best Practices
1. Check Status Codes
Always check the HTTP status code before parsing the response:2. Implement Retry Logic
For temporary errors (429, 500, 502, 503), implement exponential backoff:3. Handle Rate Limits
Respect rate limit headers and implement appropriate delays:4. Log Errors Appropriately
Log enough information for debugging without exposing sensitive data:5. Provide User-Friendly Messages
Convert technical error codes into user-friendly messages:Rate Limiting Details
The API enforces the following rate limits:| Limit Type | Threshold | Window |
|---|---|---|
| Per API Key | 100 requests | 1 minute |
| Per Workspace | 10,000 requests | 1 day |
| Bulk Operations | 10 requests | 1 minute |
Rate Limit Headers
All responses include rate limiting information:Handling Rate Limits
When you hit a rate limit, the API returns:retryAfter seconds before making another request.
Getting Help
If you encounter errors not covered here:- Check your API key and workspace ID
- Verify the endpoint URL and parameters
- Test with a simple cURL command
- Check our status page for known issues
- Contact support at support@gostanna.com with the error code and request details