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

API reference

Tag rules

POST/api/v1/tag-rules

Add a tag rule at the end of the list.

CLI
sendmock email tag-rules create
MCP tool
sendmock_tag_rule_create
In the app
Settings > Email > Tag rules > Add rule

Request body (application/json)

TagRuleInput : Body of POST and PATCH /api/v1/tag-rules.

FieldTypeDescription
namestring
A name for the rule, shown in the list.Example: Tag password resets
filterRuleFilter | null
The webhook rule filter, over email fields; null matches every email.
tagstring
The tag added to each matching email.Example: password-reset
is_enabledboolean
Off rules are kept but skipped.Example: true

Answer

201 TagRule

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

Try it in Demo mode

PATCH/api/v1/tag-rules/{ruleId}

Change a tag rule, or switch it on or off.

CLI
sendmock email tag-rules update <ruleId>
MCP tool
sendmock_tag_rule_update
In the app
Settings > Email > Tag rules > Edit, enabled switch

Request body (application/json)

TagRuleInputPatch

FieldTypeDescription
name?string
A name for the rule, shown in the list.Example: Tag password resets
filter?RuleFilter | null
The webhook rule filter, over email fields; null matches every email.
tag?string
The tag added to each matching email.Example: password-reset
is_enabled?boolean
Off rules are kept but skipped.Example: true

Answer

200 TagRule

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

Try it in Demo mode

POST/api/v1/tag-rules/{ruleId}/move

Move a tag rule up or down.

CLI
sendmock email tag-rules move <ruleId>
MCP tool
sendmock_tag_rule_move
In the app
Settings > Email > Tag rules > Move up, Move down

Request body (application/json)

MessageRuleMove : Body of POST /api/v1/tag-rules/{ruleId}/move and /forward-rules/{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 TagRule[]

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

Try it in Demo mode