Trigger webhook
curl --request POST \
--url https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id} \
--header 'Content-Type: application/json' \
--data '
{
"ticket_id": 48213,
"subject": "Refund not received",
"priority": "high"
}
'import requests
url = "https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}"
payload = {
"ticket_id": 48213,
"subject": "Refund not received",
"priority": "high"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ticket_id: 48213, subject: 'Refund not received', priority: 'high'})
};
fetch('https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}', 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://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}",
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([
'ticket_id' => 48213,
'subject' => 'Refund not received',
'priority' => 'high'
]),
CURLOPT_HTTPHEADER => [
"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://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}"
payload := strings.NewReader("{\n \"ticket_id\": 48213,\n \"subject\": \"Refund not received\",\n \"priority\": \"high\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}")
.header("Content-Type", "application/json")
.body("{\n \"ticket_id\": 48213,\n \"subject\": \"Refund not received\",\n \"priority\": \"high\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticket_id\": 48213,\n \"subject\": \"Refund not received\",\n \"priority\": \"high\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"webhook_id": "66f1c3b7e4b0a1b2c3d4e5f7",
"agent_id": "66e9b0f2a1c3d4e5f6a7b8c9",
"session_id": "<string>"
}{
"detail": "Schedule not found"
}{
"detail": "Webhook not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Webhook Trigger
Trigger Webhook
Run an agent from an external system with a signed request.
POST
/
webhook-trigger
/
{webhook_id}
Trigger webhook
curl --request POST \
--url https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id} \
--header 'Content-Type: application/json' \
--data '
{
"ticket_id": 48213,
"subject": "Refund not received",
"priority": "high"
}
'import requests
url = "https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}"
payload = {
"ticket_id": 48213,
"subject": "Refund not received",
"priority": "high"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ticket_id: 48213, subject: 'Refund not received', priority: 'high'})
};
fetch('https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}', 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://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}",
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([
'ticket_id' => 48213,
'subject' => 'Refund not received',
'priority' => 'high'
]),
CURLOPT_HTTPHEADER => [
"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://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}"
payload := strings.NewReader("{\n \"ticket_id\": 48213,\n \"subject\": \"Refund not received\",\n \"priority\": \"high\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}")
.header("Content-Type", "application/json")
.body("{\n \"ticket_id\": 48213,\n \"subject\": \"Refund not received\",\n \"priority\": \"high\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticket_id\": 48213,\n \"subject\": \"Refund not received\",\n \"priority\": \"high\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"webhook_id": "66f1c3b7e4b0a1b2c3d4e5f7",
"agent_id": "66e9b0f2a1c3d4e5f6a7b8c9",
"session_id": "<string>"
}{
"detail": "Schedule not found"
}{
"detail": "Webhook not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}This is the URL returned as
Requests with a missing, malformed, or invalid signature are rejected with
webhook_url when you create a webhook. It does not use an API key. Instead, every request must carry an HMAC-SHA256 signature of the raw request body, computed with the webhook’s secret_key:
X-Webhook-Signature: sha256=<hex_digest>
401.
Sign the exact bytes you send. If you serialize the JSON once to sign it and again to send it, whitespace or key-order differences will make the signature fail.
BODY='{"ticket_id":48213,"subject":"Refund not received","priority":"high"}'
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | sed 's/^.* //')
curl -X POST "https://scheduler.studio.lyzr.ai/webhook-trigger/$WEBHOOK_ID" \
-H "Content-Type: application/json" \
-H "X-Webhook-Signature: sha256=$SIG" \
-d "$BODY"
import hashlib
import hmac
import json
import requests
webhook_id = "YOUR_WEBHOOK_ID"
secret = "YOUR_WEBHOOK_SECRET"
body = json.dumps({"ticket_id": 48213, "subject": "Refund not received", "priority": "high"}).encode()
signature = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
response = requests.post(
f"https://scheduler.studio.lyzr.ai/webhook-trigger/{webhook_id}",
data=body,
headers={
"Content-Type": "application/json",
"X-Webhook-Signature": f"sha256={signature}",
},
)
print(response.status_code, response.json())
import crypto from "node:crypto";
const webhookId = "YOUR_WEBHOOK_ID";
const secret = "YOUR_WEBHOOK_SECRET";
const body = JSON.stringify({ ticket_id: 48213, subject: "Refund not received", priority: "high" });
const signature = crypto.createHmac("sha256", secret).update(body).digest("hex");
const response = await fetch(`https://scheduler.studio.lyzr.ai/webhook-trigger/${webhookId}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Webhook-Signature": `sha256=${signature}`,
},
body,
});
console.log(response.status, await response.json());
GitHub webhooks
GitHub signs deliveries withX-Hub-Signature-256, which uses the same sha256=<hex_digest> format. The endpoint accepts it as an alias, so you can point a GitHub webhook straight at webhook_url:
- In your repository, go to Settings > Webhooks > Add webhook.
- Set Payload URL to the
webhook_url. - Set Content type to
application/json. - Set Secret to the webhook’s
secret_key.
What happens next
The endpoint returns202 as soon as the request is accepted. The agent runs in the background with the JSON body as its message. Use the session_id from the response to find the run in Get Webhook Execution Logs or List Recent Webhook Executions.Headers
sha256= followed by the hex HMAC-SHA256 of the raw request body, keyed with the webhook's secret_key. Required unless you send X-Hub-Signature-256.
Example:
"sha256=5d41402abc4b2a76b9719d911017c592ae2f7c1d7c3c6f0d8e2b1a4f3c9e8d7b"
GitHub-style alias for X-Webhook-Signature. Same format and same signature.
Path Parameters
ID of the webhook.
Example:
"66f1c3b7e4b0a1b2c3d4e5f7"
Body
application/json
Any JSON payload. It is forwarded to the agent as the message.
The body is of type object.
Response
The trigger was accepted and the agent is running in the background.