Error Responses
The KonPro API utilizes standard HTTP response codes to indicate the status of requests. When an error occurs, detailed information is returned in the response body using the fields code and message for easier debugging.
HTTP Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
| 503 | Service Unavailable |
Error Response Format
When an error occurs, the API returns a structured error response with the following format:
JSON
{
"error": {
"code": "INVALID_REQUEST",
"message": "The request body is invalid",
"details": {
"field": "avatar_id",
"reason": "Avatar ID is required"
}
},
"request_id": "req-123456"
}The error response contains:
- •error.code: A unique error code identifier (e.g., "INVALID_REQUEST", "INVALID_API_KEY")
- •error.message: A human-readable description of the error
- •error.details: (Optional) Additional context about the error, such as which field caused the issue
- •request_id: A unique identifier for the request, useful for support and debugging
Common Error Codes
| Error Code | Description |
|---|---|
| INVALID_API_KEY | API key is invalid or expired |
| INSUFFICIENT_PERMISSIONS | API key lacks required scopes |
| RESOURCE_NOT_FOUND | Requested resource doesn't exist |
| VALIDATION_ERROR | Request validation failed |
| RATE_LIMIT_EXCEEDED | Too many requests |
| PROCESSING_ERROR | Server processing error |
| SERVICE_UNAVAILABLE | Service temporarily unavailable |
Example Error Response
Here's an example of what an error response looks like:
JSON
{
"error": {
"code": "INVALID_REQUEST",
"message": "The request body is invalid",
"details": {
"field": "avatar_id",
"reason": "Avatar ID is required"
}
},
"request_id": "req-123456"
}Consistent and clear error handling enables easier troubleshooting and improved developer experience.