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

# Limits

> Request size, batch, and query limits across the Ingestion API, Data API, dashboard, and CLI.

This page consolidates every customer-visible limit and the exact behavior when you hit it.

## Ingestion API

| Limit                                                             | Value                                   | Behavior when exceeded                                                                          |
| ----------------------------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Request body (all endpoints)                                      | 5 MB                                    | `413` with `{"success": false, "count": 0, "message": "Request too large", "requestId": "..."}` |
| Events per batch (`/v1/ingest`, `/v1/ingest/multi`)               | 1,000                                   | `400` with `"Batch size exceeds limit of 1000"`                                                 |
| Spans / log records per OTLP request (`/v1/traces`, `/v1/otel/*`) | No count limit — only the 5 MB body cap | `413`                                                                                           |

There are currently no rate limits on the Ingestion API; it does not return `429`. Transient overload surfaces as `503` with `"retryable": true` — retry with backoff. See [Reliability](/ingestion/reliability).

Error envelope on JSON endpoints:

```json theme={"dark"}
{ "success": false, "count": 0, "message": "...", "requestId": "...", "retryable": true }
```

| Status | Meaning                                                                            |
| ------ | ---------------------------------------------------------------------------------- |
| 200    | Accepted; `count` is the number of stored rows                                     |
| 400    | Invalid body, event validation failure, batch over 1,000, or invalid `environment` |
| 401    | Missing, invalid, or revoked API key                                               |
| 413    | Body over 5 MB                                                                     |
| 500    | Internal error                                                                     |
| 503    | Temporary backpressure — safe to retry (`retryable: true`)                         |

Unknown paths return a plain-text `404`. An optional `X-Request-ID` header (UUID) is echoed back as `requestId` for correlating requests with responses.

### Environments

Accepted environment values: `development`, `staging`, `production`.

* The request-level `environment` field on `/v1/ingest` and `/v1/ingest/multi` must be exactly one of the three values; anything else returns `400` listing the valid values. It defaults to `production`.
* Environment values carried on OTLP attributes (`moda.environment` span attribute, `deployment.environment` resource attribute) normalize common aliases — `dev`/`develop` → `development`, `stg`/`stage` → `staging`, `prod` → `production` — and unknown values fall back to `production`.

## Data API

Out-of-range numeric parameters are clamped to their maximum — they do not error. Invalid enum values and over-length strings return `400`.

| Parameter                    | Cap              | Behavior when exceeded |
| ---------------------------- | ---------------- | ---------------------- |
| `days_back`                  | 90               | Clamped                |
| `offset`                     | 10,000           | Clamped                |
| `window` (context endpoints) | 5                | Clamped                |
| `q` (`/search` query)        | 500 characters   | `400`                  |
| `note` (`POST /feedback`)    | 4,000 characters | `400`                  |

Per-endpoint `limit` caps:

| Endpoint                                                                            | Maximum `limit` |
| ----------------------------------------------------------------------------------- | --------------- |
| Most list endpoints                                                                 | 100             |
| `/frustrations`, `/emotions`, `/hallucinations`                                     | 20              |
| `/tool-failures/{toolName}` (examples)                                              | 20              |
| `/problems`                                                                         | 25              |
| `/problems/{id}/reports`, `/problems/{id}/conversations`, `/problems/{id}/evidence` | 50              |

## Dashboard and CLI

**CLI key limit.** Each workspace caps the number of active CLI-created keys (named `CLI - ...`). The default is 10; admins and owners can set it between 1 and 100 in **Settings → Ingestion keys**.

## Harness

| Limit                            | Value        | Behavior                                                                               |
| -------------------------------- | ------------ | -------------------------------------------------------------------------------------- |
| Source snapshot upload           | 5 MB         | Analysis request rejected with `413` — narrow with `moda harness analyze --path=<dir>` |
| Serialized harness graph on sync | 2 MB         | Sync refuses with an error suggesting a narrower analysis root                         |
| Snapshot per-file size           | 512 KB       | Larger files are skipped                                                               |
| Snapshot file count              | 12,000 files | Analysis proceeds on a truncated snapshot; the GitHub Check Run notes the truncation   |
| Snapshot total text              | 48 MB        | Same truncation behavior                                                               |

## Next steps

* [Reliability](/ingestion/reliability) — retry guidance and error envelopes in depth.
* [Data API overview](/data-api/overview) — endpoints these clamps apply to.
* [Authentication](/administration/authentication) — key management and revocation timing.
