AgentMail connects Sim workflows to email inboxes using an API key. Create inboxes, send and read messages, reply to or forward conversations, manage drafts, and apply labels to threads and messages. For review-before-send workflows, create a draft, update it with the reviewed content, then send it.
Create and manage email inboxes, send and receive messages, reply to threads, manage drafts, and organize threads with labels. Requires an API key.
Create a new email draft in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to create the draft in tostring No Recipient email addresses (comma-separated) subjectstring No Draft subject line textstring No Plain text draft body htmlstring No HTML draft body ccstring No CC recipient email addresses (comma-separated) bccstring No BCC recipient email addresses (comma-separated) inReplyTostring No ID of message being replied to sendAtstring No ISO 8601 timestamp to schedule sending
Parameter Type Description draftIdstring Unique identifier for the draft inboxIdstring Inbox the draft belongs to subjectstring Draft subject toarray Recipient email addresses ccarray CC email addresses bccarray BCC email addresses textstring Plain text content htmlstring HTML content previewstring Draft preview text labelsarray Labels assigned to the draft inReplyTostring Message ID this draft replies to sendStatusstring Send status (scheduled, sending, failed) sendAtstring Scheduled send time createdAtstring Creation timestamp updatedAtstring Last updated timestamp
Create a new email inbox with AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key usernamestring No Username for the inbox email address domainstring No Domain for the inbox email address displayNamestring No Display name for the inbox
Parameter Type Description inboxIdstring Unique identifier for the inbox emailstring Email address of the inbox displayNamestring Display name of the inbox createdAtstring Creation timestamp updatedAtstring Last updated timestamp
Delete an email draft in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the draft draftIdstring Yes ID of the draft to delete
Parameter Type Description deletedboolean Whether the draft was successfully deleted
Delete an email inbox in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to delete
Parameter Type Description deletedboolean Whether the inbox was successfully deleted
Delete an email thread in AgentMail (moves to trash, or permanently deletes if already in trash)
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the thread threadIdstring Yes ID of the thread to delete permanentboolean No Force permanent deletion instead of moving to trash
Parameter Type Description deletedboolean Whether the thread was successfully deleted
Forward an email message to new recipients in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the message messageIdstring Yes ID of the message to forward tostring Yes Recipient email addresses (comma-separated) subjectstring No Override subject line textstring No Additional plain text to prepend htmlstring No Additional HTML to prepend ccstring No CC recipient email addresses (comma-separated) bccstring No BCC recipient email addresses (comma-separated)
Parameter Type Description messageIdstring ID of the forwarded message threadIdstring ID of the thread
Get details of a specific email draft in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox the draft belongs to draftIdstring Yes ID of the draft to retrieve
Parameter Type Description draftIdstring Unique identifier for the draft inboxIdstring Inbox the draft belongs to subjectstring Draft subject toarray Recipient email addresses ccarray CC email addresses bccarray BCC email addresses textstring Plain text content htmlstring HTML content previewstring Draft preview text labelsarray Labels assigned to the draft inReplyTostring Message ID this draft replies to sendStatusstring Send status (scheduled, sending, failed) sendAtstring Scheduled send time createdAtstring Creation timestamp updatedAtstring Last updated timestamp
Get details of a specific email inbox in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to retrieve
Parameter Type Description inboxIdstring Unique identifier for the inbox emailstring Email address of the inbox displayNamestring Display name of the inbox createdAtstring Creation timestamp updatedAtstring Last updated timestamp
Get details of a specific email message in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the message messageIdstring Yes ID of the message to retrieve
Parameter Type Description messageIdstring Unique identifier for the message threadIdstring ID of the thread this message belongs to fromstring Sender email address toarray Recipient email addresses ccarray CC email addresses bccarray BCC email addresses subjectstring Message subject textstring Plain text content htmlstring HTML content labelsarray Labels assigned to the message timestampstring Time the message was sent or drafted createdAtstring Creation timestamp
Get details of a specific email thread including messages in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the thread threadIdstring Yes ID of the thread to retrieve
Parameter Type Description threadIdstring Unique identifier for the thread subjectstring Thread subject sendersarray List of sender email addresses recipientsarray List of recipient email addresses messageCountnumber Number of messages in the thread labelsarray Labels assigned to the thread lastMessageAtstring Timestamp of last message createdAtstring Creation timestamp updatedAtstring Last updated timestamp messagesarray Messages in the thread ↳ messageId string Unique identifier for the message ↳ from string Sender email address ↳ to array Recipient email addresses ↳ cc array CC email addresses ↳ bcc array BCC email addresses ↳ subject string Message subject ↳ text string Plain text content ↳ html string HTML content ↳ labels array Labels assigned to the message ↳ timestamp string Time the message was sent or drafted ↳ createdAt string Creation timestamp
List email drafts in an inbox in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to list drafts from limitnumber No Maximum number of drafts to return pageTokenstring No Pagination token for next page of results
Parameter Type Description draftsarray List of drafts ↳ draftId string Unique identifier for the draft ↳ inboxId string Inbox the draft belongs to ↳ subject string Draft subject ↳ to array Recipient email addresses ↳ cc array CC email addresses ↳ bcc array BCC email addresses ↳ preview string Draft preview text ↳ sendStatus string Send status (scheduled, sending, failed) ↳ sendAt string Scheduled send time ↳ createdAt string Creation timestamp ↳ updatedAt string Last updated timestamp countnumber Total number of drafts nextPageTokenstring Token for retrieving the next page
List all email inboxes in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key limitnumber No Maximum number of inboxes to return pageTokenstring No Pagination token for next page of results
Parameter Type Description inboxesarray List of inboxes ↳ inboxId string Unique identifier for the inbox ↳ email string Email address of the inbox ↳ displayName string Display name of the inbox ↳ createdAt string Creation timestamp ↳ updatedAt string Last updated timestamp countnumber Total number of inboxes nextPageTokenstring Token for retrieving the next page
List messages in an inbox in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to list messages from limitnumber No Maximum number of messages to return pageTokenstring No Pagination token for next page of results
Parameter Type Description messagesarray List of messages in the inbox ↳ messageId string Unique identifier for the message ↳ from string Sender email address ↳ to array Recipient email addresses ↳ subject string Message subject ↳ preview string Message preview text ↳ timestamp string Time the message was sent or drafted ↳ createdAt string Creation timestamp countnumber Total number of messages nextPageTokenstring Token for retrieving the next page
List email threads in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to list threads from limitnumber No Maximum number of threads to return pageTokenstring No Pagination token for next page of results labelsstring No Comma-separated labels to filter threads by beforestring No Filter threads before this ISO 8601 timestamp afterstring No Filter threads after this ISO 8601 timestamp
Parameter Type Description threadsarray List of email threads ↳ threadId string Unique identifier for the thread ↳ subject string Thread subject ↳ senders array List of sender email addresses ↳ recipients array List of recipient email addresses ↳ messageCount number Number of messages in the thread ↳ lastMessageAt string Timestamp of last message ↳ createdAt string Creation timestamp ↳ updatedAt string Last updated timestamp countnumber Total number of threads nextPageTokenstring Token for retrieving the next page
Reply to an existing email message in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to reply from messageIdstring Yes ID of the message to reply to textstring No Plain text reply body htmlstring No HTML reply body tostring No Override recipient email addresses (comma-separated) ccstring No CC email addresses (comma-separated) bccstring No BCC email addresses (comma-separated) replyAllboolean No Reply to all recipients of the original message
Parameter Type Description messageIdstring ID of the sent reply message threadIdstring ID of the thread
Send an existing email draft in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the draft draftIdstring Yes ID of the draft to send
Parameter Type Description messageIdstring ID of the sent message threadIdstring ID of the thread
Send an email message from an AgentMail inbox
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to send from tostring Yes Recipient email address (comma-separated for multiple) subjectstring Yes Email subject line textstring No Plain text email body htmlstring No HTML email body ccstring No CC recipient email addresses (comma-separated) bccstring No BCC recipient email addresses (comma-separated)
Parameter Type Description threadIdstring ID of the created thread messageIdstring ID of the sent message subjectstring Email subject line tostring Recipient email address
Update an existing email draft in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the draft draftIdstring Yes ID of the draft to update tostring No Recipient email addresses (comma-separated) subjectstring No Draft subject line textstring No Plain text draft body htmlstring No HTML draft body ccstring No CC recipient email addresses (comma-separated) bccstring No BCC recipient email addresses (comma-separated) sendAtstring No ISO 8601 timestamp to schedule sending
Parameter Type Description draftIdstring Unique identifier for the draft inboxIdstring Inbox the draft belongs to subjectstring Draft subject toarray Recipient email addresses ccarray CC email addresses bccarray BCC email addresses textstring Plain text content htmlstring HTML content previewstring Draft preview text labelsarray Labels assigned to the draft inReplyTostring Message ID this draft replies to sendStatusstring Send status (scheduled, sending, failed) sendAtstring Scheduled send time createdAtstring Creation timestamp updatedAtstring Last updated timestamp
Update the display name of an email inbox in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox to update displayNamestring Yes New display name for the inbox
Parameter Type Description inboxIdstring Unique identifier for the inbox emailstring Email address of the inbox displayNamestring Display name of the inbox createdAtstring Creation timestamp updatedAtstring Last updated timestamp
Add or remove labels on an email message in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the message messageIdstring Yes ID of the message to update addLabelsstring No Comma-separated labels to add to the message removeLabelsstring No Comma-separated labels to remove from the message
Parameter Type Description messageIdstring Unique identifier for the message labelsarray Current labels on the message
Add or remove labels on an email thread in AgentMail
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentMail API key inboxIdstring Yes ID of the inbox containing the thread threadIdstring Yes ID of the thread to update addLabelsstring No Comma-separated labels to add to the thread removeLabelsstring No Comma-separated labels to remove from the thread
Parameter Type Description threadIdstring Unique identifier for the thread labelsarray Current labels on the thread