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

API reference

Outcome rules

POST/api/v1/outcome-rules/email

Add an email outcome rule.

CLI
sendmock outcome-rule email create
MCP tool
sendmock_outcome_rule_create
In the app
Settings > Email > Custom outcome addresses > Add address

Request body (application/json)

EmailOutcomeRuleInput : Body of POST and PATCH /api/v1/outcome-rules/email.

FieldTypeDescription
patternstring
Exact address, or * wildcards, e.g. *@bounce.qa.test.Example: *@bounce.qa.test
outcomeEmailOutcomeKind
What happens to a matching email: delivered, hard_bounce, soft_bounce, complaint, unsubscribe or reject (refused during SMTP RCPT and the HTTP send).One of: delivered, hard_bounce, soft_bounce, complaint, unsubscribe, rejectExample: hard_bounce
smtp_codestring | null
SMTP reply for bounces and rejects, e.g. 550 5.1.1.Example: 550 5.1.1
diagnosticstring | null
The diagnostic text sent with the SMTP code.Example: user unknown
notestring
Why the rule exists, shown in the list.Example: Bounce every QA signup
is_enabledboolean
Off rules are kept but skipped.Example: true

Answer

201 EmailOutcomeRule

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

Try it in Demo mode

PATCH/api/v1/outcome-rules/email/{ruleId}

Change an email outcome rule; send only the changed keys.

CLI
sendmock outcome-rule email update <ruleId>
MCP tool
sendmock_outcome_rule_update
In the app
Settings > Email > Custom outcome addresses > Edit, enabled switch

Request body (application/json)

EmailOutcomeRuleInputPatch

FieldTypeDescription
pattern?string
Exact address, or * wildcards, e.g. *@bounce.qa.test.Example: *@bounce.qa.test
outcome?EmailOutcomeKind
What happens to a matching email: delivered, hard_bounce, soft_bounce, complaint, unsubscribe or reject (refused during SMTP RCPT and the HTTP send).One of: delivered, hard_bounce, soft_bounce, complaint, unsubscribe, rejectExample: hard_bounce
smtp_code?string | null
SMTP reply for bounces and rejects, e.g. 550 5.1.1.Example: 550 5.1.1
diagnostic?string | null
The diagnostic text sent with the SMTP code.Example: user unknown
note?string
Why the rule exists, shown in the list.Example: Bounce every QA signup
is_enabled?boolean
Off rules are kept but skipped.Example: true

Answer

200 EmailOutcomeRule

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

Try it in Demo mode

POST/api/v1/outcome-rules/email/{ruleId}/move

Move an email outcome rule up or down.

CLI
sendmock outcome-rule email move <ruleId>
MCP tool
sendmock_outcome_rule_move
In the app
Settings > Email > Custom outcome addresses > Move up, Move down

Request body (application/json)

OutcomeRuleMove : Body of POST /api/v1/outcome-rules/{kind}/{ruleId}/move.

FieldTypeDescription
direction"up" | "down"
up moves the rule one place earlier in the order, down one place later.One of: up, downExample: up

Answer

200 EmailOutcomeRule[]

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

Try it in Demo mode

POST/api/v1/outcome-rules/sms

Add an SMS outcome rule.

CLI
sendmock outcome-rule sms create
MCP tool
sendmock_outcome_rule_create
In the app
Settings > SMS > Custom outcome numbers > Add number

Request body (application/json)

SmsOutcomeRuleInput : Body of POST and PATCH /api/v1/outcome-rules/sms.

FieldTypeDescription
match_field"to" | "from"
Match the pattern against the recipient (to) or the sender (from).One of: to, fromExample: to
patternstring
Exact E.164 number, or * for any digits, e.g. +1555777*.Example: +1555777*
outcomeSmsOutcomeKind
What happens to a matching message: reject (the send fails), undelivered, failed, delayed_delivery or read.One of: reject, undelivered, failed, delayed_delivery, readExample: undelivered
error_codestring | null
Required for reject, undelivered and failed.Example: 30003
delay_secondsnumber | null
Required for delayed_delivery.Example: 30
notestring
Why the rule exists, shown in the list.Example: Unreachable handset for the retry test
is_enabledboolean
Off rules are kept but skipped.Example: true

Answer

201 SmsOutcomeRule

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

Try it in Demo mode

PATCH/api/v1/outcome-rules/sms/{ruleId}

Change an SMS outcome rule; send only the changed keys.

CLI
sendmock outcome-rule sms update <ruleId>
MCP tool
sendmock_outcome_rule_update
In the app
Settings > SMS > Custom outcome numbers > Edit, enabled switch

Request body (application/json)

SmsOutcomeRuleInputPatch

FieldTypeDescription
match_field?"to" | "from"
Match the pattern against the recipient (to) or the sender (from).One of: to, fromExample: to
pattern?string
Exact E.164 number, or * for any digits, e.g. +1555777*.Example: +1555777*
outcome?SmsOutcomeKind
What happens to a matching message: reject (the send fails), undelivered, failed, delayed_delivery or read.One of: reject, undelivered, failed, delayed_delivery, readExample: undelivered
error_code?string | null
Required for reject, undelivered and failed.Example: 30003
delay_seconds?number | null
Required for delayed_delivery.Example: 30
note?string
Why the rule exists, shown in the list.Example: Unreachable handset for the retry test
is_enabled?boolean
Off rules are kept but skipped.Example: true

Answer

200 SmsOutcomeRule

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

Try it in Demo mode

POST/api/v1/outcome-rules/sms/{ruleId}/move

Move an SMS outcome rule up or down.

CLI
sendmock outcome-rule sms move <ruleId>
MCP tool
sendmock_outcome_rule_move
In the app
Settings > SMS > Custom outcome numbers > Move up, Move down

Request body (application/json)

OutcomeRuleMove : Body of POST /api/v1/outcome-rules/{kind}/{ruleId}/move.

FieldTypeDescription
direction"up" | "down"
up moves the rule one place earlier in the order, down one place later.One of: up, downExample: up

Answer

200 SmsOutcomeRule[]

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

Try it in Demo mode

POST/api/v1/outcome-rules/email/test

Which custom rule, magic address or profile decides an address's outcome.

CLI
sendmock outcome-rule email test <address>
MCP tool
sendmock_outcome_rule_test
In the app
Settings > Email > Test an address

Request body (application/json)

EmailOutcomeTestRequest : Body of POST /api/v1/outcome-rules/email/test.

FieldTypeDescription
addressstring
The address to test against the outcome rules and magic addresses.Example: [email protected]

Answer

200 OutcomeTestResult

Try it in Demo mode

POST/api/v1/outcome-rules/sms/test

Which custom rule, magic number or profile decides a number's outcome.

CLI
sendmock outcome-rule sms test <number>
MCP tool
sendmock_outcome_rule_test
In the app
Settings > SMS > Test a number

Request body (application/json)

SmsOutcomeTestRequest : Body of POST /api/v1/outcome-rules/sms/test.

FieldTypeDescription
numberstring
The number to test against the outcome rules and Twilio's magic numbers.Example: +15005550001
match_field"to" | "from"
Whether the number is the message's recipient (to) or sender (from).One of: to, fromExample: to

Answer

200 OutcomeTestResult

Try it in Demo mode