> ## Documentation Index
> Fetch the complete documentation index at: https://studio.chat-atp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a document

> Upload a file into a knowledge base

Multipart upload. Field name is `file`. Do **not** send `Content-Type: application/json`.

<ParamField path="knowledge_base_id" type="string" required>
  Knowledge base ID.
</ParamField>

<ParamField body="file" type="file" required>
  File bytes (`multipart/form-data`).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://chatatp-agent-builder-backend.onrender.com/v1/knowledge-bases/kb_123/documents/ \
    -H "Authorization: Bearer $CHATATP_API_KEY" \
    -F "file=@./handbook.pdf"
  ```
</RequestExample>

## SDK

<CodeGroup>
  ```typescript TypeScript theme={null}
  await client.knowledgeBases.upload(id, "./handbook.pdf");
  ```

  ```python Python theme={null}
  await client.knowledge_bases.upload(knowledge_base_id, Path("handbook.pdf"))
  ```
</CodeGroup>
