Getting Started
Errors
The status codes the API returns, the shape of each error body, and the error codes you can match on.
A failed request returns a non-2xx status and a JSON body that says what went wrong. Match on the status first, then on the error code when there is one.
Status codes
| Status | Meaning | Retry |
|---|---|---|
200 | Success. | |
207 | Ingest only. Some events were stored and some were rejected. | Fix the rejected events |
400 | The request is malformed, such as an ID that isn't a valid UUID. | No |
401 | The API key is missing, malformed, revoked, paused, or expired. | No |
402 | Your plan's monthly limit is used up. | No |
403 | The key isn't allowed this request. | No |
404 | The engine or memory space doesn't exist in the key's workspace, or the route doesn't exist. | No |
409 | The request conflicts with the current state. | Yes |
413 | The body is too large. | No |
422 | A field failed validation, or every event in an ingest was rejected. | No |
429 | A rate limit was hit. | Yes, after Retry-After |
500, 502, 503, 504 | Docklee couldn't complete the request. | Yes |
Error bodies
Most errors carry a detail message:
{
"detail": "Invalid API key."
}Errors from ingest also carry a machine-readable code:
{
"detail": {
"error": "ke_runtime_denied",
"message": "API key does not enable the KE runtime."
}
}Validation errors list each field that failed:
{
"detail": [
{
"loc": ["body", "top_k"],
"msg": "Input should be less than or equal to 50",
"type": "less_than_equal"
}
]
}Error codes
| Code | Status | Meaning |
|---|---|---|
missing_destination | 422 | An ingest named neither a container nor a memory_space_id. |
invalid_memory_space_id | 400 | The memory_space_id isn't a valid UUID. |
ke_runtime_denied | 403 | The key doesn't include the Knowledge Engines runtime. |
rate_limit_exceeded | 429 | An ingest rate limit was hit. |
Per-event errors
An ingest reports each rejected event in errors, with the event's index:
| Code | Meaning |
|---|---|
duplicate_event | The same content arrived within 60 seconds. |
memory_space_not_authorized | The key can't write to the memory space. |
ke_ingestion_failed | The event couldn't be stored in the container. The message says why. |
dum_ingestion_failed | The event couldn't be stored in the memory space. The message says why. |
In the SDKs
Each status maps to its own error class, such as AuthenticationError for 401 and RateLimitError for 429. See Errors and retries.
Next steps
You can read every error. Learn how much traffic a key can send next.