---
title: "POST /api/v1/{context_id}/documents"
method: POST
path: "/api/v1/{context_id}/documents"
---

# POST /api/v1/{context_id}/documents

`POST /api/v1/{context_id}/documents`

Upload a new Layer 0 knowledge document (multipart/form-data)

## Path parameters

- `context_id` string, required

## Response `202`

Upload accepted

- UploadResponse
  - `contentHash` string, required
  - `deduplicated` boolean, required
  - `id` string, required
  - `status` 'queued' | 'extracting' | 'chunking' | 'embedding' | 'keywording' | 'extracting_nodes' | 'ready' | 'failed', required — Lifecycle state of a [`Document`] in the ingestion pipeline. Matches the SurrealQL `ASSERT $value IN [...]` on `document.status` in `V1__schema.surql`. The `Keywording` state is reserved for Phase C; in Phase A the pipeline transitions straight from `Embedding` to `Ready`.

## Other responses

- `400` — Malformed multipart, scope, or label
- `401` — Unauthorized
- `403` — Requested scope outside the caller's write region
- `409` — Label count exceeds the per-fact cap
- `415` — Unsupported media type
- `422` — Invalid context id
- `500` — Unexpected error

---

[API](https://skmtc.net/surrealdb/apis/spectron.md) · [All operations](https://skmtc.net/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/surrealdb/spectron/versions/52b41ab517b6/schema)
