Build the next Canva for video editingBook now

Errors

Common API errors and troubleshooting guide for the DesignCombo API.

Errors

The DesignCombo API uses standard HTTP status codes and returns detailed error messages to help you troubleshoot issues.

HTTP Status Codes

CodeStatusDescription
200OKRequest successful
201CreatedResource created successfully
400Bad RequestInvalid parameters or request format
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions
404Not FoundResource not found
409ConflictResource already exists
422Unprocessable EntityValidation failed
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error
502Bad GatewayService temporarily unavailable
503Service UnavailableService maintenance

Error Response Format

All error responses follow a consistent format:

{
"error": {
"code": "invalid_parameter",
"message": "The 'text' parameter is required",
"details": {
"parameter": "text",
"reason": "missing_required_field",
"suggestion": "Please provide a text parameter with your request"
},
"request_id": "req_1234567890abcdef"
}
}
FieldDescription
codeMachine-readable error code
messageHuman-readable error message
detailsAdditional error context
request_idUnique identifier for debugging

Common Error Codes

Authentication Errors

Error CodeDescriptionSolution
invalid_api_keyAPI key is invalid or expiredCheck your API key and regenerate if needed
missing_api_keyNo API key providedInclude Authorization: Bearer YOUR_API_KEY header
insufficient_permissionsAPI key lacks required permissionsUpgrade your plan or contact support

Resource Errors

Error CodeDescriptionSolution
resource_not_foundRequested resource doesn't existCheck the resource ID or URL
resource_already_existsResource with same identifier existsUse a different identifier or update existing resource
resource_deletedResource has been permanently deletedCreate a new resource

Validation Errors

Error CodeDescriptionSolution
invalid_parameterParameter value is invalidCheck parameter format and constraints
missing_required_fieldRequired parameter is missingInclude all required parameters
file_too_largeUploaded file exceeds size limitCompress or resize your file
unsupported_formatFile format not supportedConvert to supported format
invalid_urlURL format is invalidCheck URL syntax and accessibility

Processing Errors

Error CodeDescriptionSolution
processing_failedAI processing failedRetry the request or contact support
insufficient_creditsAccount has insufficient creditsUpgrade your plan or add credits
service_unavailableService is temporarily unavailableRetry later or check status page
timeoutRequest timed outRetry with smaller files or shorter content

Error Handling Examples

JavaScript/Node.js

const handleApiError = async (response) => {
if (!response.ok) {
const errorData = await response.json();
switch (response.status) {
case 400:
console.error('Bad request:', errorData.error.message);
// Handle validation errors
break;
case 401:
console.error('Authentication failed:', errorData.error.message);
// Handle auth errors
break;
case 429:
console.error('Rate limited:', errorData.error.message);
// Implement retry logic
break;
case 500:
console.error('Server error:', errorData.error.message);
// Retry or contact support
break;
default:
console.error('Unexpected error:', errorData.error.message);
}
throw new Error(errorData.error.message);
}
return response.json();
};
// Usage
try {
const response = await fetch('https://api.designcombo.dev/v1/text-to-speech', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello world',
voiceId: '69nXRvRvFpjSXhH7IM5l'
})
});
const data = await handleApiError(response);
console.log('Success:', data);
} catch (error) {
console.error('Request failed:', error.message);
}

Python

import requests
from typing import Dict, Any
def handle_api_error(response: requests.Response) -> Dict[str, Any]:
if not response.ok:
error_data = response.json()
error_info = error_data.get('error', {})
error_messages = {
400: f"Bad request: {error_info.get('message')}",
401: f"Authentication failed: {error_info.get('message')}",
429: f"Rate limited: {error_info.get('message')}",
500: f"Server error: {error_info.get('message')}"
}
error_message = error_messages.get(response.status_code,
f"Unexpected error: {error_info.get('message')}")
raise requests.exceptions.RequestException(error_message)
return response.json()
# Usage
try:
response = requests.post(
'https://api.designcombo.dev/v1/text-to-speech',
headers={
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
},
json={
'text': 'Hello world',
'voiceId': '69nXRvRvFpjSXhH7IM5l'
}
)
data = handle_api_error(response)
print('Success:', data)
except requests.exceptions.RequestException as e:
print('Request failed:', str(e))

Retry Logic

Implement retry logic for transient errors:

const retryWithBackoff = async (apiCall, maxRetries = 3) => {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
return await apiCall();
} catch (error) {
const isRetryable = error.status >= 500 || error.status === 429;
if (!isRetryable || attempt === maxRetries) {
throw error;
}
const delay = Math.pow(2, attempt) * 1000;
console.log(`Attempt ${attempt} failed. Retrying in ${delay}ms...`);
await new Promise(resolve => setTimeout(resolve, delay));
}
}
};

Debugging Tips

1. Check Request ID

Always log the request_id from error responses for debugging:

const errorData = await response.json();
console.log('Request ID:', errorData.error.request_id);

2. Validate Parameters

Before making requests, validate your parameters:

const validateTextToSpeechParams = (params) => {
const errors = [];
if (!params.text || params.text.trim().length === 0) {
errors.push('Text parameter is required and cannot be empty');
}
if (params.text && params.text.length > 5000) {
errors.push('Text parameter cannot exceed 5000 characters');
}
if (!params.voiceId) {
errors.push('Voice ID is required');
}
return errors;
};

3. Check API Status

Monitor the API status page for known issues:

const checkApiStatus = async () => {
try {
const response = await fetch('https://status.designcombo.dev/api/v2/status.json');
const status = await response.json();
return status.status.indicator === 'operational';
} catch {
return true; // Assume operational if status check fails
}
};

Getting Help

When you encounter errors:

  1. 1Check the error message for specific guidance
  2. 2Verify your request format matches the documentation
  3. 3Test with a simple request to isolate the issue
  4. 4Check the API status for known issues
  5. 5Contact support with the request ID for faster resolution
Need help debugging errors?
  • Include the request ID when contacting support
  • Test with the API playground to verify your request format
  • Check our status page for known issues
  • Review the error details for specific guidance