Error Codes
Complete list of error codes for the SnackPrompt AI Engine API.
Overview
The API returns errors in the following format:
{
"detail": "Message describing the error"
}HTTP Codes
200
OK
Successful request
202
Accepted
Request accepted for processing
400
Bad Request
Validation error or invalid parameters
401
Unauthorized
Not authenticated
403
Forbidden
No permission to access resource
404
Not Found
Resource not found
422
Unprocessable Entity
Invalid data
429
Too Many Requests
Rate limit exceeded
500
Internal Server Error
Internal server error
503
Service Unavailable
Service temporarily unavailable
Common Errors
400 - tenant_id Required
Response:
Cause: The tenant_id was not included in the filters object.
Solution: Add tenant_id to filters:
400 - Query Required
Response:
Cause: The query field was not provided in a search or chat request.
Solution: Add the query field:
400 - Invalid Filters
Response:
Cause: An unknown filter was provided.
Solution: Use only valid filters. See Filter Reference.
404 - Elemental Not Found
Response:
Cause: The provided elemental_id doesn't exist or hasn't been ingested.
Solution:
Check if the ID is correct
Check if the elemental was ingested
Wait for ingestion to complete (asynchronous process)
422 - Invalid Data
Response:
Cause: A field was provided with the wrong type.
Solution: Check data types. See Data Models.
429 - Rate Limit
Response:
Cause: Too many requests in a short period.
Solution:
Wait the indicated time
Implement retry with exponential backoff
Consider upgrading your plan for more requests
Response headers:
500 - Internal Error
Response:
Cause: Unexpected server error.
Solution:
Try again in a few seconds
If it persists, contact support
Include the
trace_idif available
503 - Service Unavailable
Response:
Cause: The service or a dependency is unavailable.
Solution:
Wait a few minutes
Check status at
/health/detailedContact support if it persists
Streaming Errors
Error During Streaming
During streaming chat, errors are sent as SSE events:
Solution: Handle the error event in your client:
Recommended Error Handling
JavaScript/TypeScript
Python
Retry with Exponential Backoff
For 429 and 5xx errors, implement retry with backoff:
Last updated
Was this helpful?