add_wiki_attachment
Attach a file to a wiki page, identified by 'pageId' or by 'spaceKey' + 'title': pass its bytes as 'contentBase64', or its content as 'text' when the file is text. Re-attaching a filename the page already has replaces its bytes and bumps its version, as the wiki does everywhere else, so retrying this call cannot leave two copies. An attached file is not on the page until the body references it — the answer hands you the Markdown to add with update_wiki_page. An image may also carry a dark-theme version, attached as the same name with '-dark' before the extension (diagram.svg + diagram-dark.svg); the body still references the plain name. Requires permission to edit the page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | The file's content as text, stored as UTF-8 — for a log, CSV or Markdown file you are writing here. Alternative to 'contentBase64'; passing both is refused. | |
| title | No | Exact page title, when identifying the page by title. | |
| pageId | No | Page id (as returned by search_wiki). | |
| comment | No | Short note about this upload, shown in the page's attachment list. | |
| filename | Yes | File name to store, e.g. 'diagram.png'. Any directory part is dropped. | |
| mimeType | No | Content type to record for the listing, e.g. 'text/csv'. Ignored when the bytes identify themselves, and never used to serve the file. | |
| spaceKey | No | Space key, when identifying the page by title. | |
| contentBase64 | No | The file's bytes, base64-encoded (a 'data:…;base64,…' URL is accepted and unwrapped). Use 'text' instead when the file is text. |