---
title: "Add Documents"
method: POST
path: "/indexes/{index}/documents"
tags: ["📃 Managing documents"]
---

# Add Documents

`POST /indexes/{index}/documents`

Adding a document is relatively simple, you can either add a single document
represented as a JSON object or you can submit a array of object.

Every document is checked for the required fields,
if any docs are missing fields the *entire* request is rejected.

## Path parameters

- `index` string, required

## Request body

- union
  - object
  - object[]

## Response `200`

A standard response from Lnx, with a simple conformation message.

- BasicResponse
  - `status` integer, required
  - `data` union, required
    - string
    - object

## Other responses

- `400` — The index does not exist.
- `401` — You lack the permissions to run this operation.
- `422` — The server was unable to deserialize the payload given.

---

[API](https://skmtc.dev/lnx-search/apis/lnx-docs.md) · [All operations](https://skmtc.dev/lnx-search/apis/lnx-docs/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lnx-search/lnx-docs/revisions/3ff2d4054379/schema)
