Attachments
The Memo presence and attachment API map lists matching TypeScript operations, JSON receipts, and recovery behavior.
Files inherit the memo's permissions. Uploading a file to a private memo keeps
it private. Set MEMO_ID to an accessible memo and add its owner's --namespace
when needed.
Upload and retrieve
Uploads and downloads preserve bytes. cat refuses binary content; use
download for it. Downloads default to stdout if no output path is supplied.
Existing paths require explicit --overwrite where supported.
Upload inline media and return its URL
Check dl memos media upload --help for availability. Requires CLI 0.37.0 or later. If unavailable in your installed CLI, use the
HTTP upload example
with a valid API bearer token.
After dl login, upload an image and print only its embeddable URL:
Choose one of those commands: each invocation uploads a new media object.
No memo ID, namespace, curl, jq or --json is required. The command uses
saved login credentials and supports --remote and --token. For video embedding syntax, see Videos. Images and
videos are accepted; the server detects the type from the bytes. Optional
--json returns url, contentType and sizeBytes.
Use the returned URL in a Markdown or HTML file:
To append the Markdown to an existing memo, set MEMO_ID to its ID and run
dl memos append "$MEMO_ID" --file image.md. Uploading media alone
does not edit a memo. Use Markdown for the Memos body; HTML markup is for an
HTML document. Keep the returned media URL, not its temporary storage redirect.
Anyone holding a media URL can load it without signing in. Making a memo
private does not revoke that URL. To keep an image under a memo's permissions,
use memos files upload ./diagram.png --note "$MEMO_ID" instead. That stores
an attachment with a logical path, not an embeddable URL. memos files preview
returns a viewer page, not an image src. Media uploads are not included in
memos files list.
Manage files
rm moves a file to trash. Use files restore --help to restore the returned
file ID, optionally to a new path. rm --purge requests permanent deletion.
Current production has durable purge disabled: immutable attachments and files
with retained object lineage fail closed instead of deleting their stored bytes.
The CLI flag does not establish server support; do not treat a refusal or an
unconfirmed response as successful deletion.
File write/move/remove operations support --if-match with the file's ETag,
not the memo's write revision.
Recover an attachment operation (CLI 0.48.2)
CLI 0.48.2 adds these flags and recovery commands; CLI 0.48.1 does not include
them. Check installed --help and server support independently. They require a
separately verified server with its known-byte publication journal enabled;
a503 unavailable response is not permission to fall back to an unguarded write.
For text writes and copies only, supply a stable printable ASCII key (1–256 bytes) without surrounding spaces for one exact request. The CLI passes it unchanged and never automatically retries.
A response supplies an operation ID on stderr, or as an additive operationId
field with --json. Preserve that ID, the exact original request, key, Memo ID
and namespace. On an uncertain result, inspect the original operation first;
do not resend bytes, change the key, or create a replacement file. A changed
request under the same key is a409 conflict. Requests without a key remain
distinct operations. files upload is streamed and does not support the key
or this journal recovery contract; media upload is also outside this scope.
Status is read-only. Reconcile verifies original staged bytes and may publish the
original database result; it never uploads bytes again. A published historical
receipt does not prove that file is still live. Current Memo edit authority and
the original actor are required; add the original --namespace for org memos.
An unconfirmed outcome stays unresolved:404 from storage, elapsed time and a
failed request do not establish that an upload cannot arrive later.
Cancel is available only while admitted, before upload authorization. It retains
the operation and key as aborted-before-write; it deletes no objects and cannot
cancel write-started or published work. A cancelled operation cannot be
replayed with the same key. Inspect after an uncertain cancellation response.
These commands do not transfer a Memo, grant access or complete storage recovery.
Preview and share
The default preview requires sign-in. HTML renders on a separate origin from the dashboard. To deliberately create or withdraw a public preview link:
A shared link opens without sign-in and does not expire. Revoking it withdraws all copies of that link. This is distinct from publishing the memo itself.
Next: Memos.
Header cover image
CLI and TypeScript 0.113.0 add an optional cover, separate from the memo body.
The title-image alias accepts the same arguments as cover.
Use only one of --file, --file-id and --remove. Supported images are PNG,
JPEG, GIF, WebP, AVIF and SVG. Uploads use a new attachment path; replacing or
removing the cover never deletes older files. If a metadata update is unconfirmed,
inspect the current cover and retained attachment before retrying.
Namespace SDK callers can use client.memos.namespace("team").setCover(memoId, fileId).
Upload bytes with the existing Memo files API first. The server checks metadata
permission and that the image belongs to this memo. Body content and RTC state
are unchanged.