Response Codes
Legitmark uses standard HTTP codes to indicate the success or failure of your requests. In general, 2xx HTTP codes correspond to success, 4xx codes are for user-related failures, and 5xx codes are for infrastructure issues.| Status | Description |
|---|---|
| 200 | Successful request. |
| 201 | Resource created successfully. |
| 204 | Successful request with no content. |
| 400 | Check that the parameters were correct. |
| 401 | The API key used was missing or authentication required. |
| 403 | The API key used was invalid or insufficient permissions. |
| 404 | The resource was not found. |
| 409 | Conflict - duplicate resource or constraint violation. |
| 429 | The rate limit was exceeded. |
| 500 | Internal server error. |
| 501 | Not implemented. |
| 5xx | Indicates an error with Legitmark servers. |
Error Response Format
All error responses follow this structure:Error Categories
Validation Errors (400)
Validation errors occur when request parameters don’t meet requirements:Authentication Errors (401)
Authentication errors occur when API key is missing or invalid:Authorization Errors (403)
Authorization errors occur when API key lacks required permissions:Not Found Errors (404)
Not found errors occur when requested resource doesn’t exist:Conflict Errors (409)
Conflict errors occur when creating duplicate resources or constraint violations:Server Errors (5xx)
Server errors indicate issues with Legitmark infrastructure:Troubleshooting
Common Issues
400 Bad Request- Check that all required parameters are included
- Verify parameter types and formats
- Ensure JSON is properly formatted
- Check field naming uses snake_case
- Verify API key is included in Authorization header
- Check API key format:
Bearer leo_xxxxxxxxx - Ensure API key is active and not expired
- Verify API key has required permissions
- Check if resource access is restricted
- Contact support for permission issues
- Verify resource ID/UUID is correct
- Check if resource exists
- Ensure endpoint URL is correct
- Wait before retrying (check retry-after header)
- Implement exponential backoff
- Consider upgrading rate limits
- Retry request after a brief delay
- Check Legitmark status page
- Contact support if issue persists
Debugging Tips
-
Check Response Headers
- Content-Type should be
application/json - Rate limit headers show current usage
- Request ID for support inquiries
- Content-Type should be
-
Validate Request Format
- Use proper Content-Type header
- Ensure JSON syntax is valid
- Verify all required fields are included
-
Test with Minimal Data
- Start with simplest possible request
- Add complexity incrementally
- Use API playground for testing
-
Monitor Rate Limits
- Track API usage patterns
- Implement proper retry logic
- Cache responses when appropriate