MOLTED EMAIL
CLI Reference

molted attachments

Manage email attachments

CommandDescription
molted attachments uploadUpload an attachment
molted attachments listList attachments for a message
molted attachments downloadDownload an attachment (without --output, prints a signed download URL)

Agent context

Attachments let you upload files and include them in outbound emails. Files are uploaded first, then referenced by ID when sending.

Upload a file

molted attachments upload ./invoice.pdf
# → { "id": "<uuid>", "filename": "invoice.pdf", "contentType": "application/pdf",
#     "contentTypeDeclared": null, "sizeBytes": 48213, "checksumSha256": "...", "status": "uploaded" }

molted attachments upload ./logo.png --mailbox <id>
# → stores it against that mailbox (a mailbox-scoped key needs send on it)

Include in a send

molted send --to alice@example.com --template _default \
  --dedupe-key "invoice-alice-1" \
  --payload '{"subject": "Your Invoice", "html": "See attached."}' \
  --attachments '[{"id": "<attachment-id>"}]'

List attachments on a message

molted attachments list --message-id <id> --message-type inbound
molted attachments list --message-id <id> --message-type thread
# → [{ "id", "filename", "contentType", "sizeBytes", "status", "createdAt" }]

Download an attachment

molted attachments download <id> --output ./downloaded.pdf
# → { "saved": "./downloaded.pdf", "size": 48213 }
molted attachments download <id>
# → without --output, prints { "url", "expiresInSeconds", "filename",
#   "contentType", "sizeBytes", "status" }: a signed URL valid for 1 hour

Uploads: at most 10 MB per file. The CLI sets the content type from the file extension (.pdf, .png, .jpg, .jpeg, .gif, .svg, .txt, .csv, .html, .json, .xml, .zip, .doc, .docx, .xls, .xlsx; anything else is sent as application/octet-stream), and the server re-detects it from the file's bytes (contentTypeDeclared shows the CLI's value when they differ). Executable and script extensions (.exe, .bat, .js, .ps1, .dll and similar) are refused.

Related: molted send, molted threads

Commands

molted attachments upload

Upload an attachment

molted attachments upload [options] <file>
ArgumentDescriptionRequired
<file>yes
OptionDescriptionDefault
--mailbox <id>Mailbox ID

molted attachments list

List attachments for a message

molted attachments list [options]
OptionDescriptionDefault
--message-id <id>Message ID (required) (required)
--message-type <type>Message type (inbound|thread) (required) (required)

molted attachments download

Download an attachment (without --output, prints a signed download URL)

molted attachments download [options] <id>
ArgumentDescriptionRequired
<id>yes
OptionDescriptionDefault
--output <file>Save the file to this path

See CLI overview for global options, credentials and output format.