# Files

Attachments to Knowledge Base 2.0 documents. The [Upload file](./files/upload.md) method saves the file content, links the file to the document, and returns the ready-to-insert `assetMarkdown` fragment. The attachment appears in the document text only after you insert that fragment into the content via `PATCH /v1/note/documents/:id`. [Getting the metadata](./files/get.md) returns the same object by document and file ID.

**Scope:** `note` | **Base URL:** `https://vibecode.bitrix24.com/v1` | **Authorization:** `X-Api-Key`

## Operations

- [Upload file](./files/upload.md) — `POST /v1/note/documents/:documentId/files`
- [Get file metadata](./files/get.md) — `GET /v1/note/documents/:documentId/files/:id`

## Typical scenario

1. Create a document: `POST /v1/note/documents`.
2. Upload a file: `POST /v1/note/documents/:documentId/files` — take `assetMarkdown` from the response.
3. Insert the fragment into the content: `PATCH /v1/note/documents/:id` with the updated `markdown`.

Full curl example — [Knowledge Base overview](/docs/note).

## See also

- [Knowledge bases](/docs/note/collections)
- [Documents](/docs/note/documents)
- [Knowledge Base overview](/docs/note)
