API reference
SendMock's REST API at http://127.0.0.1:8025: JSON in and out, snake_case fields, errors as { error: { code, message } } and paged lists with an opaque next_cursor. Generated from docs/api/openapi.yaml (244 operations). Download openapi.yaml, also attached to every release and served by the binary at /api/openapi.json.
Every operation has Try it in Demo mode: requests are answered in your browser by the same mock API as the live demo. The playground adds an event stream and multi-step scenarios.
System
- GET
/api/v1/healthLiveness check; answers while the server runs. - GET
/api/v1/infoVersion, listen addresses and enabled features. - GET
/api/v1/statsCounts and rates shown on the Overview. - GET
/api/v1/updatesWhether a newer release exists for this channel, with its notes and upgrade command. - GET
/api/v1/settingsEvery runtime setting. - PATCH
/api/v1/settingsChange settings; send only the changed keys. - POST
/api/v1/resetDelete all traffic and restore the seed configuration. - POST
/api/v1/samples/{kind}Create a sample email, SMS, verification or HTTP request through the normal path.
Seed
Logs
Test helpers
- GET
/api/v1/wait/emailWait until a matching email arrives; 408 on timeout. - GET
/api/v1/wait/smsWait until a matching SMS arrives; 408 on timeout. - GET
/api/v1/wait/httpWait until the catcher records a matching request; 408 on timeout. - GET
/api/v1/wait/webhookWait until a matching delivery finishes; 408 on timeout. - GET
/api/v1/wait/paymentWait until a payment reaches a status; 408 on timeout. - GET
/api/v1/otpThe latest one-time code sent to a recipient. - GET
/api/v1/linksThe links of the latest email to a recipient.
Automation
- GET
/api/v1/events/recentThe latest events, newest first: the polling twin of the live stream. - GET
/api/v1/integrations/{stack}Copy-ready settings for a stack, as Settings > Connection shows them. - POST
/api/v1/scenarios/validateCheck a scenario file without running it. - POST
/api/v1/scenarios/runRun a scenario file step by step and report each step. - GET
/api/v1/ai/agentsFor each AI agent, the install command and its MCP configuration. - GET
/api/v1/ai/skillThe SendMock agent skill as Markdown.
- GET
/api/v1/emailsStored emails, newest first, with search and filters. - DELETE
/api/v1/emailsDelete every email, or only those that match the filters. - GET
/api/v1/emails/latestThe newest email to a recipient. - POST
/api/v1/emails/inboundCreate an incoming email from fields or raw MIME; fires email.inbound. - GET
/api/v1/emails/{emailId}One email with bodies, headers, attachments and extracted codes. - PATCH
/api/v1/emails/{emailId}Mark read or unread, or change tags. - DELETE
/api/v1/emails/{emailId}Delete one email. - GET
/api/v1/emails/{emailId}/timelineDelivery events: received, delivered, opened, bounced. - GET
/api/v1/emails/{emailId}/html-checkHTML and CSS support across email clients. - GET
/api/v1/emails/{emailId}/list-unsubscribeList-Unsubscribe and one-click unsubscribe checks. - GET
/api/v1/emails/{emailId}/mimeThe MIME tree of the message. - GET
/api/v1/emails/{emailId}/mime/{partId}Download one MIME part, decoded, by its position in the MIME tree. - GET
/api/v1/emails/{emailId}/rawThe raw message source. - GET
/api/v1/emails/{emailId}/attachments/{attachmentIndex}Download one attachment. - GET
/api/v1/emails/{emailId}/parts/{attachmentIndex}/thumbnailA preview image of an attachment. - POST
/api/v1/emails/{emailId}/link-checkCheck every link in the message. - POST
/api/v1/emails/{emailId}/spam-checkScore the message with the spam rules. - POST
/api/v1/emails/{emailId}/openRecord an open and fire email.opened. - GET
/api/v1/emails/{emailId}/opensEvery recorded open of the email, oldest first. - POST
/api/v1/emails/{emailId}/clicksRecord a click on one of the email's links and fire email.clicked. - GET
/api/v1/emails/{emailId}/clicksEvery recorded click on the email's links, newest first. - POST
/api/v1/emails/{emailId}/releaseSend the email on through the allowlisted relay. - POST
/api/v1/emails/{emailId}/simulateSimulate a delivery outcome such as a bounce or complaint. - POST
/api/v1/emails/{emailId}/replyReply as the recipient; the reply arrives as inbound email. - POST
/api/v1/emails/{emailId}/forwardForward as the recipient; the copy arrives as inbound email. - POST
/api/v1/sendNative send: JSON with optional base64 attachments. - POST
/api/v1/send/rawStore a raw message as sent by your app, as the sendmail shim does.
Inbound routes
- GET
/api/v1/inbound-routesRoutes for incoming email, in priority order. - POST
/api/v1/inbound-routesAdd a route. - PATCH
/api/v1/inbound-routes/{routeId}Change a route. - DELETE
/api/v1/inbound-routes/{routeId}Delete a route. - POST
/api/v1/inbound-routes/testWhich routes a recipient or header would match, and what runs. - POST
/api/v1/inbound-routes/matchWhere an incoming email would go: the routes and webhook rules it would run.
Tag rules
- GET
/api/v1/tag-rulesEvery tag rule, in the order they run. - POST
/api/v1/tag-rulesAdd a tag rule at the end of the list. - PATCH
/api/v1/tag-rules/{ruleId}Change a tag rule, or switch it on or off. - DELETE
/api/v1/tag-rules/{ruleId}Delete a tag rule. - POST
/api/v1/tag-rules/{ruleId}/moveMove a tag rule up or down.
Forward rules
- GET
/api/v1/forward-rulesEvery forward rule, in the order they run. - POST
/api/v1/forward-rulesAdd a forward rule at the end of the list. - PATCH
/api/v1/forward-rules/{ruleId}Change a forward rule, or switch it on or off. - DELETE
/api/v1/forward-rules/{ruleId}Delete a forward rule. - POST
/api/v1/forward-rules/{ruleId}/moveMove a forward rule up or down.
SMS
- GET
/api/v1/smsSMS and WhatsApp messages, newest first, with filters. - DELETE
/api/v1/smsDelete every message. - POST
/api/v1/smsNative send, with optional media URLs or inline media. - GET
/api/v1/sms/threadsConversations, one per contact and your number. - GET
/api/v1/sms/{smsId}One message with its status history and callbacks. - DELETE
/api/v1/sms/{smsId}Delete one message. - GET
/api/v1/sms/{smsId}/media/{mediaIndex}Download one media item of an MMS or WhatsApp message. - POST
/api/v1/sms/{smsId}/openRecord a read and fire sms.opened. - GET
/api/v1/sms/{smsId}/opensEvery recorded read of an outbound message, oldest first. - POST
/api/v1/sms/{smsId}/reply-webhook/resendSend an inbound message's reply webhook again. - POST
/api/v1/sms/{smsId}/statusSet a delivery status by hand and fire its callback. - POST
/api/v1/sms/inboundSimulate a message from a contact to one of your numbers.
Outcome rules
- GET
/api/v1/outcome-rules/emailEmail outcome rules, checked from top to bottom. - POST
/api/v1/outcome-rules/emailAdd an email outcome rule. - PATCH
/api/v1/outcome-rules/email/{ruleId}Change an email outcome rule; send only the changed keys. - DELETE
/api/v1/outcome-rules/email/{ruleId}Delete an email outcome rule. - POST
/api/v1/outcome-rules/email/{ruleId}/moveMove an email outcome rule up or down. - GET
/api/v1/outcome-rules/smsSMS outcome rules, checked from top to bottom. - POST
/api/v1/outcome-rules/smsAdd an SMS outcome rule. - PATCH
/api/v1/outcome-rules/sms/{ruleId}Change an SMS outcome rule; send only the changed keys. - DELETE
/api/v1/outcome-rules/sms/{ruleId}Delete an SMS outcome rule. - POST
/api/v1/outcome-rules/sms/{ruleId}/moveMove an SMS outcome rule up or down. - POST
/api/v1/outcome-rules/email/testWhich custom rule, magic address or profile decides an address's outcome. - POST
/api/v1/outcome-rules/sms/testWhich custom rule, magic number or profile decides a number's outcome.
Verify
- GET
/api/v1/verifyVerifications your app started, newest first. - GET
/api/v1/verify/{verificationSid}One verification with its code, attempts and timeline. - POST
/api/v1/verify/{verificationSid}/forceForce an outcome: approved, expired, canceled or max attempts. - GET
/api/v1/verify/servicesVerify services (code length, fixed code, lifetime). - POST
/api/v1/verify/servicesAdd a Verify service. - PATCH
/api/v1/verify/services/{serviceSid}Change a Verify service. - DELETE
/api/v1/verify/services/{serviceSid}Delete a Verify service.
Numbers
- GET
/api/v1/numbersFake numbers your app sends from, with their webhooks. - POST
/api/v1/numbersAdd a number. - PATCH
/api/v1/numbers/{numberId}Change a number. - DELETE
/api/v1/numbers/{numberId}Delete a number. - GET
/api/v1/messaging-servicesMessaging Services that pool numbers. - POST
/api/v1/messaging-servicesAdd a Messaging Service. - PATCH
/api/v1/messaging-services/{serviceSid}Change a Messaging Service. - DELETE
/api/v1/messaging-services/{serviceSid}Delete a Messaging Service.
Email providers
- GET
/api/v1/emails/providersEmail providers, built in and custom, removed ones included. - POST
/api/v1/emails/providersAdd an email provider, blank or copied from another. - GET
/api/v1/emails/providers/{providerKey}One provider definition; secret credentials masked. - PATCH
/api/v1/emails/providers/{providerKey}Change a provider; 400 with the problems for template errors, bad paths or a path clash. - DELETE
/api/v1/emails/providers/{providerKey}Remove a built-in (restorable) or delete a custom provider; its messages stay. - POST
/api/v1/emails/providers/{providerKey}/restoreBring a removed built-in back as it was. - POST
/api/v1/emails/providers/{providerKey}/resetPut a built-in provider back as shipped. - POST
/api/v1/emails/providers/{providerKey}/previewRun a sample request through a definition: the message it would store and the answer it would give. - GET
/api/v1/emails/providers/{providerKey}/credentials/{credentialName}Reveal one secret credential (asked for after a confirmation).
SMS providers
- GET
/api/v1/sms/providersSMS providers, built in and custom, removed ones included. - POST
/api/v1/sms/providersAdd an SMS provider, blank or copied from another. - GET
/api/v1/sms/providers/{providerKey}One provider definition; secret credentials masked. - PATCH
/api/v1/sms/providers/{providerKey}Change a provider; 400 with the problems for template errors, bad paths or a path clash. - DELETE
/api/v1/sms/providers/{providerKey}Remove a built-in (restorable) or delete a custom provider; its messages stay. - POST
/api/v1/sms/providers/{providerKey}/restoreBring a removed built-in back as it was. - POST
/api/v1/sms/providers/{providerKey}/resetPut a built-in provider back as shipped. - POST
/api/v1/sms/providers/{providerKey}/previewRun a sample request through a definition: the message it would store and the answer it would give. - GET
/api/v1/sms/providers/{providerKey}/credentials/{credentialName}Reveal one secret credential (asked for after a confirmation). - POST
/api/v1/sms/whatsapp-cloud/verify-webhookSend Meta's callback URL check to the app and report whether it answered the challenge.
HTTP Catcher
- GET
/api/v1/http/binsBins, each a capture URL with its own responses. - POST
/api/v1/http/binsAdd a bin; 409 when the name is taken. - PATCH
/api/v1/http/bins/{binId}Change a bin's default response. - DELETE
/api/v1/http/bins/{binId}Delete a bin and its requests. - GET
/api/v1/http/bins/{binId}/responsesA bin's response rules, checked from top to bottom. - PUT
/api/v1/http/bins/{binId}/responsesReplace a bin's response rules. - POST
/api/v1/http/bins/{binId}/responses/previewWhich rule a captured request would match, and its answer. - GET
/api/v1/http/requestsCaptured requests, newest first. - DELETE
/api/v1/http/requestsDelete captured requests, all or one bin's. - GET
/api/v1/http/requests/{requestId}One captured request and what SendMock answered. - GET
/api/v1/http/requests/{requestId}/files/{fileIndex}Download a file uploaded in a captured request. - POST
/api/v1/http/requests/{requestId}/forwardSend a captured request on to another URL. - GET
/catch/{binPath}Capture a request in a bin and answer with its matching response rule or default response. - POST
/catch/{binPath}Capture a request in a bin and answer with its matching response rule or default response. - PUT
/catch/{binPath}Capture a request in a bin and answer with its matching response rule or default response. - PATCH
/catch/{binPath}Capture a request in a bin and answer with its matching response rule or default response. - DELETE
/catch/{binPath}Capture a request in a bin and answer with its matching response rule or default response.
Payments
- GET
/api/v1/paymentsTest payments, newest first, with filters. - POST
/api/v1/paymentsCreate a payment and pay it with a test card, as an app's server does without a checkout page. - GET
/api/v1/payments/test-cardsThe test values of every enabled payment method. - GET
/api/v1/payments/{paymentId}One payment with line items, timeline, redirects and notifications. - POST
/api/v1/payments/{paymentId}/notifySend the payment's notification (IPN or webhook) again. - POST
/api/v1/payments/{paymentId}/simulateMove the payment on: capture, refund, dispute, fail. - POST
/api/v1/payments/checkoutStart a hosted checkout on a gateway and get its payment page URL. - GET
/api/v1/payments/subscriptionsSubscriptions, newest first. - POST
/api/v1/payments/subscriptionsStart a subscription on a gateway, with an optional trial. - GET
/api/v1/payments/subscriptions/{subscriptionId}One subscription with its timeline and renewal payments. - POST
/api/v1/payments/subscriptions/{subscriptionId}/advanceMove the subscription's clock to its next renewal and charge it. - POST
/api/v1/payments/subscriptions/{subscriptionId}/cancelCancel the subscription now or at the end of its period.
Checkout
Payment flows
- GET
/api/v1/payments/flowsFlows: the steps a checkout page runs for a method. - POST
/api/v1/payments/flowsAdd a flow. - GET
/api/v1/payments/flows/{flowKey}One payment flow with its steps. - PATCH
/api/v1/payments/flows/{flowKey}Change a flow. - DELETE
/api/v1/payments/flows/{flowKey}Delete a custom flow; 409 while a method uses it. - POST
/api/v1/payments/flows/{flowKey}/resetPut a built-in flow back as shipped. - POST
/api/v1/payments/flows/{flowKey}/stepsAdd a step to a flow. - PATCH
/api/v1/payments/flows/{flowKey}/steps/{stepIndex}Change one step of a flow. - DELETE
/api/v1/payments/flows/{flowKey}/steps/{stepIndex}Remove one step of a flow. - GET
/api/v1/payments/step-typesThe step types a flow can use, with their fields. - GET
/api/v1/payments/flow-variablesThe variables a step label can use.
Payment gateways
- GET
/api/v1/payments/gatewaysGateways with their checkout, redirect and notification setup. - POST
/api/v1/payments/gatewaysAdd a custom gateway. - GET
/api/v1/payments/gateways/{gatewayKey}One gateway definition; secret credentials masked. - PATCH
/api/v1/payments/gateways/{gatewayKey}Change a gateway; secret credentials stay masked. - DELETE
/api/v1/payments/gateways/{gatewayKey}Delete a custom gateway; 409 while payments use it. - POST
/api/v1/payments/gateways/{gatewayKey}/resetPut a built-in gateway back as shipped. - POST
/api/v1/payments/gateways/{gatewayKey}/previewRender a gateway's redirect and notification for a payment. - GET
/api/v1/payments/gateways/{gatewayKey}/credentials/{credentialName}Reveal one secret credential (asked for after a confirmation).
Payment methods
- GET
/api/v1/payments/methodsMethods customers pay with, and their test values. - POST
/api/v1/payments/methodsAdd a custom method. - GET
/api/v1/payments/methods/{methodKey}One payment method with its test values. - PATCH
/api/v1/payments/methods/{methodKey}Change a method. - DELETE
/api/v1/payments/methods/{methodKey}Delete a custom method; 409 while a gateway offers it. - POST
/api/v1/payments/methods/{methodKey}/resetPut a built-in method back as shipped.
Webhook endpoints
- GET
/api/v1/webhooks/endpointsWhere webhooks go: URL, template, secret and retry policy. - POST
/api/v1/webhooks/endpointsAdd an endpoint; its signing secret is generated. - GET
/api/v1/webhooks/endpoints/{endpointId}One endpoint; its secret masked. - PATCH
/api/v1/webhooks/endpoints/{endpointId}Change an endpoint; send only the changed keys. - DELETE
/api/v1/webhooks/endpoints/{endpointId}Delete an endpoint and its rules. - POST
/api/v1/webhooks/endpoints/previewRender an unsaved endpoint's request against a message. - GET
/api/v1/webhooks/endpoints/{endpointId}/secretReveal the signing secret (asked for after a confirmation). - POST
/api/v1/webhooks/endpoints/{endpointId}/rotate-secretNew signing secret; the old one keeps working for the overlap. - POST
/api/v1/webhooks/endpoints/{endpointId}/save-as-templateSave the endpoint's request as a custom template. - POST
/api/v1/webhooks/endpoints/{endpointId}/sendSend a webhook for a chosen message or the sample, by hand. - POST
/api/v1/webhooks/endpoints/{endpointId}/testSend a test.ping delivery.
Webhook rules
- GET
/api/v1/webhooks/rulesWhich events go to which endpoint, checked from top to bottom. - POST
/api/v1/webhooks/rulesAdd a rule. - GET
/api/v1/webhooks/rules/{ruleId}One webhook rule with its filter. - PATCH
/api/v1/webhooks/rules/{ruleId}Change a rule; send only the changed keys. - DELETE
/api/v1/webhooks/rules/{ruleId}Delete a rule. - POST
/api/v1/webhooks/rules/{ruleId}/moveMove a rule up or down; answers the reordered list. - POST
/api/v1/webhooks/rules/previewWhich recent messages an unsaved rule would match. - POST
/api/v1/webhooks/rules/matchWhich webhooks an event would trigger, before an action fires it.
Webhook deliveries
- GET
/api/v1/webhooks/deliveriesEvery webhook request sent, newest first. - GET
/api/v1/webhooks/deliveries/{deliveryId}One delivery: request, response and every attempt. - POST
/api/v1/webhooks/deliveries/{deliveryId}/cancelStop the remaining retries. - POST
/api/v1/webhooks/deliveries/{deliveryId}/replaySend the delivery again, as it was or edited. - GET
/api/v1/webhooks/metricsVolume, success rate, latency and failures over a range.
Saved deliveries
- GET
/api/v1/webhooks/savedBookmarked requests, kept through pruning and reset. - POST
/api/v1/webhooks/savedSave a delivery's request under a name. - PATCH
/api/v1/webhooks/saved/{savedId}Rename a saved delivery. - DELETE
/api/v1/webhooks/saved/{savedId}Delete a saved delivery. - POST
/api/v1/webhooks/saved/{savedId}/sendSend a saved request to its endpoint or another one. - POST
/api/v1/webhooks/saved/{savedId}/templateTurn a saved request into a custom template.
Webhook templates
- GET
/api/v1/webhooks/templatesBuilt-in and custom payload templates. - POST
/api/v1/webhooks/templatesAdd a custom template, starting as native JSON. - GET
/api/v1/webhooks/templates/{templateId}One template with its method, headers and body template. - PATCH
/api/v1/webhooks/templates/{templateId}Edit a template; each save keeps a revision, 422 when it does not render. - DELETE
/api/v1/webhooks/templates/{templateId}Delete a custom template; 409 while endpoints use it. - POST
/api/v1/webhooks/templates/importImport a template file; 409 when the id is taken. - GET
/api/v1/webhooks/templates/{templateId}/exportThe template as TOML (variable names, never values). - GET
/api/v1/webhooks/templates/{templateId}/revisionsSaved revisions, newest first. - POST
/api/v1/webhooks/templates/{templateId}/revisions/{revision}/restoreRestore a revision as a new save. - POST
/api/v1/webhooks/templates/{templateId}/renderRender against an email, an SMS or the sample, optionally a draft. - POST
/api/v1/webhooks/templates/{templateId}/resetPut an edited built-in template back as shipped. - POST
/api/v1/webhooks/templates/{templateId}/cloneCopy a template into a new custom one. - GET
/api/v1/webhooks/template-referenceEvery value a template can read for the chosen events.
Webhook variables
- GET
/api/v1/webhooks/variablesGlobal and endpoint variables; secret values are masked. - POST
/api/v1/webhooks/variablesAdd a variable. - PATCH
/api/v1/webhooks/variables/{variableId}Change a variable. - DELETE
/api/v1/webhooks/variables/{variableId}Delete a variable. - POST
/api/v1/webhooks/variables/{variableId}/regenerateMake a new fixed value for a generated-once random variable. - POST
/api/v1/webhooks/variables/previewWhat a variable definition resolves to against the sample.
Projects
- GET
/api/v1/projectsEvery project, default first, with the traffic each holds. - POST
/api/v1/projectsAdd a project that apps can send traffic to by its key. - PATCH
/api/v1/projects/{projectKey}Rename a project; its key stays the same. - DELETE
/api/v1/projects/{projectKey}Delete a project with its emails, SMS and verifications.
Push
- GET
/api/v1/pushPush notifications, newest first, with filters. - DELETE
/api/v1/pushDelete every push notification, or one project's. - GET
/api/v1/push/{pushId}One push notification with its request and answer. - DELETE
/api/v1/push/{pushId}Delete one push notification. - GET
/api/v1/wait/pushWait until a matching push notification arrives; 408 on timeout.