> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Understand API error responses and how to handle them

Field Sight uses standard HTTP status codes:

* `2xx` – The request was successful.
* `4xx` – There was a problem with the request.
* `5xx` – Something went wrong on our side.

## Error response format

Every error returns a JSON response in the following format:

```json
{
  "code": "FORBIDDEN",
  "message": "The provided x-api-key does not match the required prefix format or has expired."
}
```

| Field | Description |
| - | - |
| `code` | Machine-readable error code that you can handle in your application. |
| `message` | Human-readable explanation of the error. |

## HTTP status codes

| Status | Meaning | What to do |
| - | - | - |
| `400` | Bad Request | Fix the query parameters, multipart form fields, or request body before resubmitting. Do not retry an identical request. |
| `401` | Unauthorized | Provide valid authentication credentials using the `x-api-key` header. |
| `402` | Payment Required | Your subscription may be inactive or your token balance depleted. Upgrade your plan or purchase additional usage credits. |
| `403` | Forbidden / No Permission | Check that your API key is valid and that your user has sufficient permissions for the requested organization. |
| `404` | Not Found | Verify the request path, resource ID, or pending request identifier. |
| `409` | Conflict | The operation conflicts with the current server state (e.g., the request has already expired or been finalized). |
| `413` | Payload Too Large | Reduce the file size to the allowed limit (10 MB for images and JSON; 25 MB for Excel). |
| `415` | Unsupported Media Type | Ensure the file extension and binary content match one of the supported file formats. |
| `422` | Unprocessable Entity | The file was uploaded successfully, but the AI detection engine could not process its contents. Check the error details. |
| `429` | Too Many Requests | Wait before retrying. Too many concurrent processing requests are already in progress. |
| `500` | Internal Server Error | Retry with exponential backoff. Contact support if the problem persists. |
| `503` | Service Unavailable | The upstream service is temporarily unavailable. Retry after a short interval. |

## Error codes

| Code | Status | Cause | Fix |
| - | -: | - | - |
| `BAD_REQUEST` | `400` | Invalid query parameters (e.g., `check_blur` is not a boolean or `days` is not an integer), or the multipart `file` field is missing. | Verify query parameter types and provide the uploaded file using the `file` form key. |
| `EMPTY_FILE` | `400` | The uploaded `.json` file is empty or contains only whitespace or BOM bytes. | Ensure the JSON file contains valid data before uploading. |
| `UNAUTHORIZED` | `401` | The provided API key was not found, is inactive, or has been revoked. | Provide a valid, active API key in the `x-api-key` header. |
| `NO_ACTIVE_SUBSCRIPTION` | `402` | The organization has no active plan, or no usable subscription or token source could be resolved. | Renew or purchase a plan with available usage from the dashboard. |
| `TOKENS_EXHAUSTED` | `402` | Available tokens or seat quota were exhausted during reservation or request completion. | Purchase additional tokens or upgrade your organization's seat plan. |
| `NOT_ALLOWED` | `403` | The user does not have sufficient permissions to perform the requested operation within the organization. | Ask your organization administrator to grant the required permissions. |
| `FORBIDDEN` | `403` | The provided `x-api-key` has an invalid format or prefix, or has expired. | Generate a new API key from your workspace settings. |
| `NOT_FOUND` | `404` | The request log ID could not be found during the completion step. | Ensure the transaction has not been cleared or expired before completion. |
| `REQUEST_NOT_PENDING` | `409` | The request has already been completed, expired, or previously marked as failed. | Submit a new detection request instead of attempting to complete the existing one. |
| `FILE_TOO_LARGE` | `413` | The uploaded file exceeds the size limit (10 MB for images and JSON; 25 MB for Excel). | Compress or reduce the file size to meet the allowed limit. |
| `INVALID_FILE_TYPE` | `415` | The file extension is not supported (`.png`, `.jpg`, `.jpeg` for images; `.json` for JSON; `.xlsx`, `.xlsm` for Excel). | Convert or re-save your file using one of the supported extensions. |
| `INVALID_FILE_CONTENT` | `415` | The file is corrupted or its content does not match the expected format (JPEG/PNG, JSON, or Excel). | Upload an uncorrupted file with valid content matching the expected format. |
| `UNPROCESSABLE_ENTITY` | `422` | The upstream AI engine could not extract or detect valid structures from the uploaded file. | Review the error details in the response payload, retake the photo, or verify the document format. |
| `TOO_MANY_PENDING_REQUESTS` | `429` | Too many simultaneous requests are already in progress for this account. | Reduce request concurrency and wait for in-flight requests to finish before sending more requests. |
| `INTERNAL_ERROR` | `500` | An unexpected internal server error occurred. | Retry with exponential backoff. If the problem persists, contact support. |
