Preview: SendMock has no stable release yet. These docs follow develop.

API reference

Email

POST/api/v1/emails/inbound

Create an incoming email from fields or raw MIME; fires email.inbound.

CLI
sendmock email inbound
MCP tool
sendmock_email_inbound
In the app
Mail > Import .eml > Incoming to your app

Request body (application/json)

EmailInboundRequest : Body of POST /api/v1/emails/inbound: an incoming email from fields, or raw MIME in `raw`.

FieldTypeDescription
from?string
The sender, as an address or Name <address>.Example: Sam <[email protected]>
to?string[]
The recipients, usually your app's inbound address.
subject?string
The subject line.Example: Order arrived damaged
text?string
The plain-text body.Example: The box was crushed, can I get a replacement?
html?string
The HTML body.Example: <p>The box was crushed, can I get a replacement?</p>
raw?string
A whole message (RFC 5322); when set, the other fields are ignored.Example: From: [email protected] To: [email protected] Subject: Hi Hello
webhook_endpoint_ids?Ulid[]
Send this action's webhooks to exactly these endpoints (IDs from GET /api/v1/webhooks/endpoints) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
webhook_requests?WebhookRequestEdit[]
Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads.

Answer

201 NativeSendResult

Errors: 400, as { error: { code, message } }

Try it in Demo mode

GET/api/v1/emails/{emailId}

One email with bodies, headers, attachments and extracted codes.

CLI
sendmock email show <emailId>
MCP tool
sendmock_email_get
In the app
Mail > open email

Answer

200 EmailDetail

Errors: 404, as { error: { code, message } }

Try it in Demo mode

PATCH/api/v1/emails/{emailId}

Mark read or unread, or change tags.

CLI
sendmock email update <emailId>
MCP tool
sendmock_email_update
In the app
Mail > open email > Mark as read, tags

Request body (application/json)

EmailUpdate

FieldTypeDescription
is_read?boolean
Marks the email as read (true) or unread (false).Example: true
tags?string[]
Replaces the email's tags; an empty list removes them all.

Answer

200 EmailSummary

Errors: 404, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/emails/{emailId}/open

Record an open and fire email.opened.

CLI
sendmock email open <emailId>
MCP tool
sendmock_email_open
In the app
Mail > open email (opening it fires the open)

Request body (application/json)

OpenEventRequest : Body of `POST /emails/{emailId}/open` and `POST /sms/{smsId}/open`.

FieldTypeDescription
source?OpenSource
Who opened it: ui (the SendMock UI), manual (a person marking it) or api (a script). Defaults to api.One of: ui, manual, apiExample: api
user_agent?string
The browser or client that opened it, kept in the open history. The UI sends its own.Example: Mozilla/5.0 (Macintosh; Intel Mac OS X 14_5)
webhook_endpoint_ids?Ulid[]
Send this action's webhooks to exactly these endpoints (IDs from GET /api/v1/webhooks/endpoints) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
webhook_requests?WebhookRequestEdit[]
Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads.

Answer

204 No content

Errors: 404, as { error: { code, message } }

Try it in Demo mode

GET/api/v1/emails/{emailId}/opens

Every recorded open of the email, oldest first.

CLI
sendmock email opens <emailId>
MCP tool
sendmock_email_opens
In the app
Mail > open email > Timeline (opened entries)

Answer

200 OpenRecord[]

Errors: 404, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/emails/{emailId}/clicks

Record a click on one of the email's links and fire email.clicked.

CLI
sendmock email click <emailId>
MCP tool
sendmock_email_click
In the app
Mail > open email > click a link in the preview, or Simulate click

Request body (application/json)

EmailClickRequest : Body of `POST /emails/{emailId}/clicks`.

FieldTypeDescription
urlstring
The link that was clicked; one of the email's links (extracted.links).Example: https://app.test/verify?token=abc123
source?OpenSource
Who clicked it: ui (a link in the preview), manual (Simulate click) or api (a script). Defaults to api.One of: ui, manual, apiExample: api
user_agent?string
The browser or client that clicked, kept in the click history. The UI sends its own.Example: Mozilla/5.0 (Macintosh; Intel Mac OS X 14_5)
webhook_endpoint_ids?Ulid[]
Send this action's webhooks to exactly these endpoints (IDs from GET /api/v1/webhooks/endpoints) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
webhook_requests?WebhookRequestEdit[]
Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads.

Answer

204 No content

Errors: 404, 422, as { error: { code, message } }

Try it in Demo mode

GET/api/v1/emails/{emailId}/clicks

Every recorded click on the email's links, newest first.

CLI
sendmock email clicks <emailId>
MCP tool
sendmock_email_clicks
In the app
Mail > open email > Timeline (clicked entries)

Answer

200 EmailClickRecord[]

Errors: 404, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/emails/{emailId}/release

Send the email on through the allowlisted relay.

