Action Meta
Webhooks
Explains webhook action metadata for triggering actions from external systems. Useful for implicit and explicit webhooks, authentication, GET or POST calls, and data exchange.
There are 2 types of webhooks:
- Implicit - using the stubref as part of the URL
- Explicit - using a webhook URL with a UUID that was created from a create webhook task
See the webhooks concept for more information on webhooks in Stubber.
Implicit Webhooks
Implicit webhooks are set via setting some action meta data on the action to enable it.
Webhook url format: https://webhooks.stubber.com/im/{{stubref}}/{{action_name}}
{{stubref}}is the stub you want to run an action on.{{action_name}}is the name of the action you want to run.
You may use POST or GET methods
If you had a stub with the stubref 2023-09-14-XXXX-V1A5 and you want to execute an action named example_action
The webhook url will be https://webhooks.stubber.com/im/2023-09-14-XXXX-V1A5/example_action
Enabling an implicit webhook
To allow an action to be triggered by a webhook you must configure it in the action_meta
Navigate to Advanced tab and add the following json
You can now execute it using the following http request
Result:

Copying the Webhook URL from the UI
Once an action has webhooks enabled, two copy shortcuts appear in the action's dropdown within the Actions Menu block on any stub:
- Copy webhook link — copies the full webhook URL for that stub and action to your clipboard, ready to paste into an external system.
- Copy as cURL — copies a ready-to-run
curlcommand to your clipboard:
This makes it easy to test or share a webhook directly from the stub without manually constructing the URL.
Putting data into stub.data.payload
By default data will be placed in stub.data.payload
When using the GET method all query params will be placed into stub.data.payload
When using the POST method the request body will be placed into stub.data.payload
Putting data into stub.data
You can configure your data to go to the root of stub.data
using the post_data_on_root parameter in the action_meta configuration
Calling a webhook using the GET method
Result
Calling a webhook using the POST method
Result
Getting stub.data in response
Using webhooks and external system can pull data from a stub
The default the response will be:
There are 2 ways to enable this functionality:
- Via a setting a query parameter (
_synchronous=true)
- Via setting
action_meta.webhooks.synchronous.enabletotrue
Result
the default response for a synchronous webhook
Custom webhook response
You can override the default response and configure it to be any structure you need
Follow the below steps to configure a custom response:
- set
action_meta.webhooks.synchronous.use_custom_return_datatotrue - configure your response structure in
action_meta.webhooks.synchronous.return_data
Webhook response
Custom status and headers
return_status and return_headers set the status and headers of a synchronous webhook's answer. Like return_data, they're substituted after the action runs, so the action can decide them. They work with or without use_custom_return_data.
return_status
The status, from 200 to 599, as a number or text that substitutes to one. Defaults to 200. Any other value answers 500 with error.message return_status_invalid.
return_headers
Headers to add, by name. A header whose value substitutes to nothing is left out. Content-Length, Transfer-Encoding, Connection and the other connection headers, Set-Cookie, Retry-After and the RateLimit-* headers can't be set; a template that sets one answers 500 with error.message return_headers_invalid.
To answer with something other than JSON, make return_data a string and set Content-Type, e.g. XML for a service that expects it:
These apply when the action ran. When it fails, the answer is one of the errors below.
Synchronous errors
When the action fails, a synchronous webhook answers with an error instead of the stub data:
422when the action couldn't run on the stub, e.g. it isn't available in the stub's state (action_not_in_state) or its conditions weren't met (action_conditions_failed).error.messagesays why.502witherror.messagecore_action_failedwhen the action failed for a technical reason, or Stubber couldn't run it.
Execution
You can configure how the webhook action is executed using the execution object within the webhooks configuration.
bulk_random_order
If set to true, the action will run on the bulk nodes. Actions that run on the bulk nodes do not have a guaranteed order of execution, but more of them can be processed at the same time. This is useful when you want to trigger thousands of a specific action via webhook and the order they run in does not matter.
Validating the payload
An action's input_schema is a JSON Schema (draft 2020-12) of the data it takes, its stubpost.data. An implicit webhook checks every call against it before anything runs, and refuses a call that doesn't fit with status 400, listing each problem. Use it to require fields, check formats and patterns, and refuse fields you don't expect.
input_schema sits on the action itself, next to fields, not in action_meta:
The schema describes stubpost.data. With post_data_on_root, that's the request body, as above. Without it, the body arrives in stubpost.data.payload, so the schema describes it under payload:
The link id's data that a webhook adds as data.lid isn't checked.
Besides JSON Schema's own keywords (required, type, pattern, minLength, maxLength, minimum, enum, additionalProperties…), the standard formats are checked: email, uri, uuid, date, time, date-time, duration, ipv4, ipv6 and hostname, among others. For anything else, such as a phone number in international format, use a pattern. A keyword or format JSON Schema doesn't define (including a misspelled one) makes the schema invalid, rather than being ignored.
Query strings and form fields are always text, so for GET requests and form posts a value that reads as the schema's type passes and is converted: amount=250 arrives as the number 250. JSON bodies are checked as they are.
A call that doesn't fit is refused with every problem found (up to 20), each with the path of the value, the rule it broke and a message:
A schema that isn't valid JSON Schema answers 500 with error.message input_schema_invalid, so a mistake in it is noticed rather than letting everything through.
Values that pass the schema are stored as data and aren't changed. To keep markup or quotes out of a field, describe what it may hold (pattern, enum, format, maxLength), and use {{ }} rather than {{{ }}} when placing values in HTML, which escapes them.
Rate limits
You can limit how often an implicit webhook can be called. Calls over the limit are rejected before authentication and before the action runs. Without rate_limit, a webhook isn't limited.
per_stub
At most limit calls of this action on one stub within any window_seconds.
per_template
At most limit calls of this action across all stubs of the template within any window_seconds. Useful for a system that sends to many stubs at once.
Set either or both; when both are set, a call must be within both. limit and window_seconds are whole numbers of at least 1. The window slides: calls in the previous window still count, in proportion to how much of it falls within the last window_seconds.
A rejected call is answered with status 429 and a Retry-After header, the number of seconds after which a call will be accepted again. A rejected call doesn't count towards the limit.
Every answer from a rate-limited webhook carries headers for the limit closest to running out:
RateLimit-Limit: the limit.RateLimit-Remaining: calls left.RateLimit-Reset: seconds until the current window ends.
Authentication
Authentication is disabled by default.
You may quickly toggle authentication by setting the action_meta.webhooks.authorization.enable field to true
There are 4 authentication types currently available
- basic
- bearer
- credential
- hmac (implicit webhooks only)
Basic Authentication
To enable basic authentication configure your action_meta like the json below:
Bearer Token Authentication
To enable Bearer authentication configure your action_meta like the json below:
Credential authentication
To enable Credential authentication create a credential
Current supported credentials for webhook:
- Basic user and pass
- Bearer token
- Custom header
Once you have created your credential configure your action_meta like the json below:
HMAC authentication
With HMAC authentication, callers sign every request with a secret they share with Stubber, together with a timestamp and a nonce. A request can't be altered, sent to another stub or action, or replayed. Use it when the system calling the webhook can compute a signature, e.g. your own backend or an integration you build.
- Create a credential of type
genericwith the shared secret as its value. Give the same secret to the caller. - Configure the action:
credentialuuid
The generic credential holding the shared secret.
tolerance_seconds
How far a request's timestamp may be from Stubber's clock, in seconds. Defaults to 300, at most 3600.
The caller signs requests as described in Signing Webhook Requests (HMAC), which has examples in several languages and test values. HMAC can't be used with file uploads (multipart/form-data).
Authentication with interpolation
You can use interpolation to dynamically set the authentication keys
Below is an example for setting the stubref as the username and password
Request with Authorization
Below is an example for making a request with basic authentication
In this example we are using the stubref 2024-06-19-XXXX-ASEQ as the username and password
Default response if Authorization success
Default response if Authorization fail
Uploading files with form-data
Only Implicit webhooks support form-data.
Below is an example for uploading files

After a successful request your files will be added to the stub as attachments
