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 CodeDescription
200Success
201Created
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error
503Service 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 CodeDescription
INVALID_API_KEYAPI key is invalid or expired
INSUFFICIENT_PERMISSIONSAPI key lacks required scopes
RESOURCE_NOT_FOUNDRequested resource doesn't exist
VALIDATION_ERRORRequest validation failed
RATE_LIMIT_EXCEEDEDToo many requests
PROCESSING_ERRORServer processing error
SERVICE_UNAVAILABLEService 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.

Table of Contents