---
title: "Queue documents for indexing"
method: POST
path: "/ingest"
---

# Queue documents for indexing

`POST /ingest`

## Request

- Base URL: `https://api.lochless.io/api/v1`
- URL: `https://api.lochless.io/api/v1/ingest`
- Auth: HTTP bearer

Scope: ingest. One document, or {"documents": [...]} with 1 to 100. Each needs id (1-512 chars), text (up to 1,000,000 chars) and timestamp (ISO 8601 with a timezone; it dates the document). metadata is optional JSON (64 KB). The same id replaces. Body at most 25 MB. A 202 means durably queued, not indexed: indexing runs in the background. Lochless workspaces: indexing costs a price per page (3,000 characters of text, rounded up, at least 1 per document), charged from the balance once when the document is ready; a failed document is free, and re-sending the same text is free. At zero balance or at the monthly spend cap the call answers 402, and documents already queued wait for a top-up. 429 queue_full when a million documents are pending.

## Request body

- union
  - IngestDocument
    - `id` string, required
    - `text` string, required
    - `timestamp` string, date-time, required
    - `metadata` unknown
  - object
    - `documents` IngestDocument[], required
      - `id` string, required
      - `text` string, required
      - `timestamp` string, date-time, required
      - `metadata` unknown

## Response `202`

{documents: [{id, status}]}

## Other responses

- `400`: Invalid documents
- `401`: Missing, invalid, revoked or expired API key
- `402`: Lochless workspaces: spend_cap_reached (monthly spend cap reached) or add_credit (balance used up; top up in the console)
- `403`: Missing ingest scope
- `409`: conflict: ingest paused for this workspace
- `413`: payload_too_large: body or document too large
- `429`: Rate limited, or queue_full; honour Retry-After

---

[API](https://skmtc.dev/lochless/apis/synoptic-customer-api.md) · [All operations](https://skmtc.dev/lochless/apis/synoptic-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lochless/apis/synoptic-customer-api/revisions/e6dee3956611?raw)
