Errors
Canonical API error codes and response format
By YT2Text Team • Published February 1, 2025 • Updated March 22, 2026
Errors
Many route-level business failures use a stable envelope:
{
"success": false,
"error": {
"code": "FEATURE_NOT_AVAILABLE",
"message": "Feature unavailable on current plan",
"details": {}
}
}
Common error codes
- – malformed payload or validation error
INVALID_REQUEST
- – missing/invalid credentials
UNAUTHORIZED
- /
INVALID_KEY
/INVALID_API_KEY
– key does not exist, malformed, or revokedKEY_NOT_FOUND
- – authenticated user lacks permission for this route
FORBIDDEN
- – too many requests in current window
RATE_LIMIT_EXCEEDED
- – daily/plan quota is exhausted
QUOTA_EXCEEDED
- – feature blocked for plan
FEATURE_NOT_AVAILABLE
- – unknown job id
JOB_NOT_FOUND
- – result not ready yet
JOB_NOT_COMPLETED
- – job failed after processing
JOB_FAILED
- – unknown batch id
BATCH_NOT_FOUND
- – internal usage/limit accounting failure
LIMITS_ERROR
- – list/filter retrieval failure
LIST_ERROR
- – unable to assemble result payload
RESULTS_ERROR
HTTP status mapping
Do not assume every failure maps cleanly to an HTTP status. The current backend mixes two patterns:
- application/business-rule failures often return via the JSON envelope
success: false
- auth, CSRF/origin, and throttling failures are commonly raised as real HTTP errors
- 400/422: request/validation errors
- 401: missing or invalid auth credentials
- 403: permission denied, invalid origin, CSRF failure, or runtime-disabled feature
- 404: missing job/batch/resource on routes that raise
HTTPException
- 429: throttled API-key request
- 500: unexpected internal failure
Examples of envelope-style failures that may still arrive with HTTP 200 today:
FEATURE_NOT_AVAILABLE
QUOTA_EXCEEDED
JOB_NOT_FOUND
JOB_NOT_COMPLETED