---
title: "Add Document"
method: POST
path: "/v1/knowledge-bases/{knowledge_base_id}/documents"
tags: ["Knowledge bases"]
---

# Add Document

`POST /v1/knowledge-bases/{knowledge_base_id}/documents`

Add a document to a knowledge base using JSON text or multipart file upload.

## Path parameters

- `knowledge_base_id` string, uuid, required — Unique knowledge base ID.

## Query parameters

- `organization_id` string, uuid, nullable — Organization scope for API keys that can access multiple organizations.

## Request body

- object
  - `name` string, required — Unique document name.
  - `text` string, required — Text content to add to the document.
  - `folder` string, nullable — Folder path to add the document under.

## Response `201`

Successful Response

- DocumentOperationResponse
  - `message` string, required — Operation result message.
  - `name` string, required — Document name.
  - `path` string, required — Document path.
  - `folder` string, nullable — Document folder path.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/cooper-square-technologies/apis/external-api.md) · [All operations](https://skmtc.net/cooper-square-technologies/apis/external-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cooper-square-technologies/external-api/revisions/ab03b3c80494/schema)
