Checkrd

Errors

Error types, codes, and HTTP status codes returned by the Checkrd API.

Errors

The Checkrd API returns errors in a consistent JSON format:

json
{
  "error": {
    "type": "validation_error",
    "code": "invalid_parameter",
    "message": "Name is required.",
    "param": "name"
  }
}

Error Types

TypeDescription
validation_errorThe request body or parameters are invalid.
authentication_errorMissing or invalid authentication credentials.
authorization_errorValid credentials, but insufficient permissions.
not_found_errorThe requested resource does not exist.
conflict_errorThe request conflicts with existing state (e.g., duplicate idempotency key).
rate_limit_errorToo many requests. Retry after the Retry-After header value.
api_errorAn internal server error. Contact support if persistent.

HTTP Status Codes

CodeMeaning
200Success.
201Resource created.
400Validation error. Check the message and param fields.
401Authentication required or token expired.
403Insufficient role or plan tier.
404Resource not found.
409Conflict (concurrent idempotency key or duplicate resource).
429Rate limited. Respect Retry-After header.
500Internal error. The request body is never leaked in error messages.

Handling Errors

All error responses include a type and message. Use type for programmatic handling and message for display:

python
import httpx

response = httpx.post("https://api.checkrd.io/v1/agents", ...)
if response.status_code >= 400:
    error = response.json()["error"]
    if error["type"] == "rate_limit_error":
        retry_after = int(response.headers["Retry-After"])
        # wait and retry
    elif error["type"] == "validation_error":
        print(f"Invalid field: {error.get('param')}: {error['message']}")