---
title: "Chunk + embed text for a registered document."
method: POST
path: "/v1/documents/{id}/index"
tags: ["Documents"]
---

# Chunk + embed text for a registered document.

`POST /v1/documents/{id}/index`

Deterministic char-window chunking, batched embeddings via the core embedding provider, and one provenance-linked memory per chunk. Idempotent on byte-identical text under the current chunker_version: the response's `idempotent_skip` flag indicates whether work was performed. A re-index with new text soft-deletes the prior generation of chunks + derived memories before inserting the fresh one.

## Path parameters

- `id` string, uuid, required

## Request body

- object — Chunk + embed the supplied text for the registered document, creating one provenance-linked memory per chunk. Idempotent on byte-identical text under the current chunker_version.
  - `text` string, required — Required. text.
  - `user_id` string, required — Required. user_id.

## Response `200`

Indexing result with chunk + memory counts.

- object — Text indexing result. `indexed_content_hash` is the SHA-256 of the indexed text and is stored on the document as `indexed_content_hash` (distinct from the upstream/provider `content_hash`). `idempotent_skip: true` when the input matched the prior indexed text under the current chunker_version (no fresh chunks or memories created); otherwise the prior generation was soft-deleted and the counts reflect the new generation.
  - `chunker_version` string, required
  - `chunks_created` number, required
  - `document_id` string, required
  - `idempotent_skip` boolean, required
  - `indexed_content_hash` string, required
  - `memories_created` number, required
  - `parser_version` string, required

## Other responses

- `400` — Input validation error
- `404` — Document not found
- `500` — Internal server error
- `502` — Upstream AI provider returned an unrecoverable failure (auth, non-retryable 4xx).
- `503` — Upstream AI provider is rate-limited, quota-exhausted, or returned 5xx; consult `retryable`.

---

[API](https://skmtc.net/atomicstrata/apis/atomicmemory-http-api.md) · [All operations](https://skmtc.net/atomicstrata/apis/atomicmemory-http-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atomicstrata/atomicmemory-http-api/versions/d501daa39bb2/schema)
