---
title: Error Codes
description: HTTP status codes and error codes returned by the API, and how to handle each one.
type: reference
status: stable
updated: 2026-12-03
url: /en/docs/errors
markdown: /en/docs/errors.md
---

Read as needed; not a required onboarding step. Path：[Data Access Path](/en/docs)

# Error Codes

Every endpoint returns errors in the same JSON shape. This page lists what each status and error code means and what to do about it.

## Error response format [#format]


```json
{
  "code": "entitlement_denied",
  "message": "platform xiaohongshu is not in the application policy",
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
```


| Field | Meaning |
| --- | --- |
| `code` | The error code. Branch on this in your code |
| `message` | A human-readable explanation. Its wording may change, so don't parse it |
| `trace_id` | Trace ID for support |
| `violations` | For validation errors, one entry per invalid field |

The `X-Request-ID` response header identifies the request. Use it to find the call in the console's [request log](/en/portal/requests).

## Handle by status code [#status]

| Status | Meaning | Retry? | What to do |
| --- | --- | --- | --- |
| `400` | The request is invalid | No | Fix the request using `code` and `violations` |
| `401` | The API key is missing, invalid, expired or revoked | No | Check the `Authorization` header and the key |
| `402` | The organization is out of credits | No | Top up in the console or check billing |
| `403` | The request is outside the application's access | No | Narrow the request, or ask your organization admin to request access. A new key does not widen access |
| `404` | The ID does not exist or does not belong to your application | No | Check the ID |
| `409` | The result is not ready, or conflicts with an earlier request | Depends on the code | See the codes below |
| `410` | The cursor is past its retention window | No | Start reading again; see [change feed](/en/docs/change-feed) |
| `429` | Rate limit or daily quota exceeded | Yes | Wait for `Retry-After`, then retry |
| `502`, `503`, `504` | The service is temporarily unavailable | Yes | Retry with exponential backoff. For create requests, first check whether the resource was created |

## Common codes [#common]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `401` | `unauthorized` | The key is missing, invalid, expired or revoked | Stop retrying and check the key |
| `402` | `credit_insufficient` | The organization is out of credits | Top up, then retry |
| `403` | `entitlement_denied` | The platform, field or feature is outside your access | Narrow the request, or request access |
| `429` | `rate_limit_exceeded` | Requests per second, concurrency or daily allowance exceeded; `message` says which | Retry after `Retry-After`; daily allowances reset at 00:00 UTC |
| `429` | `quota_exceeded` | The daily quota for this operation is used up | Wait for the 00:00 UTC reset, or request an increase |

## Search and browse [#search]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `400` | `invalid_query` | Invalid search parameters or `mode` | Fix the request; new integrations use `mode: keyword` |
| `400` | `invalid_document_query` | Invalid time or paging parameters, an unknown parameter, or an author query without a platform | Fix the request |
| `400` | `invalid_classification_query` | Invalid `source_platform`, `limit` or `after_code` in a category query | Fix the request |
| `404` | `user_not_found` | No documents from this user within your access and time window | Widen the window (up to 31 days), or collect with a [live query](/en/docs/live-query) |
| `503` | `search_backend_unavailable` | Search is temporarily unavailable | Retry with exponential backoff |
| `503` | `document_query_timeout` | The query timed out | Retry later with the same `cursor`; don't restart with a smaller window |
| `503` | `catalog_unavailable` | Browsing is temporarily unavailable | Narrow the window and retry with backoff |
| `503` | `catalog_tags_paused` | Filtering by native tags is paused | Don't retry in a loop; drop `tags` if results without tag filtering are acceptable |
| `503` | `vector_search_disabled` | Vector search has been retired | Don't retry; use `mode: keyword` |

## Documents [#documents]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `400` | `invalid_request` | Invalid parameters, for example more than 50 IDs in a batch read | Fix the request |
| `403` | `forbidden` | The document or a field is outside your access | Request access |
| `404` | `not_found` | The document doesn't exist | Check the ID |

In a batch read, a failed document carries its own `error` (`not_found` or `forbidden`); the request still returns `200`.

