CLI reference
The sendmock binary is also the client: every command talks to a running SendMock over HTTP. Each entry lists the arguments and flags, an example, the output and the same thing from the API and the MCP server (240 commands).
How commands take input
- Every command runs one REST operation. Its path parameters are arguments in
<>, and its body and query fields are flags:bounce_typeis--bounce-type. - Switches:
--readsetsis_readto true,--no-readto false. Lists repeat the flag in the singular:--tag signup --tag qa. Objects take JSON. - The whole body can come from
--dataor--file; flags override its keys. A field that may be null can be left out. - Commands never prompt. Destructive ones need
--yes, and--jsonis the default when the output is not a terminal, so scripts and agents read JSON.
Global flags
- --json
- Prints the answer as JSON; the default when the output is not a terminal.
- --server <url>
- The SendMock to talk to (
SENDMOCK_SERVER, defaulthttp://127.0.0.1:8025). - --token <token>
- The API token when auth is on (
SENDMOCK_TOKEN). - --data <json>
- The whole body as JSON; flags override its keys.
- --file <path>
- The whole body from a JSON or TOML file;
-reads stdin. - --help
- Prints the command's help with examples.
Exit codes
- 0
- Done.
- 1
- The request failed (invalid input, conflict, server error).
- 2
- Usage error: an unknown flag, a missing argument or a value outside the allowed ones.
- 3
- Not found.
- 4
- Timed out waiting.
- 5
- An assertion failed (scenarios).
Automation
sendmock ai installFor each AI agent, the install command and its MCP configuration.sendmock ai skillThe SendMock agent skill as Markdown.sendmock events tailThe latest events, newest first: the polling twin of the live stream.sendmock integrateCopy-ready settings for a stack, as Settings > Connection shows them.sendmock scenario runRun a scenario file step by step and report each step.sendmock scenario validateCheck a scenario file without running it.
sendmock email attachmentsDownload one attachment.sendmock email check htmlHTML and CSS support across email clients.sendmock email check linksCheck every link in the message.sendmock email check spamScore the message with the spam rules.sendmock email check unsubscribeList-Unsubscribe and one-click unsubscribe checks.sendmock email clickRecord a click on one of the email's links and fire email.clicked.sendmock email clicksEvery recorded click on the email's links, newest first.sendmock email deleteDelete one email.sendmock email delete-allDelete every email, or only those that match the filters.sendmock email forwardForward as the recipient; the copy arrives as inbound email.sendmock email inboundCreate an incoming email from fields or raw MIME; fires email.inbound.sendmock email latestThe newest email to a recipient.sendmock email listStored emails, newest first, with search and filters.sendmock email mimeThe MIME tree of the message.sendmock email mime-partDownload one MIME part, decoded, by its position in the MIME tree.sendmock email openRecord an open and fire email.opened.sendmock email opensEvery recorded open of the email, oldest first.sendmock email rawThe raw message source.sendmock email releaseSend the email on through the allowlisted relay.sendmock email replyReply as the recipient; the reply arrives as inbound email.sendmock email sendNative send: JSON with optional base64 attachments.sendmock email showOne email with bodies, headers, attachments and extracted codes.sendmock email simulateSimulate a delivery outcome such as a bounce or complaint.sendmock email thumbnailA preview image of an attachment.sendmock email timelineDelivery events: received, delivered, opened, bounced.sendmock email updateMark read or unread, or change tags.sendmock sendmailStore a raw message as sent by your app, as the sendmail shim does.
Forward rules
sendmock email forward-rules createAdd a forward rule at the end of the list.sendmock email forward-rules deleteDelete a forward rule.sendmock email forward-rules listEvery forward rule, in the order they run.sendmock email forward-rules moveMove a forward rule up or down.sendmock email forward-rules updateChange a forward rule, or switch it on or off.
Email providers
sendmock email providers createAdd an email provider, blank or copied from another.sendmock email providers credentialReveal one secret credential (asked for after a confirmation).sendmock email providers deleteRemove a built-in (restorable) or delete a custom provider; its messages stay.sendmock email providers listEmail providers, built in and custom, removed ones included.sendmock email providers previewRun a sample request through a definition: the message it would store and the answer it would give.sendmock email providers resetPut a built-in provider back as shipped.sendmock email providers restoreBring a removed built-in back as it was.sendmock email providers showOne provider definition; secret credentials masked.sendmock email providers updateChange a provider; 400 with the problems for template errors, bad paths or a path clash.
Tag rules
sendmock email tag-rules createAdd a tag rule at the end of the list.sendmock email tag-rules deleteDelete a tag rule.sendmock email tag-rules listEvery tag rule, in the order they run.sendmock email tag-rules moveMove a tag rule up or down.sendmock email tag-rules updateChange a tag rule, or switch it on or off.
Test helpers
sendmock email waitWait until a matching email arrives; 408 on timeout.sendmock http waitWait until the catcher records a matching request; 408 on timeout.sendmock linksThe links of the latest email to a recipient.sendmock otpThe latest one-time code sent to a recipient.sendmock payments waitWait until a payment reaches a status; 408 on timeout.sendmock sms waitWait until a matching SMS arrives; 408 on timeout.sendmock webhook deliveries waitWait until a matching delivery finishes; 408 on timeout.
System
sendmock healthLiveness check; answers while the server runs.sendmock resetDelete all traffic and restore the seed configuration.sendmock sampleCreate a sample email, SMS, verification or HTTP request through the normal path.sendmock settings getEvery runtime setting.sendmock settings setChange settings; send only the changed keys.sendmock statsCounts and rates shown on the Overview.sendmock statusVersion, listen addresses and enabled features.sendmock update checkWhether a newer release exists for this channel, with its notes and upgrade command.
HTTP Catcher
sendmock http bin createAdd a bin; 409 when the name is taken.sendmock http bin deleteDelete a bin and its requests.sendmock http bin listBins, each a capture URL with its own responses.sendmock http bin updateChange a bin's default response.sendmock http clearDelete captured requests, all or one bin's.sendmock http fileDownload a file uploaded in a captured request.sendmock http forwardSend a captured request on to another URL.sendmock http listCaptured requests, newest first.sendmock http response listA bin's response rules, checked from top to bottom.sendmock http response previewWhich rule a captured request would match, and its answer.sendmock http response setReplace a bin's response rules.sendmock http sendCapture a request in a bin and answer with its matching response rule or default response.sendmock http showOne captured request and what SendMock answered.
Logs
Numbers
sendmock numbers addAdd a number.sendmock numbers listFake numbers your app sends from, with their webhooks.sendmock numbers removeDelete a number.sendmock numbers updateChange a number.sendmock sms services createAdd a Messaging Service.sendmock sms services deleteDelete a Messaging Service.sendmock sms services listMessaging Services that pool numbers.sendmock sms services updateChange a Messaging Service.
Outcome rules
sendmock outcome-rule email createAdd an email outcome rule.sendmock outcome-rule email deleteDelete an email outcome rule.sendmock outcome-rule email listEmail outcome rules, checked from top to bottom.sendmock outcome-rule email moveMove an email outcome rule up or down.sendmock outcome-rule email testWhich custom rule, magic address or profile decides an address's outcome.sendmock outcome-rule email updateChange an email outcome rule; send only the changed keys.sendmock outcome-rule sms createAdd an SMS outcome rule.sendmock outcome-rule sms deleteDelete an SMS outcome rule.sendmock outcome-rule sms listSMS outcome rules, checked from top to bottom.sendmock outcome-rule sms moveMove an SMS outcome rule up or down.sendmock outcome-rule sms testWhich custom rule, magic number or profile decides a number's outcome.sendmock outcome-rule sms updateChange an SMS outcome rule; send only the changed keys.
Checkout
Payments
sendmock payments checkout createStart a hosted checkout on a gateway and get its payment page URL.sendmock payments createCreate a payment and pay it with a test card, as an app's server does without a checkout page.sendmock payments listTest payments, newest first, with filters.sendmock payments notifySend the payment's notification (IPN or webhook) again.sendmock payments showOne payment with line items, timeline, redirects and notifications.sendmock payments simulateMove the payment on: capture, refund, dispute, fail.sendmock payments subscriptions advanceMove the subscription's clock to its next renewal and charge it.sendmock payments subscriptions cancelCancel the subscription now or at the end of its period.sendmock payments subscriptions createStart a subscription on a gateway, with an optional trial.sendmock payments subscriptions listSubscriptions, newest first.sendmock payments subscriptions showOne subscription with its timeline and renewal payments.sendmock payments test-cardsThe test values of every enabled payment method.
Payment flows
sendmock payments flows createAdd a flow.sendmock payments flows deleteDelete a custom flow; 409 while a method uses it.sendmock payments flows listFlows: the steps a checkout page runs for a method.sendmock payments flows resetPut a built-in flow back as shipped.sendmock payments flows showOne payment flow with its steps.sendmock payments flows step-typesThe step types a flow can use, with their fields.sendmock payments flows steps addAdd a step to a flow.sendmock payments flows steps removeRemove one step of a flow.sendmock payments flows steps updateChange one step of a flow.sendmock payments flows updateChange a flow.sendmock payments flows variablesThe variables a step label can use.
Payment gateways
sendmock payments gateways createAdd a custom gateway.sendmock payments gateways credentialReveal one secret credential (asked for after a confirmation).sendmock payments gateways deleteDelete a custom gateway; 409 while payments use it.sendmock payments gateways listGateways with their checkout, redirect and notification setup.sendmock payments gateways previewRender a gateway's redirect and notification for a payment.sendmock payments gateways resetPut a built-in gateway back as shipped.sendmock payments gateways showOne gateway definition; secret credentials masked.sendmock payments gateways updateChange a gateway; secret credentials stay masked.
Payment methods
sendmock payments methods createAdd a custom method.sendmock payments methods deleteDelete a custom method; 409 while a gateway offers it.sendmock payments methods listMethods customers pay with, and their test values.sendmock payments methods resetPut a built-in method back as shipped.sendmock payments methods showOne payment method with its test values.sendmock payments methods updateChange a method.
Projects
sendmock projects createAdd a project that apps can send traffic to by its key.sendmock projects deleteDelete a project with its emails, SMS and verifications.sendmock projects listEvery project, default first, with the traffic each holds.sendmock projects updateRename a project; its key stays the same.
Push
sendmock push clearDelete every push notification, or one project's.sendmock push deleteDelete one push notification.sendmock push listPush notifications, newest first, with filters.sendmock push showOne push notification with its request and answer.sendmock push waitWait until a matching push notification arrives; 408 on timeout.
Inbound routes
sendmock route createAdd a route.sendmock route deleteDelete a route.sendmock route listRoutes for incoming email, in priority order.sendmock route matchWhere an incoming email would go: the routes and webhook rules it would run.sendmock route testWhich routes a recipient or header would match, and what runs.sendmock route updateChange a route.
Seed
SMS
sendmock sms deleteDelete one message.sendmock sms delete-allDelete every message.sendmock sms inboundSimulate a message from a contact to one of your numbers.sendmock sms listSMS and WhatsApp messages, newest first, with filters.sendmock sms mediaDownload one media item of an MMS or WhatsApp message.sendmock sms openRecord a read and fire sms.opened.sendmock sms opensEvery recorded read of an outbound message, oldest first.sendmock sms resend-reply-webhookSend an inbound message's reply webhook again.sendmock sms sendNative send, with optional media URLs or inline media.sendmock sms showOne message with its status history and callbacks.sendmock sms statusSet a delivery status by hand and fire its callback.sendmock sms threadsConversations, one per contact and your number.
SMS providers
sendmock sms providers createAdd an SMS provider, blank or copied from another.sendmock sms providers credentialReveal one secret credential (asked for after a confirmation).sendmock sms providers deleteRemove a built-in (restorable) or delete a custom provider; its messages stay.sendmock sms providers listSMS providers, built in and custom, removed ones included.sendmock sms providers previewRun a sample request through a definition: the message it would store and the answer it would give.sendmock sms providers resetPut a built-in provider back as shipped.sendmock sms providers restoreBring a removed built-in back as it was.sendmock sms providers showOne provider definition; secret credentials masked.sendmock sms providers updateChange a provider; 400 with the problems for template errors, bad paths or a path clash.sendmock sms whatsapp-cloud verify-webhookSend Meta's callback URL check to the app and report whether it answered the challenge.
Verify
sendmock verify forceForce an outcome: approved, expired, canceled or max attempts.sendmock verify listVerifications your app started, newest first.sendmock verify services createAdd a Verify service.sendmock verify services deleteDelete a Verify service.sendmock verify services listVerify services (code length, fixed code, lifetime).sendmock verify services updateChange a Verify service.sendmock verify showOne verification with its code, attempts and timeline.
Webhook deliveries
sendmock webhook deliveries cancelStop the remaining retries.sendmock webhook deliveries listEvery webhook request sent, newest first.sendmock webhook deliveries replaySend the delivery again, as it was or edited.sendmock webhook deliveries showOne delivery: request, response and every attempt.sendmock webhook metricsVolume, success rate, latency and failures over a range.
Webhook endpoints
sendmock webhook endpoint createAdd an endpoint; its signing secret is generated.sendmock webhook endpoint deleteDelete an endpoint and its rules.sendmock webhook endpoint listWhere webhooks go: URL, template, secret and retry policy.sendmock webhook endpoint rotate-secretNew signing secret; the old one keeps working for the overlap.sendmock webhook endpoint save-as-templateSave the endpoint's request as a custom template.sendmock webhook endpoint secretReveal the signing secret (asked for after a confirmation).sendmock webhook endpoint showOne endpoint; its secret masked.sendmock webhook endpoint testSend a test.ping delivery.sendmock webhook endpoint updateChange an endpoint; send only the changed keys.sendmock webhook renderRender an unsaved endpoint's request against a message.sendmock webhook sendSend a webhook for a chosen message or the sample, by hand.
Webhook rules
sendmock webhook rule createAdd a rule.sendmock webhook rule deleteDelete a rule.sendmock webhook rule listWhich events go to which endpoint, checked from top to bottom.sendmock webhook rule matchWhich webhooks an event would trigger, before an action fires it.sendmock webhook rule moveMove a rule up or down; answers the reordered list.sendmock webhook rule previewWhich recent messages an unsaved rule would match.sendmock webhook rule showOne webhook rule with its filter.sendmock webhook rule updateChange a rule; send only the changed keys.
Saved deliveries
sendmock webhook saved createSave a delivery's request under a name.sendmock webhook saved deleteDelete a saved delivery.sendmock webhook saved listBookmarked requests, kept through pruning and reset.sendmock webhook saved renameRename a saved delivery.sendmock webhook saved save-as-templateTurn a saved request into a custom template.sendmock webhook saved sendSend a saved request to its endpoint or another one.
Webhook templates
sendmock webhook template cloneCopy a template into a new custom one.sendmock webhook template createAdd a custom template, starting as native JSON.sendmock webhook template deleteDelete a custom template; 409 while endpoints use it.sendmock webhook template exportThe template as TOML (variable names, never values).sendmock webhook template historySaved revisions, newest first.sendmock webhook template importImport a template file; 409 when the id is taken.sendmock webhook template listBuilt-in and custom payload templates.sendmock webhook template referenceEvery value a template can read for the chosen events.sendmock webhook template renderRender against an email, an SMS or the sample, optionally a draft.sendmock webhook template resetPut an edited built-in template back as shipped.sendmock webhook template restoreRestore a revision as a new save.sendmock webhook template showOne template with its method, headers and body template.sendmock webhook template updateEdit a template; each save keeps a revision, 422 when it does not render.
Webhook variables
sendmock webhook var listGlobal and endpoint variables; secret values are masked.sendmock webhook var previewWhat a variable definition resolves to against the sample.sendmock webhook var regenerateMake a new fixed value for a generated-once random variable.sendmock webhook var setAdd a variable.sendmock webhook var unsetDelete a variable.sendmock webhook var updateChange a variable.