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

API reference

Webhook variables

POST/api/v1/webhooks/variables

Add a variable.

CLI
sendmock webhook var set <name> <value>
MCP tool
sendmock_webhook_variable_set
In the app
Webhooks > Variables > Add variable

Request body (application/json)

WebhookVariableInput : Body of POST and PATCH /api/v1/webhooks/variables.

FieldTypeDescription
namestring
The name templates read it by, as {{ vars.<name> }}.Example: tenant_id
kindVariableKind
text, number, boolean, json and secret are fixed values; dynamic is read from the event, random is generated, computed combines other variables and prompt is asked for on manual sends.One of: text, number, boolean, json, secret, dynamic, random, computed, promptExample: text
scope"global" | "endpoint"
global for every endpoint, or endpoint for one; endpoint values win.One of: global, endpointExample: global
endpoint_idUlid | null
The endpoint of an endpoint variable; null for global ones.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
valuestring
Static value, expression, generator or default; secrets are masked.Example: acme
random_mode"per_send" | "fixed" | null
For random: per_send generates a new value each time, fixed keeps one value until Regenerate; null for other kinds.One of: per_send, fixedExample: per_send
descriptionstring
What the variable is for.Example: Tenant every webhook is sent for

Answer

201 WebhookVariable

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

Try it in Demo mode

PATCH/api/v1/webhooks/variables/{variableId}

Change a variable.

CLI
sendmock webhook var update <variableId>
MCP tool
sendmock_webhook_variable_update
In the app
Webhooks > Variables > Edit

Request body (application/json)

WebhookVariableInput : Body of POST and PATCH /api/v1/webhooks/variables.

FieldTypeDescription
namestring
The name templates read it by, as {{ vars.<name> }}.Example: tenant_id
kindVariableKind
text, number, boolean, json and secret are fixed values; dynamic is read from the event, random is generated, computed combines other variables and prompt is asked for on manual sends.One of: text, number, boolean, json, secret, dynamic, random, computed, promptExample: text
scope"global" | "endpoint"
global for every endpoint, or endpoint for one; endpoint values win.One of: global, endpointExample: global
endpoint_idUlid | null
The endpoint of an endpoint variable; null for global ones.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
valuestring
Static value, expression, generator or default; secrets are masked.Example: acme
random_mode"per_send" | "fixed" | null
For random: per_send generates a new value each time, fixed keeps one value until Regenerate; null for other kinds.One of: per_send, fixedExample: per_send
descriptionstring
What the variable is for.Example: Tenant every webhook is sent for

Answer

200 WebhookVariable

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

Try it in Demo mode

POST/api/v1/webhooks/variables/preview

What a variable definition resolves to against the sample.

CLI
sendmock webhook var preview
MCP tool
sendmock_webhook_variable_preview
In the app
Webhooks > Variables > variable sheet > Resolves to

Request body (application/json)

VariablePreviewRequest : Body of POST /api/v1/webhooks/variables/preview.

FieldTypeDescription
kindVariableKind
The variable kind, as in a variable.One of: text, number, boolean, json, secret, dynamic, random, computed, promptExample: random
valuestring
The value, expression or generator to try.Example: random_string(16)

Answer

200 VariablePreviewResult

Try it in Demo mode