GET/api/v1/webhooks/variables
Global and endpoint variables; secret values are masked.
- CLI
sendmock webhook var list- MCP tool
sendmock_webhook_variable_list- In the app
- Webhooks > Variables
Answer
200 WebhookVariable[]
/api/v1/webhooks/variablesGlobal and endpoint variables; secret values are masked.
sendmock webhook var listsendmock_webhook_variable_list200 WebhookVariable[]
/api/v1/webhooks/variablesAdd a variable.
sendmock webhook var set <name> <value>sendmock_webhook_variable_setWebhookVariableInput : Body of POST and PATCH /api/v1/webhooks/variables.
| Field | Type | Description |
|---|---|---|
| name | string | The name templates read it by, as {{ vars.<name> }}.Example: tenant_id |
| kind | VariableKind | 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_id | Ulid | null | The endpoint of an endpoint variable; null for global ones.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D |
| value | string | 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 |
| description | string | What the variable is for.Example: Tenant every webhook is sent for |
201 WebhookVariable
Errors: 400, as { error: { code, message } }
/api/v1/webhooks/variables/{variableId}Change a variable.
sendmock webhook var update <variableId>sendmock_webhook_variable_updateWebhookVariableInput : Body of POST and PATCH /api/v1/webhooks/variables.
| Field | Type | Description |
|---|---|---|
| name | string | The name templates read it by, as {{ vars.<name> }}.Example: tenant_id |
| kind | VariableKind | 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_id | Ulid | null | The endpoint of an endpoint variable; null for global ones.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D |
| value | string | 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 |
| description | string | What the variable is for.Example: Tenant every webhook is sent for |
200 WebhookVariable
Errors: 400, 404, as { error: { code, message } }
/api/v1/webhooks/variables/{variableId}Delete a variable.
sendmock webhook var unset <variableId>sendmock_webhook_variable_unset204 No content
Errors: 404, as { error: { code, message } }
/api/v1/webhooks/variables/{variableId}/regenerateMake a new fixed value for a generated-once random variable.
sendmock webhook var regenerate <variableId>sendmock_webhook_variable_regenerate200 WebhookVariable
Errors: 404, 409, as { error: { code, message } }
/api/v1/webhooks/variables/previewWhat a variable definition resolves to against the sample.
sendmock webhook var previewsendmock_webhook_variable_previewVariablePreviewRequest : Body of POST /api/v1/webhooks/variables/preview.
| Field | Type | Description |
|---|---|---|
| kind | VariableKind | The variable kind, as in a variable.One of: text, number, boolean, json, secret, dynamic, random, computed, promptExample: random |
| value | string | The value, expression or generator to try.Example: random_string(16) |
200 VariablePreviewResult