Webhook API
Call a webhook
Starts the workflow whose WEBHOOK_TRIGGER node has this path. 401 unless the body is signed with the node’s secret; 404 for an unknown hook.
POST
/
hooks
/
{sessionId}
/
{path}
Call a webhook
curl --request POST \
--url https://api.example.com/hooks/{sessionId}/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
"aSDinaTvuI8gbWludGxpZnk="
'import requests
url = "https://api.example.com/hooks/{sessionId}/{path}"
payload = "aSDinaTvuI8gbWludGxpZnk="
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify('aSDinaTvuI8gbWludGxpZnk=')
};
fetch('https://api.example.com/hooks/{sessionId}/{path}', 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/hooks/{sessionId}/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('aSDinaTvuI8gbWludGxpZnk='),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/hooks/{sessionId}/{path}"
payload := strings.NewReader("\"aSDinaTvuI8gbWludGxpZnk=\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/hooks/{sessionId}/{path}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("\"aSDinaTvuI8gbWludGxpZnk=\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/hooks/{sessionId}/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "\"aSDinaTvuI8gbWludGxpZnk=\""
response = http.request(request)
puts response.read_body{
"data": {
"executionId": "550e8400-e29b-41d4-a716-446655440000"
},
"error": "Bad Request",
"errors": [
{
"field": "sessionId",
"message": "Session not found: 'unknown-session'"
}
],
"message": "Operation successful",
"path": "/api/files",
"status": 200,
"timestamp": "2023-11-07T05:31:56Z"
}Authorizations
bearerAuthapiKeyAuth
Body
application/json
The body is of type string<byte>.
Response
202 - */*
Accepted
Unified API response wrapper for both success and error responses. Success responses include data field; error responses include error, path, and errors fields.
⌘I
Call a webhook
curl --request POST \
--url https://api.example.com/hooks/{sessionId}/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
"aSDinaTvuI8gbWludGxpZnk="
'import requests
url = "https://api.example.com/hooks/{sessionId}/{path}"
payload = "aSDinaTvuI8gbWludGxpZnk="
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify('aSDinaTvuI8gbWludGxpZnk=')
};
fetch('https://api.example.com/hooks/{sessionId}/{path}', 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/hooks/{sessionId}/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('aSDinaTvuI8gbWludGxpZnk='),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/hooks/{sessionId}/{path}"
payload := strings.NewReader("\"aSDinaTvuI8gbWludGxpZnk=\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/hooks/{sessionId}/{path}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("\"aSDinaTvuI8gbWludGxpZnk=\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/hooks/{sessionId}/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "\"aSDinaTvuI8gbWludGxpZnk=\""
response = http.request(request)
puts response.read_body{
"data": {
"executionId": "550e8400-e29b-41d4-a716-446655440000"
},
"error": "Bad Request",
"errors": [
{
"field": "sessionId",
"message": "Session not found: 'unknown-session'"
}
],
"message": "Operation successful",
"path": "/api/files",
"status": 200,
"timestamp": "2023-11-07T05:31:56Z"
}