Test a webhook
curl --request POST \
--url https://api.example.com/api/v1/automation/webhooks/{flowId}/test \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/automation/webhooks/{flowId}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/automation/webhooks/{flowId}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/automation/webhooks/{flowId}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/automation/webhooks/{flowId}/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/automation/webhooks/{flowId}/test")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/automation/webhooks/{flowId}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyTest a webhook
Send a call to the test address of a draft flow so that it becomes the trigger’s sample data and starts no run.
POST
/
api
/
v1
/
automation
/
webhooks
/
{flowId}
/
test
Test a webhook
curl --request POST \
--url https://api.example.com/api/v1/automation/webhooks/{flowId}/test \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/automation/webhooks/{flowId}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/automation/webhooks/{flowId}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/automation/webhooks/{flowId}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/automation/webhooks/{flowId}/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/automation/webhooks/{flowId}/test")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/automation/webhooks/{flowId}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySaves a call as the sample data of the Webhook received trigger of the flow’s draft. It starts no run and changes nothing in production, so you can build the steps behind the trigger with the real fields of your caller.
The body may be JSON or text, up to 5 MB. The sample keeps the method, the body and the query. Files are not kept.
GET works the same way.
Who may call it
A signed-in editor or admin of the Space may call the address from the browser. Anybody else has to pass the login that the trigger asks for, and gets401 otherwise. The flow does not have to be published or switched on.
Request
curl -X POST "https://your-instance/api/v1/automation/webhooks/cm1abc/test?ref=7" \
-H "Content-Type: application/json" \
-d '{"order": 4711}'
Answers
{ "data": { "saved": true, "sample": { "method": "POST", "body": { "order": 4711 }, "query": { "ref": "7" } } } }
| Status | Meaning |
|---|---|
200 | The call is the new sample data. |
401 | The call does not pass the login of the trigger. |
404 | The flow does not exist or its draft does not start from the built-in webhook. |
413 | The body is larger than 5 MB. |
422 | The sample data is larger than 256 KB. The code is SAMPLE_TOO_LARGE. |
429 | Too many calls to the test address of this flow in a minute. Retry-After says when to try again. |
Related
Last modified on November 5, 2026