messages · MachineMail Docs
Messages Commands
Send, receive, search and manage messages. Also spelled message, msg.
| Command | Summary |
|---|---|
messages attachment |
Get attachment |
messages batch-get |
Batch get messages |
messages batch-update |
Batch update messages |
messages delete |
Delete message |
messages download |
Download attachment |
messages forward |
Forward message |
messages get |
Get message |
messages list |
List messages |
messages raw |
Get raw message |
messages reply |
Reply to a message |
messages reply-all |
Reply to all recipients of a message |
messages search |
Search messages |
messages send |
Send message |
messages trust |
Get message trust report |
messages update |
Update message |
Messages Attachment
Get attachment.
Requires the message_read permission.
Shell Command
machinemail messages attachment <inbox-id> <message-id> <attachment-id> [flags]
Arguments
| Field | Description |
|---|---|
<inbox-id> |
string Required; ID of the inbox: its email address, as in AgentMail (inbox_id == email). |
<message-id> |
string Required; ID of the message. |
<attachment-id> |
string Required; ID of the attachment. |
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Only this pod. |
Examples
machinemail messages attachment agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w att_01m4fy8hb20000w3x6d9m4p8ke
machinemail messages attachment agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w att_01m4fy8hb20000w3x6d9m4p8ke --pod pod_01m4fykg210000x6z8b6wc2rdx
API
GET /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}GET /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}with--pod
Messages Batch-Get
Batch get messages.
Up to 100 messages by ID in one request, as full Message objects. Duplicate IDs are read once; IDs past the first 100 distinct ones are dropped. Missing IDs and IDs from other inboxes are omitted.
Requires the message_read permission.
Shell Command
machinemail messages batch-get <inbox-id> [flags]
Arguments
| Field | Description |
|---|---|
<inbox-id> |
string Required; ID of the inbox: its email address, as in AgentMail (inbox_id == email). |
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
--message-ids <id> |
string[]; IDs of the messages to fetch. Only the first 100 distinct IDs are read. |
| `-d, --data <json | @file |
Examples
machinemail messages batch-get agent@machinemail.dev --message-ids <message-ids>
machinemail messages batch-get agent@machinemail.dev --data @body.json
API
POST /v0/inboxes/{inbox_id}/messages/batch-getPOST /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/batch-getwith--pod
Messages Batch-Update
Batch update messages.
Apply one label change to up to 100 messages. Missing IDs are skipped.
Requires the message_update permission.
Shell Command
machinemail messages batch-update <inbox-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
--message-ids <id> |
string[]; IDs of the messages to update. |
--add-label <value> |
string[]; Label or labels to add. |
--remove-label <value> |
string[]; Label or labels to remove. |
| `-d, --data <json | @file |
Examples
machinemail messages batch-update agent@machinemail.dev --message-ids <message-ids>
machinemail messages batch-update agent@machinemail.dev --data @body.json
API
POST /v0/inboxes/{inbox_id}/messages/batch-updatePOST /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/batch-updatewith--pod
Messages Delete
Delete message.
Permanently deletes the message, its raw copy, and attachments.
Requires the message_delete permission.
Shell Command
machinemail messages delete <inbox-id> <message-id> [flags]
Arguments
| Field | Description |
|---|---|
<inbox-id> |
string Required; ID of the inbox: its email address, as in AgentMail (inbox_id == email). |
<message-id> |
string Required; ID of the message. |
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
Examples
machinemail messages delete agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w
API
DELETE /v0/inboxes/{inbox_id}/messages/{message_id}DELETE /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}with--pod
Messages Download
Download attachment.
Requires the message_read permission.
Shell Command
machinemail messages download <inbox-id> <message-id> <attachment-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Only this pod. |
--disposition |
`attachment |
| `-o, --output <file | dir |
Examples
machinemail messages download agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w att_01m4fy8hb20000w3x6d9m4p8ke > out.bin
API
GET /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}/downloadGET /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}/downloadwith--pod
Messages Forward
Forward message.
Requires the message_send permission.
Shell Command
machinemail messages forward <inbox-id> <message-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
--to <value> |
string[]; Recipient address. Repeat the flag for several values. |
--subject <value> |
string; Subject of the message. |
--text <value> |
string; Plain text body. |
--html <value> |
string; HTML body. |
| `-d, --data <json | @file |
Examples
machinemail messages forward agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w --to recipient@example.com
API
POST /v0/inboxes/{inbox_id}/messages/{message_id}/forwardPOST /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}/forwardwith--pod
Messages Get
Get message.
Requires the message_read permission.
Shell Command
machinemail messages get <inbox-id> <message-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Only this pod. |
Examples
machinemail messages get agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w
API
GET /v0/inboxes/{inbox_id}/messages/{message_id}GET /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}with--pod
Messages List
List messages.
Requires the message_read permission.
Shell Command
machinemail messages list <inbox-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Only this pod. |
--limit <n> |
integer; Maximum number of items to return. Default 50. |
--sort <value> |
string; Sort order. |
Examples
machinemail messages list agent@machinemail.dev --limit 20
API
Messages Raw
Get raw message.
Requires the message_read permission.
Shell Command
machinemail messages raw <inbox-id> <message-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Only this pod. |
Examples
machinemail messages raw agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w
API
GET /v0/inboxes/{inbox_id}/messages/{message_id}/rawGET /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}/rawwith--pod
Messages Reply
Reply to a message.
Requires the message_reply or message_send permission.
Shell Command
machinemail messages reply <inbox-id> <message-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
--to <value> |
string[]; Recipient address. Repeat the flag. |
--text <value> |
string; Plain text body. |
--html <value> |
string; HTML body. |
| `-d, --data <json | @file |
Examples
machinemail messages reply agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w --to sender@example.com
API
POST /v0/inboxes/{inbox_id}/messages/{message_id}/replyPOST /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}/replywith--pod
Messages Reply-All
Reply to all recipients of a message.
Requires the message_reply or message_send permission.
Shell Command
machinemail messages reply-all <inbox-id> <message-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
--to <value> |
string[]; More recipients. Repeat the flag. |
--text <value> |
string; Plain text body. |
--html <value> |
string; HTML body. |
| `-d, --data <json | @file |
Examples
machinemail messages reply-all agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w
API
POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply-allPOST /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}/reply-allwith--pod
Messages Search
Search messages.
Requires the message_read permission.
Shell Command
machinemail messages search <inbox-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Only this pod. |
--q <value> |
string Required; Words to find in the messages. |
--limit <n> |
integer; Maximum number of items to return. Default 50. |
Examples
machinemail messages search agent@machinemail.dev --q invoice
API
GET /v0/inboxes/{inbox_id}/messages/searchGET /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/searchwith--pod
Messages Send
Send message.
Requires the message_send permission.
Shell Command
machinemail messages send <inbox-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
--to <value> |
string[]; Recipient address or addresses. Repeat the flag for several values. |
--subject <value> |
string; Subject of the message. |
--text <value> |
string; Plain text body. |
--html <value> |
string; HTML body. |
| `-d, --data <json | @file |
Examples
machinemail messages send agent@machinemail.dev --to ada@example.com --subject "Hello" --text "It works."
API
POST /v0/inboxes/{inbox_id}/messages/sendPOST /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/sendwith--pod
Messages Trust
Get message trust report.
Requires the message_read permission.
Shell Command
machinemail messages trust <inbox-id> <message-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Only this pod. |
Examples
machinemail messages trust agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w
API
GET /v0/inboxes/{inbox_id}/messages/{message_id}/trustGET /v0/pods/{pod_id}/inboxes/{inbox_id}/messages/{message_id}/trustwith--pod
Messages Update
Update message.
Requires the message_update permission.
Shell Command
machinemail messages update <inbox-id> <message-id> [flags]
Flags
| Field | Description |
|---|---|
--pod <pod-id> |
string; Use this pod's scoped route. |
--add-label <value> |
string[]; Label or labels to add. |
--remove-label <value> |
string[]; Label or labels to remove. |
| `-d, --data <json | @file |
Examples
machinemail messages update agent@machinemail.dev msg_01m4fy8han0000y3ge3m73vw3w