# Errors (/docs/errors)

Every error uses the [standard envelope](/docs#the-standard-response) with `success: false`:

```json
{
  "success": false,
  "error": "BAD_TOKEN",
  "detail": "The provided token is invalid.",
  "data": null
}
```

- Branch on **`error`**: it is the stable code. Show **`detail`** to people: it is a user-friendly message.
- `data` is usually `null`. For some errors it holds extra information (for example `UNKNOWN_ERROR`).

## Status codes [#status-codes]

| Status | Meaning |
| --- | --- |
| `200` | Always means success. |
| `400` | The user did something wrong, or an input wasn't correct or expected. |
| `401` | The API token is missing or invalid. |
| `403` | The token is fine but the account is not allowed to do this, for example because of its plan. |
| `404` | What was asked for wasn't found. |
| `409` | It conflicts with something that already exists. |
| `429` | A limit was reached. See [Rate limits](/docs/rate-limits). |
| `500` | Something went wrong on TorBox's end. |
| `503` | A part of TorBox is unavailable for the moment, so the call can be tried again. |

<Callout>
Request validation errors (a missing or mistyped field) are answered with `422` and FastAPI's
`{"detail": [...]}` body, not the envelope.
</Callout>

## Error codes [#error-codes]

A `4xx` status means the request or the account is the cause, a `5xx` status means the fault is on TorBox's
end. A few endpoints send an error with another status than the one listed; their examples in the
[reference](/reference) show which.

| Error code | Status | Meaning |
| --- | --- | --- |
| MISSING_REQUIRED_OPTION | 400 | The API is missing required information to process the request. |
| MISSING_DATA | 400 | The request is missing data that is needed to process it. |
| INVALID_OPTION | 400 | The provided option is invalid. |
| TOO_MANY_OPTIONS | 400 | Client sent too many options. Usually this has to do with the API requiring only 1 option but the client sent more than the required. |
| TOO_MUCH_DATA | 400 | Client sent too much data to the API. Please keep requests under 100MB in size. |
| DOWNLOAD_TOO_LARGE | 400 | This download is oversized for the user's plan. The user is recommended to upgrade their plan to download this file.  <br />  <br />Free Plan Limit: **10737418240** bytes  <br />Essential Plan Limit: **214748364800** bytes  <br />Standard Plan Limit: **214748364800** bytes  <br />Pro Plan Limit: **1099511627776** bytes |
| BOZO_TORRENT | 400 | The torrent sent is not a valid torrent. |
| BOZO_NZB | 400 | The NZB sent is not a valid NZB file. |
| BOZO_FILE | 400 | This file doesn't match the required mimetype. Please use a different file. |
| BOZO_RSS_FEED | 400 | This RSS feed is invalid, not a well-formed XML, or could not be read by TorBox. |
| BOZO_REGEX | 400 | The regex you entered is bad. |
| BOZO_REFERRAL | 400 | The referral code is invalid, or would not give the user any benefit. |
| BAD_CONFIRMATION | 400 | The confirmation code you have given is invalid. |
| UNSUPPORTED_SITE | 400 | The link is from a site that TorBox cannot download from. The supported sites are in the hoster list. |
| URL_NOT_ALLOWED | 400 | The URL given cannot be used. It could not be resolved, or it points somewhere TorBox does not download from. |
| DIFF_ISSUE | 400 | The request parameters sent does not allow for this request to complete. |
| WHY_ARE_YOU_LIKE_THIS | 400 | The user tried to use their own referral code. |
| DEVICE_CODE_NOT_USED | 400 | The user has not authorized this device code yet. Keep polling. |
| DEVICE_CODE_USED | 400 | This device code has already been redeemed. Start the device code process again. |
| OAUTH_VERIFICATION_ERROR | 400 | The server tried verifying your OAuth token, but it was not accepted by the provider. |
| NAME_TOO_SHORT | 400 | The name or tag given is empty. |
| NAME_TOO_LONG | 400 | The name or tag given is 200 characters or longer. |
| INVALID_HASH | 400 | A hash given is not an MD5, SHA1 or SHA256 hash. |
| NO_CHANGES | 400 | The request did not contain anything to change. |
| INVALID_EMAIL | 400 | The email address given is not valid, or is a disposable email address. |
| INVALID_VENDOR_URL | 400 | The URL given for the vendor account is not a valid URL. |
| NO_AUTH | 401 | There are no provided credentials. |
| BAD_TOKEN | 401 | The provided token is invalid. |
| AUTH_ERROR | 403 | The given authentication was checked and not accepted. |
| PLAN_RESTRICTED_FEATURE | 403 | This feature is restricted to users of higher plans. The user is recommended to upgrade their plan to use this endpoint. |
| UPGRADE_REQUIRED | 403 | This feature is not available on the free plan. The user is recommended to upgrade their plan. |
| ITEM_NOT_ALLOWED | 403 | This item or account is not allowed to be used for this request. The reason is in `detail`. |
| VENDOR_DISABLED | 403 | This vendor account has been disabled. Please contact support. |
| AI_DISABLED | 403 | The user has turned off AI features in their settings. |
| ENDPOINT_NOT_FOUND | 404 | If you have hit an endpoint that doesn't exist. |
| ITEM_NOT_FOUND | 404 | The item you queried cannot be found. |
| USER_NOT_FOUND | 404 | The user you queried cannot be found. |
| DOWNLOAD_NOT_CACHED | 404 | The download was sent with `add_only_if_cached` and is not cached, so it was not added. |
| NO_REFERRAL_CODE | 404 | The user does not have a referral code. |
| DUPLICATE_ITEM | 409 | This item already exists. |
| NOT_OWNER | 409 | The item does not exist, or does not belong to the user. |
| USER_EXISTS | 409 | A user with this email address already exists and cannot be used for this request. |
| CONFIRMATION_EXPIRED | 410 | The confirmation code you have given is expired. Request a new code. |
| DEPRECATED | 410 | This endpoint is deprecated. The endpoint to use instead is in `detail`. |
| RATE_LIMIT_EXCEEDED | 429 | Client sent too many requests. The limit that was reached is in `detail`. Read the Rate Limits section above. |
| MONTHLY_LIMIT | 429 | User has hit the maximum monthly limit. It is recommended user upgrade their account to be able to download more. |
| COOLDOWN_LIMIT | 429 | User is on download cooldown. It is recommended user upgrade their account to be able to bypass this restriction. |
| ACTIVE_LIMIT | 429 | User has hit their max active download limit. It is recommended user upgrade their account or purchase addons to bypass this restriction. |
| DOWNLOAD_LIMIT_REACHED | 429 | User has hit the daily limit of downloads for this hoster. The limit resets after 24 hours. |
| DAILY_BANDWIDTH_LIMIT_EXCEEDED | 429 | User has used up the daily bandwidth of their plan. |
| AIRLOCK_LIMIT_REACHED | 429 | The user's Airlock storage is full, or this download would not fit in it. |
| ASSISTANT_DAILY_LIMIT | 429 | User has used up the assistant for today. It resets at 00:00 UTC. |
| ASSISTANT_FREE_LIMIT | 429 | User has used up the assistant messages of the free plan for today. |
| DATABASE_ERROR | 500 | Could not access internal database/memory store information. |
| UNKNOWN_ERROR | 500 | The reason for the error is unknown. Usually there will be error data attached in the "data" key. In these cases please report the request to [contact@torbox.app](mailto:contact@torbox.app). |
| DOWNLOAD_SERVER_ERROR | 500 | There was an error interacting with the download on the download server. It is recommdned to simply wait some time before trying again. |
| DOWNLOAD_METADATA_ERROR | 500 | The full metadata of the torrent could not be downloaded in time. What the trackers answered is in `data`. |
| STORAGE_ERROR | 500 | There was an error with TorBox's internal storage. |
| STREAM_INFO_ERROR | 500 | The information needed to stream this file could not be read. |
| ASSISTANT_ERROR | 500 | There was an error with the assistant. |
| REDIRECT_ERROR | 500 | The server tried redirecting, but it faulted. |
| REGISTRATION_FAILED | 500 | The OAuth link could not be registered. |
| UNREGISTRATION_FAILED | 500 | The OAuth link could not be unregistered. |
| AUTH_UNAVAILABLE | 503 | The token could not be verified right now. This says nothing about the token, so try again shortly. |
| NO_SERVERS_AVAILABLE_ERROR | 503 | There are no download servers available to handle this request. This should never happen. If you receieve this error, please contact us at [contact@torbox.app](mailto:contact@torbox.app). |
| DOWNLOAD_SERVER_OFFLINE | 503 | The download server that holds this download is offline. |
| LINK_OFFLINE | 503 | The link given is inaccessible or has no online files. |
| TEMPORARILY_DISABLED | 503 | The site of this link is temporarily disabled on TorBox. |