---
title: "Upsert documents"
method: POST
path: "/v1/namespaces/{namespace}/documents"
tags: ["Documents"]
---

# Upsert documents

`POST /v1/namespaces/{namespace}/documents`

Upserts documents to a namespace. Creates the namespace if it doesn't exist. Accepts up to 10,000 documents per request with a 256 MB body limit.

## Request body

- UpsertDocumentsRequest
  - `documents` Document[], required
    - `id` string, required — Document ID. UUID or string up to 64 characters.
  - `schema` NamespaceAttributesSchema — Maps attribute names to their configuration.

## Response `200`

Successful response

- UpsertDocumentsResponse
  - `documents_upserted` integer, required

## Other responses

- `400` — The request was invalid.
- `401` — Missing or invalid API key.

## Changes

- **2026-04-13** `ee3554910b7d` — 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
- **2026-04-02** `e67f3d38f850` — 2 warning, 2 info
  - removed the request property `schema/additionalProperties/filterable`
  - removed the request property `schema/additionalProperties/full_text_search`
  - added the new optional request property `schema/additionalProperties/is_filterable`
  - added the new optional request property `schema/additionalProperties/is_searchable`
- **2026-03-09** `2124afb62085` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/charcoalhq/apis/charcoal-api/changes/v1/namespaces/:namespace/documents/post.md)

---

[API](https://skmtc.dev/charcoalhq/apis/charcoal-api.md) · [All operations](https://skmtc.dev/charcoalhq/apis/charcoal-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/charcoalhq/charcoal-api/revisions/eee9850f4746/schema)
