Skip to main content
Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.). Codes in the 5xx range indicate an error with our servers.

HTTP Status Codes

Status CodeDescription
200OK - Request was successful
201Created - Resource was successfully created
Status CodeDescription
400Bad Request - The request was unacceptable, often due to missing a required parameter
401Unauthorized - No valid API key was provided
402Request Failed - The parameters were valid but the request failed
403Forbidden - The API key doesn’t have permission to perform the request
404Not Found - The requested resource doesn’t exist
429Too Many Requests - Too many requests hit the API
Status CodeDescription
500Internal Server Error - Something went wrong on Carbon’s end
502Bad Gateway - Invalid response from an upstream server
503Service Unavailable - Carbon is temporarily offline for maintenance
504Gateway Timeout - The server didn’t respond in time

Error Response Format

All errors return JSON in the following format:
{
  "status": "error",
  "message": "A descriptive error message",
  "data": {
    "error_code": "SPECIFIC_ERROR_CODE",
    "details": "Additional error details if available"
  }
}

Common Error Examples

{
  "status": "error",
  "message": "Unauthorized access",
  "data": {
    "error_code": "INVALID_API_KEY",
    "details": "The provided API key is invalid or expired"
  }
}

Best Practices

Always Handle Errors GracefullyImplement proper error handling in your application to ensure a good user experience when API calls fail.
Retry LogicFor 5xx errors, implement exponential backoff retry logic as these are typically temporary issues.
Log Error DetailsAlways log the full error response for debugging purposes, but never expose sensitive error details to end users.