Understanding API Error Codes and HTTP Responses
Read the response status, error code and message
Written by Erick Horn
June 27, 2026
Updated October 16, 2026
Understanding API error codes and HTTP responses
Read an API error’s HTTP status, code and message together. The status identifies the kind of problem; the code and message explain the cause. REST errors use this JSON structure:
{
"status": "not_ok",
"request_id": "…",
"errors": [
{
"status": 401,
"code": "ER0202",
"message": "Invalid API key.",
"links": { "about": "https://docs.apitube.io/platform/news-api/http-response-codes" },
"timestamp": "…"
}
]
}
status: "not_ok" marks failure. Read errors[0].code and errors[0].message. Keep the request_id for support; links.about points to the official reference.
What do the HTTP status codes mean?
- 200: the request succeeded.
- 400: a parameter or request is invalid.
- 401: the key is missing, invalid or expired.
- 402: available quota or pay-as-you-go funds cannot cover the request, or a spending limit was reached.
- 403: the key or plan does not permit the request.
- 429: a rate or concurrency limit was reached.
- 500: a server error; wait briefly before retrying.
Which error codes are most common?
- 400: read the message for the invalid parameter. Flags may need
0or1, for example. See 400 Bad Request errors. - 401:
ER0201means missing key,ER0202invalid or revoked key, andER0230expired key. See authentication errors. - 402:
ER0176means insufficient funds;ER0177means the monthly pay-as-you-go limit was reached. Check quota, balance and spending settings. - 403:
ER0601means IP not allowed,ER0602domain not allowed, andER0603endpoint permission missing.ER0706can mean the plan excludes a feature, such as Fact Check, non-JSON export orprompt. - 429:
ER0203means too many requests;ER0204means a temporary ban after repeated violations. Limits are 10/minute on Free, 50 on Starter, Basic and Professional, 200 on Corporate, 15 for test keys and a separate 10 for Fact Check. See rate-limit errors. - 500:
ER0183means “Something went wrong.” Retry after a delay. If it continues, contact support with the request ID. - 502:
ER0801means a request usingpromptcould not be processed temporarily. See below.
What are the 502 and prompt-specific errors?
prompt turns a plain-English search into API filters. These errors explain why it could not do so:
403 ER0706:promptrequires Basic or above. Free and Starter requests are rejected without charge.400 ER0800: the prompt must be 3–500 characters.502 ER0801: the prompt service is temporarily unavailable. No charge is applied; retry after a short delay.400 ER0802: the prompt produced no usable filters. Try a clearer search, check endpoint support, and check whether explicit parameters override every suggested filter.
ER0706 is also used for other plan restrictions and for an unsupported range in a Boolean query (400). Always check the status and message.
A request with no available funds can return 402 ER0176 before the prompt is processed. On WebSocket, prompt errors arrive in an error message followed by close code 4001. See how to search news in plain English.
How can I see my remaining quota before a 402?
Read the response headers: x-points-remaining for plan requests, x-balance-remaining for pay-as-you-go cents, x-subscription-plan for the plan, and x-apitube-mode for test or live.
If you set a monthly spending limit, x-budget-remaining shows its remaining allowance. X-Request-ID identifies the call and matches request_id in an error body.
Can a successful response still carry an error code?
Yes. A 200 response can include warnings in meta.warnings. They explain an adjustment to a successful request.
ER0366 means a headline search without explicit date bounds used the last 31 days. It applies to title, title_starts_with, title_ends_with, title_pattern and query. The x-query-window-clamped: 31 header reports the same adjustment, including for file exports.
{
"status": "ok",
"results": [],
"meta": {
"warnings": [{ "code": "ER0366", "message": "published_at window defaulted to the last 31 days for title search. …" }]
}
}
An explicit headline-search window wider than 31 days returns 400 ER0110. See how to search news by title.
How are streaming errors different?
After a connection opens, an SSE stream sends an error event with a code and message. A WebSocket sends {"type":"error","code":...,"message":...} and may then close with a separate WebSocket close code.
Read these messages as well as handling connection failures.
Common Questions
- Is each error code globally unique?
- Does a 4xx error mean I should retry?
- How do I report an error to support?
Is each error code globally unique?
No. Use the HTTP status, code and message together. The same ER code can mean different things on different requests.
Does a 4xx error mean I should retry?
Fix the cause first: parameters for 400, the key for 401, funds or limits for 402, and permissions for 403. For 429, wait for the reported interval and reduce traffic. Repeating the same invalid request will not fix it.
How do I report an error to support?
Include the request ID, full error response, endpoint, HTTP method and time. Remove your key before sharing the request.