kb_attachments_import_url
Attach the exact original bytes from a public HTTPS source URL to an existing document. Pass source_url as an ordinary string and the mandatory expected_sha256 independently supplied by the source service; never invent a URL, checksum or substitute file. Optional expected_size_bytes must match exactly. The server validates each redirect, bounds the transfer and verifies integrity before storage. Returns attachment_uuid without changing the document body or revision. To link the file, separately edit the document using label. Active downloadable attachments remain until explicitly archived. Source URLs and checksums are not returned or retained as source metadata. A failed one-use source must be replaced with a fresh source capability before a deliberate retry; the server never replays a failed request. For a chat-host file object use kb_attachments_import; for local bytes use kb_attachments_begin_upload.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Original filename, at most 255 characters, without path separators or control characters. | |
| source_url | Yes | Original-download HTTPS URL supplied by the source service, not a chat-host file object. Transient; never retained. | |
| document_id | Yes | Existing writable document in the selected workspace. | |
| tenant_slug | No | Tenant slug to target. Required when your token grants several workspaces; omit when it grants one. If you omit it with several, the refusal names your default workspace; call kb_tenants_list to see every workspace the token grants. | |
| expected_sha256 | Yes | Required independent source checksum. A mismatch is refused before storage; no checksum is returned. | |
| expected_size_bytes | No | Optional positive original byte count supplied by the source. Must match the downloaded bytes exactly; the deployment size limit always applies. | |
| include_download_url | No | Default false. Mint a short-lived (~5 minutes) Brainattic download capability only when needed to fetch the saved original bytes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attachment | Yes |