---
title: "Import a .md/.txt/.pdf/.docx document."
method: POST
path: "/api/brain/import"
---

# Import a .md/.txt/.pdf/.docx document.

`POST /api/brain/import`

## Request

- Base URL: `https://shapelessai.com`
- URL: `https://shapelessai.com/api/brain/import`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://shapelessai.com/api/auth/mcp/authorize`, token URL `https://shapelessai.com/api/auth/mcp/token`, scopes: `write`)

## Response `200`

OK

## Other responses

- `400`: No multipart form, no file, an empty file, or a name we cannot store.
- `401`: No credential, or not valid.
- `403`: The key is missing the "write" scope.
- `413`: Over 1 MB of text, over 15 MB of PDF or Word, or extracted text over Brand Memory's 256 KB; nothing was written.
- `415`: Not .md, .txt, .pdf or .docx; images go to PUT /api/brain/assets/{filename}.
- `422`: No readable text in it (a scanned PDF).
- `429`: Over the key's rate limit (600 requests an hour).
- `502`: Brand Memory is not answering; nothing was written. Resend later.

## Changes

- **2026-10-20** `fae8f701d466`: 5 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `413`
  - added the non-success response with the status `415`
  - added the non-success response with the status `422`
  - …1 more

[Operation history](https://skmtc.dev/shapelessai/apis/shapeless-api/changes/api/brain/import/post.md)

---

[API](https://skmtc.dev/shapelessai/apis/shapeless-api.md) · [All operations](https://skmtc.dev/shapelessai/apis/shapeless-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shapelessai/apis/shapeless-api/revisions/fae8f701d466?raw)
