Error Handling
The SuprSonic API uses conventional HTTP response codes and provides structured error messages to help you handle errors gracefully in your applications.Error Response Format
All API errors follow a consistent structure:HTTP Status Codes
The API uses standard HTTP status codes to indicate the success or failure of requests:Status Code | Meaning | Description |
---|---|---|
200 | OK | Request succeeded |
400 | Bad Request | Invalid request data or malformed JSON |
401 | Unauthorized | Missing, invalid, or expired API key |
403 | Forbidden | Valid API key but insufficient permissions |
404 | Not Found | Requested resource doesn’t exist |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Something went wrong on our end |
Error Codes
Authentication Errors
- Missing
Authorization
header - Malformed API key format
- Revoked or expired API key
- Using account API key where admin key is required
Authorization Errors
- Using account API key for admin-only operations
- Insufficient permissions for the requested action
Validation Errors
- Missing required fields
- Invalid data types
- Values outside allowed ranges
- Malformed JSON
Resource Errors
Rate Limiting
Error Handling Best Practices
1. Always Check Response Status
2. Handle Different Error Types
3. Implement Retry Logic
4. Validate Before Sending
Debugging Tips
Enable Request/Response Logging
Common Troubleshooting
Issue | Check |
---|---|
401 Unauthorized | API key format, expiration, proper Bearer token |
403 Forbidden | Using admin key for create operations, account permissions |
404 Not Found | Resource IDs, endpoint URLs, resource existence |
422 Validation Error | Required fields, data types, field constraints |
429 Rate Limited | Request frequency, implement backoff strategy |
Support
If you encounter persistent errors:- Check our status page for known issues
- Review your API key permissions in the dashboard
- Contact support with request IDs for faster debugging