New260+ blocks and 240+ tools are now fully documented
Tool

AgentMail

Send, reply, forward, and manage email threads with AgentMail inboxes

AgentMail is an email automation service that exposes programmatic inboxes via API. Use this integration to send new messages, reply to or forward existing messages, create scheduled drafts, and list or inspect email threads — all without leaving a Zelaxy workflow.

Overview

PropertyValue
Typeagentmail
CategoryTool — Email
AuthAPI Key (Bearer token, user-only visibility)

Operations

OperationTool IDDescription
Send Messageagentmail_send_messageCompose and send a new email from an AgentMail inbox
Reply to Messageagentmail_reply_messageReply to (or reply-all on) an existing message
Forward Messageagentmail_forward_messageForward an existing message to new recipients
List Threadsagentmail_list_threadsRetrieve a paginated list of email threads in an inbox
Get Threadagentmail_get_threadFetch full thread details including all messages
Create Draftagentmail_create_draftCreate a draft (optionally scheduled for later delivery)

Configuration

SettingTypeRequiredOperationsDescription
apiKeystringYes (all)AllAgentMail API key. Treated as a secret — use {{AGENTMAIL_API_KEY}}.
inboxIdstringYes (all)AllID of the AgentMail inbox to operate on.
tostringYes — Send, Forward; No — Reply, DraftSend Message, Reply to Message, Forward Message, Create DraftRecipient email addresses, comma-separated. For Reply, overrides the default reply-to address.
subjectstringYes — Send; No — Forward, DraftSend Message, Forward Message, Create DraftEmail subject line. For Forward, overrides the original subject.
textstringNoSend Message, Reply to Message, Forward Message, Create DraftPlain-text email body. For Forward/Reply, prepended before the original message.
htmlstringNoSend Message, Reply to Message, Forward Message, Create DraftHTML email body. For Forward/Reply, prepended before the original message.
ccstringNoSend Message, Reply to Message, Forward Message, Create DraftCC recipient email addresses, comma-separated.
bccstringNoSend Message, Reply to Message, Forward Message, Create DraftBCC recipient email addresses, comma-separated.
messageIdstringYesReply to Message, Forward MessageID of the existing message to reply to or forward.
replyAllbooleanNoReply to MessageWhen true, replies to all original recipients via the reply-all endpoint. to, cc, and bcc overrides are ignored when set.
threadIdstringYesGet ThreadID of the thread to retrieve.
inReplyTostringNoCreate DraftMessage ID this draft is in reply to (sets threading headers).
sendAtstringNoCreate DraftISO 8601 timestamp to schedule the draft for future delivery (e.g. 2025-07-01T09:00:00Z).
limitnumberNoList ThreadsMaximum number of threads to return per page.
pageTokenstringNoList ThreadsPagination token from a previous List Threads response to fetch the next page.
labelsstringNoList ThreadsComma-separated label names to filter threads (e.g. inbox,unread).
beforestringNoList ThreadsReturn only threads with a last-message timestamp before this ISO 8601 value.
afterstringNoList ThreadsReturn only threads with a last-message timestamp after this ISO 8601 value.

Outputs

Send Message

FieldTypeDescription
threadIdstringID of the newly created thread
messageIdstringID of the sent message
subjectstringSubject line of the sent email
tostringRecipient address(es) as provided

Reply to Message

FieldTypeDescription
messageIdstringID of the sent reply message
threadIdstringID of the thread the reply belongs to

Forward Message

FieldTypeDescription
messageIdstringID of the forwarded message
threadIdstringID of the thread

List Threads

FieldTypeDescription
threadsarrayArray of thread summary objects (see below)
countnumberTotal number of threads returned
nextPageTokenstringPagination token for the next page; null when no more pages

Thread summary object fields:

FieldTypeDescription
threadIdstringUnique identifier for the thread
subjectstringThread subject (may be null)
sendersarrayList of sender email addresses in the thread
recipientsarrayList of recipient email addresses in the thread
messageCountnumberNumber of messages in the thread
lastMessageAtstringTimestamp of the most recent message (ISO 8601, may be null)
createdAtstringThread creation timestamp (ISO 8601)
updatedAtstringLast-updated timestamp (ISO 8601)

Get Thread

FieldTypeDescription
threadIdstringUnique identifier for the thread
subjectstringThread subject (may be null)
sendersarrayList of sender email addresses
recipientsarrayList of recipient email addresses
messageCountnumberNumber of messages in the thread
labelsarrayLabels assigned to the thread
lastMessageAtstringTimestamp of last message (ISO 8601, may be null)
createdAtstringThread creation timestamp (ISO 8601)
updatedAtstringLast-updated timestamp (ISO 8601)
messagesarrayFull message objects (see below)

Message object fields (inside messages):

FieldTypeDescription
messageIdstringUnique identifier for the message
fromstringSender email address (may be null)
toarrayRecipient email addresses
ccarrayCC email addresses
bccarrayBCC email addresses
subjectstringMessage subject (may be null)
textstringPlain-text body (may be null)
htmlstringHTML body (may be null)
createdAtstringMessage creation timestamp (ISO 8601)

Create Draft

FieldTypeDescription
draftIdstringUnique identifier for the created draft
inboxIdstringInbox the draft belongs to
subjectstringDraft subject (may be null)
toarrayRecipient email addresses
ccarrayCC email addresses
bccarrayBCC email addresses
textstringPlain-text body (may be null)
htmlstringHTML body (may be null)
previewstringPreview snippet of the draft (may be null)
labelsarrayLabels assigned to the draft
inReplyTostringMessage ID this draft is in reply to (may be null)
sendStatusstringSend status: scheduled, sending, or failed (may be null)
sendAtstringScheduled send time (ISO 8601, may be null)
createdAtstringDraft creation timestamp (ISO 8601)
updatedAtstringLast-updated timestamp (ISO 8601)

Example

[Starter: Webhook] → [AgentMail: Get Thread] → [Agent: Summarize and draft reply] → [AgentMail: Create Draft]

When a webhook delivers an inbound email event with an inbox ID and thread ID, the Get Thread block (configured with {{AGENTMAIL_API_KEY}}, inboxId: {{starter.inboxId}}, threadId: {{starter.threadId}}) retrieves the full conversation. An Agent block reads {{agentmail.messages}} to summarize the thread and compose a response. The Create Draft block then saves that response with sendAt: {{agent.scheduledTime}} so the reply goes out at the right time rather than immediately.

Tips

  • apiKey is user-only visibility — always supply it via an environment variable reference like {{AGENTMAIL_API_KEY}} rather than hardcoding it in the block. The value is never forwarded to LLM context.
  • Comma-separated addressesto, cc, and bcc all accept multiple addresses as a single comma-separated string (e.g. alice@example.com, bob@example.com). The tool splits and trims them before sending to the API.
  • Reply vs Reply-All — the agentmail_reply_message tool routes to a different API endpoint (/reply-all) when replyAll is true. When using reply-all, any to, cc, or bcc overrides you provide are silently ignored by the tool.
  • Scheduled drafts — use agentmail_create_draft with a sendAt ISO 8601 timestamp to queue an email for future delivery. Check sendStatus in the output to confirm the draft reached scheduled state.
  • Pagination for large inboxesagentmail_list_threads returns a nextPageToken when more results exist. Feed it back as the pageToken param in a subsequent call inside a Loop block to walk through all threads.