With Custom Actions, it is possible to create a workflow out of a set of actions that are executed whenever a Webhook.site URL receives a request or email.
Using this functionality, you can connect APIs that aren't compatible, convert a HTTP request to an email or vice versa, build workflows that would otherwise require a developer, and much, much more.
In the following demo, webshop order details are received in a webhook. We then use Extract JSONPath and Google Sheets actions to insert their name in a Google Sheet. It also shows how variables interact with downstream actions.
Variables are an important part of Custom Actions, and are characterized by a name surrounded by two dollar signs:
$example$. Variables can be used in any field that has a ⓥ icon in the editor. They act as placeholders that are replaced by dynamic content as the request or email is received.
Each request or email has a set of Base Variables (see below) that contain information like the request IP, method, headers, query string values, form values and the request content. To see a list of variables, click the Variables button in the editor. Clicking on a variable copies it to the clipboard.
Many of the the available Custom Actions can register a variable during the runtime of the actions, so for example you can register the result of a JSONPath query and use it in a "Modify Response" action to make the response dynamic, or even use it to send a request to another HTTP address, and then use the response of that. Files can referred to and be used through Variables.
This works since Custom Actions are executed synchronously in a chain, sharing data as they're being executed.
The format of variables are dollar signs surrounded by a word, for example:
These variables are automatically available for each request or email. Different variables are available depending on the type.
|Variable Name||Available For||Description|
|request.uuid||All||The UUID of the request|
|request.token_id||All||The Token UUID (URL ID) of the request|
|request.content||All||The body content of the request|
|request.date||All||Creation date in Y-m-d H:m:s format|
|request.hostname||All||Hostname of the request (usually
|request.header.[name]||All||Created for each HTTP header|
|request.size||All||Request body size in bytes|
|request.type||All||Request type (
|request.file.[name].filename||All||Created for each file upload, with
|request.file.[name].size||All||Contains the file size in bytes|
|request.file.[name].content||All||Contains the file content|
|request.file.[name].content_type||All||Contains the file content type (e.g. image/png)|
|request.query.[name]||Web||Created for each query string (e.g. ?name=value)|
|request.form.[name]||Web||Created for each form field|
|request.ip||Web||IP of the host making the request|
|request.user_agent||Web||User agent header|
|request.url||Web||Full URL of the request (e.g. https://webhook.site/xxx-xxx...)|
|request.method||Web||HTTP method (GET, POST, etc.)|
|request.message_id||Email message ID|
|request.text_content||Parsed plaintext content|
|request.destinations||Comma separated list of recipients.|
|request.checks.[name]||True or false for email checks (DKIM, SPF, etc.)|
This action runs a JSONPath query on the contents of a request. With it, you can extract any data from a JSON document and store it in a variable, which can then be used in a downstream action.
JSONPath is very similar to the
jq commandline utility.
||the authors of all books in the store|
||the price of everything in the store.|
||the third book|
||the last book in order.|
||the last book in order.|
||the first two books|
||the first two books|
||every second book starting from first one|
||every third book starting from 1 till 6|
||filter all books with isbn number|
||filter all books cheapier than 10|
||all elements in the data (recursively extracted)|
||The root object/element (not strictly necessary)|
||The current object/element|
||Wildcard. All child elements regardless their index.|
||Array indices as a set|
||Array slice operator borrowed from ES4/Python.|
||Filters a result set by a script expression|
||Uses the result of a script expression as the index|
For more details on what's possible with JSONPath, take a look at the docs.
As you start entering a JSONPath, the results are validated and shown next to the input field.
This action runs a Regex (regular expression) query on the contents of a request. With it, you can extract any data from a text document and store it in a variable, which can then be used in a downstream action.
As you start entering a Regex, the results are validated and shown next to the input field.
Similar to the Extract JSONPath Custom Action, Extract XPath lets you extract values from an XML or HTML document and save the result as a variable.
The following examples are based on this XML document:
<?xml version="1.0"?> <organization name="ExampleCo"> <employees> <employee id="1">Jack</employee> <employee id="2">Ann</employee> </employees> </organization>
||Finds all content within the organization element||Jack
||Get the "id" property of second employee element||2|
||Employee element with id property equal to "1"||Jack|
||Last employee element||Ann|
||Employee within any parent element where id contains "2"||Ann|
This will send a request with variable contents from the Webhook.site cloud. Per default, the request contents will be identical to what was sent to the URL originally.
Variables extracted previously can be used.
The response of the request is stored in a series of variable names prefixed with a value of your choosing. The following variables are set after the request has been fired:
$your_prefix.content$- response body content
$your_prefix.status$- response status code
$your_prefix.headers$- response headers
$your_prefix.url$- the URL the request was sent to
This will send a email with variable contents from the Webhook.site cloud. Variables extracted previously can be used.
Run SSH Command¶
Allows you to run one or more SSH command on a server. Webhook.site captures the output (stdout), stderr and the command exit code as Variables that can be used in downstream actions:
This action can be used to modify the response of the Webhook.site URL based on the input.
This action can be used to allow a specific amount of requests in a specific amount of time per a given IP.
If the IP is rate limited, the URL will respond with a
HTTP 429, action execution is stopped, and the request is not saved in Webhook.site.
Useful if you need to validate that the request does or does not conform to certain criteria, the Condition action will either stop or continue based on a condition.
In both the input and the value fields, variables will be replaced (including Global Variables from the Control Panel), so you can compare e.g. JSONPath or Regex values - or even values from a previous HTTP request that was sent.
Currently, two actions are provided: stop and continue. Stop will stop further action execution of the condition is a match. Continue will only continue further execution if the condition is a match, and otherwise stop.
The following "operators" are available:
- is equal to
- is not equal to
- starts with
- ends with
- does not contain
- is greater than
- is greater than or equal to
- is less than
- is less than or equal to
The "result" of the condition will be logged below the request details, so you can see what happened.
Takes an image from either a URL or raw image data from e.g. a file upload, email attachment, request response or another action such as Dropbox.
You can enter both width and height to contrain the image in both dimensions, or enter a single dimension.
Check "Keep Aspect Ratio" so that the image keeps the aspect ratio, but doesn't exceed the height and width constraints.
Google Sheets Custom Actions lets you manipulate and retrieve values from a Google Sheet.
The following Google Sheets Custom Actions are available:
- Add Row - appends one or more new rows to an existing spreadsheet
- Update Row - updates one or more cells in an existing spreadsheet
- Get Values - retrieves one or more cell values from an existing spreadsheet
To start, you need to make sure that you have connected a Google account in the Control Panel, available here.
After that, you can select the account in the dropdown when creating the Custom Action.
Specifying the spreadsheet¶
When specifying the spreadsheet, you can either just copy/paste the spreadsheet URL or enter the spreadsheet ID. Variables can be used to specify the spreadsheet.
All actions must specify a range, which behaves similar in all actions. For the Add Row action, Google Sheets will automatically find a "table" (e.g. a homogenous mass of data) and add the values at the bottom.
A range is the same query as in Google Sheets, e.g. to select A1-C3 in Worksheet "Example", enter
When inserting or updating values, you can either enter a value in the text field, or supply multiple cells and/or rows using JSON. To insert two rows, the JSON would be
["cell 1", "cell 2"].
The Get Values Action allows you to define variables based on the output. Since this action can return multiple pieces of data, multiple variables are created.
For example, if you select two columns and two rows, e.g.
A1:B2, four variables would be defined:
variable_name.0.0= value of A1
variable_name.0.1= value of A2
variable_name.1.0= value of B1
variable_name.1.1= value of B2
Additionally, the data is available in JSON, with the
variable_name.json variable being defined, and continuing with the example above, would contain the following JSON:
[ ["A1","A2"], ["B1","B2"] ]
Amazon Web Services (AWS)¶
The following actions are available for AWS S3:
- Create Bucket
- Create Object
- Delete Object
- Get Object (retrieves object contents to a Variable)
In addition to the "official" Amazon endpoints, Webhook.site also supports S3-compatible storages like DigitalOcean, MinIO, Wasabi and more. The endpoint can be specified when setting up the account in Control Panel.
The "Create Invalidation" action allows you to dynamically create a CloudFront cache invalidation as a Custom Action. Both the Distribution ID and the paths to be invalidated are replaced with Webhook.site Variables.
With the Discord Custom Action, you can send messages to a specified channel (Each bot account uses a specific channel, so you can connect more accounts to send to different channels or servers.) In addition, you can choose a custom username and avatar image for the bot user.
With the Slack Custom Action, you can easily use Slack's Webhook URLs to send messages to a channel.
The Dropbox integration has access to the entire contents of your dropbox, and currently the following actions are available:
- Create Folder
- Download File
- Upload File
- Delete File
- Delete Folder
- Get Link - creates a temporary download link for any file in your Dropbox, and saves it in a variable.