attach_file
Attach a real file (image, PDF, audio, anything) to the brain, next to a note: it lands in the attachments/ folder of the note's branch and a Markdown reference is appended to the note (link=false to skip, then place the returned Markdown yourself). Give the file in ONE of three ways: data (base64, files up to ~3 MB), url (a public URL, fetched server-side, up to 25 MB), or neither: you get a signed PUT URL to upload the bytes yourself (e.g. with curl), then call attach_file again with the returned name and confirm=true. Returns the brain path and the Markdown that references it.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public http(s) URL to fetch | |
| data | No | Base64 content (a data: URL prefix is fine) | |
| link | No | Append the reference to the note (default true when path is a note) | |
| name | Yes | File name with extension (accents and spaces are normalized) | |
| path | Yes | The note (…/nota.md) the file belongs to, or a folder | |
| confirm | No | Second step of the direct upload: the bytes are on R2, register them | |
| workspace | No | Brain to act on: its id, «mio» (yours), or the owner's name/email as shown by search. Usually OMIT it: a path that already lives in one brain is found there, for reads and writes alike. Pass it only when the tool tells you to (a NEW branch, or one that exists in several brains) — with the brain the user named; when they were not explicit ASK THEM. A brain where the branch does not exist is refused even if you name it. |