Error Handling
MergeGuide API uses standard HTTP status codes and provides detailed error responses.Error Response Format
All errors return a consistent JSON structure:HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content (successful deletion) |
| 400 | Bad Request - Invalid input |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn’t exist |
| 409 | Conflict - Resource already exists |
| 422 | Unprocessable Entity - Validation failed |
| 429 | Too Many Requests - Rate limited |
| 500 | Internal Server Error |
| 503 | Service Unavailable |
Error Types
Authentication Errors (401)
| Code | Description |
|---|---|
AUTH_MISSING_KEY | No API key provided |
AUTH_INVALID_KEY | Key format is invalid |
AUTH_EXPIRED_KEY | Key has expired |
AUTH_REVOKED_KEY | Key was revoked |
Permission Errors (403)
| Code | Description |
|---|---|
AUTH_INSUFFICIENT_SCOPE | Key lacks required scope |
AUTH_IP_NOT_ALLOWED | IP not in allowlist |
AUTH_ORG_ACCESS_DENIED | Not a member of organization |
Validation Errors (400, 422)
| Code | Description |
|---|---|
REQUIRED | Field is required |
INVALID_FORMAT | Value format is invalid |
MAX_SIZE_EXCEEDED | Value exceeds maximum |
MIN_SIZE_REQUIRED | Value below minimum |
INVALID_ENUM | Value not in allowed list |
Resource Errors (404, 409)
| Code | Description |
|---|---|
RESOURCE_NOT_FOUND | Resource doesn’t exist |
RESOURCE_ALREADY_EXISTS | Duplicate resource |
RESOURCE_DELETED | Resource was deleted |
Rate Limit Errors (429)
Server Errors (500, 503)
| Code | Description |
|---|---|
INTERNAL_ERROR | Unexpected server error |
SERVICE_UNAVAILABLE | Service temporarily down |
DEPENDENCY_FAILURE | External service failed |
Handling Errors
JavaScript/TypeScript
Python
cURL/Shell
Retry Strategy
Recommended Retry Logic
Retryable Errors
| Code | Retryable | Strategy |
|---|---|---|
| 429 | Yes | Use Retry-After header |
| 500 | Yes | Exponential backoff |
| 503 | Yes | Exponential backoff |
| 400 | No | Fix request |
| 401 | No | Check credentials |
| 403 | No | Check permissions |
| 404 | No | Check resource ID |
Debugging
Request ID
Every response includes arequest_id. Include this when contacting support:
Debug Mode
Enable verbose logging in SDKs:Common Issues
| Issue | Solution |
|---|---|
| Intermittent 401 | Check key expiration, rotate keys |
| Consistent 403 | Verify key scopes match operation |
| 422 on create | Check all required fields present |
| 429 frequently | Implement request batching |