## Attachments [#attachments]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `403` | `forbidden` | No access to the document or to the `assets` field | Request access |
| `404` | `not_found` | The document doesn't exist or isn't stored yet | Check the ID |
| `404` | `attachment_not_found` | The attachment doesn't exist or belongs to another document | Check `asset_id` |
| `409` | `attachment_incomplete` | The attachment isn't fully stored yet | Retry later |
| `503` | `attachment_unavailable` | The attachment service is temporarily unavailable | Retry later |

## Analytics [#analytics]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `400` | `invalid_query` | Invalid query shape, limits or member names, or too long a range for a directly computed source | Fix the request; don't retry automatically |
| `422` | `analytics_not_answerable` | The combination can't be answered from the existing rollups, for example hourly totals | Change dimensions or granularity; see `/v1/analytics/meta` |
| `503` | `analytics_unavailable` | Temporarily unavailable, rollups still building, or a direct computation timed out | Retry a few times with backoff; for timeouts, shorten the range or add filters |

## Live queries [#live-query]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `400` | `live_query_invalid` | Invalid parameters, for example a platform that can't filter by publish time, or a repeated condition | Fix the request per `message`, or choose another platform |
| `404` | `live_query_not_found` | The query doesn't exist or belongs to another application | Check the ID |
| `409` | `live_query_results_not_ready` | Results are not ready yet | Keep polling the status |
| `409` | `idempotency_key_conflict` | The same `Idempotency-Key` was sent with different parameters | Use a new `Idempotency-Key` for a new request |
| `409` | `platform_dataset_route_missing` | Live queries are not yet available for this platform | Contact us to enable it |

## Monitoring subscriptions [#subscriptions]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `400` | `invalid_json` | The request body isn't valid JSON | Fix the request |
| `400` | `collection_request_failed` | Validation failed, for example a missing user or channel identifier, or an out-of-range interval | Fix the request per `message` |
| `400` | `dataset_id_not_allowed` | The request includes `dataset_id` | Remove the field |
| `403` | `collection_request_failed` | Monitoring isn't enabled, the platform is outside your access, or monitoring is unavailable for it | Request access or contact us |
| `404` | `collection_request_failed` | The subscription doesn't exist or belongs to another application | Check the ID |
| `409` | `keyword_subscription_limit_reached` | Too many active keyword subscriptions | Pause subscriptions you no longer need |
| `409` | `platform_dataset_route_missing` | Monitoring is not yet available for this platform | Contact us to enable it |
| `503` | `collection_request_failed` | Temporarily unavailable | Retry later |

## Bulk exports [#exports]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `400` | `invalid_export_request` | Malformed request body | Fix the request |
| `400` | `export_create_failed` | Validation failed, for example a format/compression mismatch, start after end, partial fields for `parquet`, or the daily export limit | Fix the request per `message` |
| `400` | `invalid_export_file` | `sequence` is not a non-negative integer | Use the `sequence` from the file list |
| `403` | `export_forbidden` | Exports are not enabled, or a platform or field is outside your access | Ask your organization admin to request access, or request fewer fields |
| `404` | `export_not_found`, `export_file_not_found` | The job or file doesn't exist, belongs to another application, or has expired | Expired exports must be recreated |

## Console [#portal]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `409` | `application_limit_reached` | The organization reached its application limit (10 by default) | Contact us to raise it |

## Change feed [#changes]

| Status | `code` | Meaning | What to do |
| --- | --- | --- | --- |
| `410` | — | The cursor is older than the 30-day retention window | Read again without a cursor, and fill the gap with a [bulk export](/en/docs/exports) |
| `503` | `changes_timeout`, `changes_unavailable` | The service is temporarily unavailable | Retry after `Retry-After` |

## Retry guidance [#retry]

- Retry only `429` and `5xx`.
- Use exponential backoff with jitter, starting at 500 ms.
- When `Retry-After` is present, wait at least that long.
- When retrying a live query creation, send the same `Idempotency-Key` to avoid creating it twice.

More production guidance: [Limits, Retries & Troubleshooting](/en/docs/production).

## Continue Your Task

[Return to the integration path](/en/docs); return to your task after consulting this reference.
