Test webhook
curl --request POST \
--url https://developer.encrata.com/api/webhooks/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/webhooks/test"
payload = { "id": "<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({id: '<string>'})
};
fetch('https://developer.encrata.com/api/webhooks/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://developer.encrata.com/api/webhooks/test",
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([
'id' => '<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://developer.encrata.com/api/webhooks/test"
payload := strings.NewReader("{\n \"id\": \"<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://developer.encrata.com/api/webhooks/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/webhooks/test")
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 \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"status": "<string>",
"url": "<string>",
"status_code": 123,
"response_body": "<string>",
"error": "<string>"
},
"message": "<string>"
}Webhooks
Test webhook
Send a synthetic event to a webhook and see how your endpoint replies.
POST
/
api
/
webhooks
/
test
Test webhook
curl --request POST \
--url https://developer.encrata.com/api/webhooks/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/webhooks/test"
payload = { "id": "<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({id: '<string>'})
};
fetch('https://developer.encrata.com/api/webhooks/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://developer.encrata.com/api/webhooks/test",
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([
'id' => '<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://developer.encrata.com/api/webhooks/test"
payload := strings.NewReader("{\n \"id\": \"<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://developer.encrata.com/api/webhooks/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/webhooks/test")
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 \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"status": "<string>",
"url": "<string>",
"status_code": 123,
"response_body": "<string>",
"error": "<string>"
},
"message": "<string>"
}Delivers a
For a
test event to a registered webhook and returns your endpoint’s response. Use it to confirm an endpoint is reachable before you depend on it.
Authentication
Send your API key as a bearer token.Authorization: Bearer enc_xxxxxxxxxxxx
Testing a webhook requires the workspace
admin role. tech and readonly keys get 403.Request
string
required
The webhook ID to send the test event to.
curl -X POST https://developer.encrata.com/api/webhooks/test \
-H "Authorization: Bearer enc_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"id": "360cb300-d885-4c18-af2c-d259f936bb38"}'
import requests
response = requests.post(
"https://developer.encrata.com/api/webhooks/test",
headers={"Authorization": "Bearer enc_xxxxxxxxxxxx"},
json={"id": "360cb300-d885-4c18-af2c-d259f936bb38"},
)
result = response.json()["result"]
print(result["status"], result.get("status_code"))
const response = await fetch("https://developer.encrata.com/api/webhooks/test", {
method: "POST",
headers: {
Authorization: "Bearer enc_xxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({ id: "360cb300-d885-4c18-af2c-d259f936bb38" }),
});
const { result } = await response.json();
console.log(result.status, result.status_code);
What your endpoint receives
The test always advertises itself as atest event, so your production handler will not mistake it for a real one.
Test payload
{
"event": "test",
"data": {
"test": true,
"message": "This is a test webhook from Encrata"
},
"created_at": "2026-05-02T12:00:00Z"
}
generic webhook the request carries the same headers as a real delivery, including X-Encrata-Signature and X-Encrata-Event: test. Chat destinations receive their provider’s message format instead.
The attempt is recorded, so it also appears in delivery history.
Response
Returns200 OK whenever the test ran, even if your endpoint rejected it. Read result.status to learn the delivery outcome.
boolean
true when the test was executed. This describes the API call, not your endpoint’s reply.object
Hide result
Hide result
string
delivered when your endpoint returned a 2xx status, otherwise failed.string
The URL the test was sent to. Empty for
telegram.integer
The HTTP status your endpoint returned. Absent when Encrata could not reach it at all.
string
Your endpoint’s response body, truncated to 512 bytes. Absent when Encrata could not reach it, or when the body was empty.
string
Present only when the request never completed, such as a DNS failure, a refused connection, or a timeout. The text is a fixed, safe message: transport details are logged, not returned.
string
A human-readable summary.
{
"success": true,
"result": {
"status": "delivered",
"url": "https://example.com/webhooks/encrata",
"status_code": 200,
"response_body": "OK"
},
"message": "Test event sent."
}
{
"success": true,
"result": {
"status": "failed",
"url": "https://example.com/webhooks/encrata",
"status_code": 401,
"response_body": "missing signature"
},
"message": "Test event sent."
}
{
"success": true,
"result": {
"status": "failed",
"url": "https://example.com/webhooks/encrata",
"error": "We couldn't reach that endpoint. Check that the URL is correct and publicly reachable, then try again."
},
"message": "Test event sent."
}
A failed test is still
success: true with HTTP 200. The API call worked; the delivery did not. Branch on result.status.Errors
| Status | Code | When |
|---|---|---|
400 | bad_request | id was missing, or the JSON body could not be parsed. |
401 | unauthorized | The API key is missing, revoked, or disabled. |
403 | forbidden | Your role is not admin. |
404 | not_found | No webhook with that ID exists in your workspace. |
500 | internal | Encrata could not load the webhook. Retry. |
Example error
{
"success": false,
"result": { "code": "forbidden" },
"message": "You don't have permission to manage webhooks."
}
Next steps
Verify signatures
Make your handler accept the signed payload.
Inspect deliveries
Review attempts, statuses, and retries.
Update a webhook
Fix the URL and test again.
Error reference
Every status code the API returns.
Was this page helpful?