CLI
sendmock email release <emailId>
MCP tool
sendmock_email_release
In the app
Mail > open email > Release to real SMTP

Request body (application/json)

EmailReleaseRequest : Body of `POST /emails/{emailId}/release`; empty sends to the original recipients.

FieldTypeDescription
to?string[]
Who receives it on the real SMTP server; empty sends to the original recipients. Every address must match the release allowlist.

Answer

204 No content

Errors: 400, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/emails/{emailId}/simulate

Simulate a delivery outcome such as a bounce or complaint.

CLI
sendmock email simulate <emailId> <event>
MCP tool
sendmock_email_simulate
In the app
Mail > open email > Simulate

Request body (application/json)

SimulatedEmailOutcome

FieldTypeDescription
eventEmailDeliveryStatus
The delivery event to simulate; it is added to the timeline and fires its webhook.One of: delivered, deferred, bounced, complained, unsubscribedExample: bounced
bounce_type?"hard" | "soft"
For bounced only: a hard bounce (the address does not exist) or a soft one (try again later).One of: hard, softExample: hard
webhook_endpoint_ids?Ulid[]
Send this action's webhooks to exactly these endpoints (IDs from GET /api/v1/webhooks/endpoints) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
webhook_requests?WebhookRequestEdit[]
Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads.

Answer

204 No content

Errors: 404, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/emails/{emailId}/reply

Reply as the recipient; the reply arrives as inbound email.

CLI
sendmock email reply <emailId>
MCP tool
sendmock_email_reply
In the app
Mail > open email > Reply, Reply all

Request body (application/json)

EmailReplyRequest : Body of POST /api/v1/emails/{emailId}/reply (simulate the recipient replying).

FieldTypeDescription
body?string
The reply text, above the quoted original; empty or left out sends no text of its own.Example: Thanks, that fixed it!
from?string
Who replies; defaults to the original recipient.Example: [email protected]
subject?string
Defaults to Re: <original subject>.Example: Re: Ticket #318 updated
reply_all?boolean
Also sends to the other original recipients, in Cc.Example: false
include_original?boolean
Quotes the original below an "On ... wrote:" line (default true).Example: true
webhook_endpoint_ids?Ulid[]
Send this action's webhooks to exactly these endpoints (IDs from GET /api/v1/webhooks/endpoints) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
webhook_requests?WebhookRequestEdit[]
Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads.

Answer

201 EmailDetail

Errors: 400, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/emails/{emailId}/forward

Forward as the recipient; the copy arrives as inbound email.

CLI
sendmock email forward <emailId>
MCP tool
sendmock_email_forward
In the app
Mail > open email > Forward

Request body (application/json)

EmailForwardRequest : Body of POST /api/v1/emails/{emailId}/forward (simulate the recipient forwarding).

FieldTypeDescription
tostring
Where the email is forwarded, e.g. your app's inbound address.Example: [email protected]
body?string
A note above the forwarded message.Example: Can you look at this one?
from?string
Who forwards; defaults to the original recipient.Example: [email protected]
subject?string
Defaults to Fwd: <original subject>.Example: Fwd: Your invoice
include_original?boolean
Adds the original below a "Forwarded message" block (default true).Example: true
include_attachments?boolean
Forwards the original attachments too (default true).Example: true
webhook_endpoint_ids?Ulid[]
Send this action's webhooks to exactly these endpoints (IDs from GET /api/v1/webhooks/endpoints) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
webhook_requests?WebhookRequestEdit[]
Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads.

Answer

201 EmailDetail

Errors: 400, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/send

Native send: JSON with optional base64 attachments.

CLI
sendmock email send
MCP tool
sendmock_email_send
In the app
Settings > Connection > Send this request

Request body (application/json)

NativeSendRequest : Body of POST /api/v1/send (native HTTP send API).

FieldTypeDescription
fromstring
The sender, as an address or Name <address>.Example: Shop <[email protected]>
tostring[]
The recipients.
cc?string[]
Copy recipients.
bcc?string[]
Hidden copy recipients; stored with the email but not in its headers.
subjectstring
The subject line.Example: Your order #1042 has shipped
text?string
The plain-text body. Send text, html or both.Example: Hi Sam, your order is on its way.
html?string
The HTML body. Send text, html or both.Example: <p>Hi Sam, your order is <b>on its way</b>.</p>
headers?object
Extra headers, by name.
tags?string[]
Tags to file the email under in Mail.
attachments?NativeSendAttachment[]
Files to attach.

Answer

201 NativeSendResult

Errors: 400, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/send/raw

Store a raw message as sent by your app, as the sendmail shim does.

CLI
sendmock sendmail
MCP tool
sendmock_email_send_raw
In the app
Mail > Import .eml > Sent by your app

Request body (message/rfc822)

string

Answer

201 NativeSendResult

Errors: 400, as { error: { code, message } }

Try it in Demo mode