Test agent webhook
curl --request POST \
--url https://api.nedzo.ai/v1/agents/{agentId}/test-webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"channel": "<string>"
}
'import requests
url = "https://api.nedzo.ai/v1/agents/{agentId}/test-webhook"
payload = {
"url": "<string>",
"channel": "<string>"
}
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({url: '<string>', channel: '<string>'})
};
fetch('https://api.nedzo.ai/v1/agents/{agentId}/test-webhook', 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.nedzo.ai/v1/agents/{agentId}/test-webhook",
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([
'url' => '<string>',
'channel' => '<string>'
]),
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.nedzo.ai/v1/agents/{agentId}/test-webhook"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"channel\": \"<string>\"\n}")
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.nedzo.ai/v1/agents/{agentId}/test-webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"channel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nedzo.ai/v1/agents/{agentId}/test-webhook")
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 = "{\n \"url\": \"<string>\",\n \"channel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{ "success": false, "error": "Webhook endpoint returned HTTP 500" }
Agents
Test agent webhook
Send a sample post-conversation webhook to check your endpoint.
POST
/
agents
/
{agentId}
/
test-webhook
Test agent webhook
curl --request POST \
--url https://api.nedzo.ai/v1/agents/{agentId}/test-webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"channel": "<string>"
}
'import requests
url = "https://api.nedzo.ai/v1/agents/{agentId}/test-webhook"
payload = {
"url": "<string>",
"channel": "<string>"
}
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({url: '<string>', channel: '<string>'})
};
fetch('https://api.nedzo.ai/v1/agents/{agentId}/test-webhook', 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.nedzo.ai/v1/agents/{agentId}/test-webhook",
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([
'url' => '<string>',
'channel' => '<string>'
]),
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.nedzo.ai/v1/agents/{agentId}/test-webhook"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"channel\": \"<string>\"\n}")
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.nedzo.ai/v1/agents/{agentId}/test-webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"channel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nedzo.ai/v1/agents/{agentId}/test-webhook")
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 = "{\n \"url\": \"<string>\",\n \"channel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{ "success": false, "error": "Webhook endpoint returned HTTP 500" }
This endpoint is for the VIP plan only. Other plans get a
403. See Plan access.Path Parameters
string
required
The agent.
Body
string
The URL to test. Leave it out to use the agent’s webhook URL.
string
The channel to label the sample with:
voice, web, sms, email, whatsapp, facebook (Messenger), instagram or web_chat.{ "success": false, "error": "Webhook endpoint returned HTTP 500" }
success is true when your endpoint answered with a 2xx. A redirect to a private or internal address is refused. You can test 10 times a minute per workspace.
Errors
| Status | When |
|---|---|
400 | The agent has no webhook URL and you sent none, or the URL is not a public address. |
404 | The agent is not in your API key’s scope. |
429 | More than 10 tests in a minute. Wait a minute. |
Was this page helpful?
