Error Handling
The Partner API uses standard HTTP status codes and returns consistent JSON responses when errors occur.
Error Response Format
{
"message": {
"key": "RES000001",
"value": "Error description"
}
}
HTTP Status Codes
| Code | Description | Action |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Check request parameters and body |
| 401 | Unauthorized | Verify your API key (X-Cloudbric-Key header) |
| 404 | Not Found | Verify the resource path or ID |
| 409 | Conflict | Resource already exists (e.g., duplicate IP) |
| 422 | Unprocessable Entity | Check the request body validity (e.g., max limit exceeded) |
| 500 | Internal Server Error | Server issue. Retry after a short delay |
Error Handling Best Practices
- Always check the HTTP status code first.
- Use the
message.keyfield (e.g.,RES000001) to identify specific errors. - Use the
message.valuefield for a human-readable error description. - Retry 5xx errors with exponential backoff.