Send a test event to a webhook
curl --request POST \
--url https://api.tela.com/webhook/{webhookId}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "task.completed",
"mockData": {
"task": {
"name": "Contract 42 review",
"reference": 42
}
}
}
'import requests
url = "https://api.tela.com/webhook/{webhookId}/test"
payload = {
"eventType": "task.completed",
"mockData": { "task": {
"name": "Contract 42 review",
"reference": 42
} }
}
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({
eventType: 'task.completed',
mockData: {task: {name: 'Contract 42 review', reference: 42}}
})
};
fetch('https://api.tela.com/webhook/{webhookId}/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.tela.com/webhook/{webhookId}/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([
'eventType' => 'task.completed',
'mockData' => [
'task' => [
'name' => 'Contract 42 review',
'reference' => 42
]
]
]),
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.tela.com/webhook/{webhookId}/test"
payload := strings.NewReader("{\n \"eventType\": \"task.completed\",\n \"mockData\": {\n \"task\": {\n \"name\": \"Contract 42 review\",\n \"reference\": 42\n }\n }\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.tela.com/webhook/{webhookId}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"task.completed\",\n \"mockData\": {\n \"task\": {\n \"name\": \"Contract 42 review\",\n \"reference\": 42\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/webhook/{webhookId}/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 \"eventType\": \"task.completed\",\n \"mockData\": {\n \"task\": {\n \"name\": \"Contract 42 review\",\n \"reference\": 42\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"response": "{\"ok\":true}",
"responseTime": 184
}Webhook
Send a test event to a webhook
Sends a synthetic event payload for eventType to the webhook’s URL using its configured method and headers, and returns what your endpoint answered.
POST
/
webhook
/
{webhookId}
/
test
Send a test event to a webhook
curl --request POST \
--url https://api.tela.com/webhook/{webhookId}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "task.completed",
"mockData": {
"task": {
"name": "Contract 42 review",
"reference": 42
}
}
}
'import requests
url = "https://api.tela.com/webhook/{webhookId}/test"
payload = {
"eventType": "task.completed",
"mockData": { "task": {
"name": "Contract 42 review",
"reference": 42
} }
}
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({
eventType: 'task.completed',
mockData: {task: {name: 'Contract 42 review', reference: 42}}
})
};
fetch('https://api.tela.com/webhook/{webhookId}/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.tela.com/webhook/{webhookId}/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([
'eventType' => 'task.completed',
'mockData' => [
'task' => [
'name' => 'Contract 42 review',
'reference' => 42
]
]
]),
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.tela.com/webhook/{webhookId}/test"
payload := strings.NewReader("{\n \"eventType\": \"task.completed\",\n \"mockData\": {\n \"task\": {\n \"name\": \"Contract 42 review\",\n \"reference\": 42\n }\n }\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.tela.com/webhook/{webhookId}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"task.completed\",\n \"mockData\": {\n \"task\": {\n \"name\": \"Contract 42 review\",\n \"reference\": 42\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/webhook/{webhookId}/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 \"eventType\": \"task.completed\",\n \"mockData\": {\n \"task\": {\n \"name\": \"Contract 42 review\",\n \"reference\": 42\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"response": "{\"ok\":true}",
"responseTime": 184
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Webhook subscription ID
Body
application/json
Events a webhook can subscribe to:
task.completed— a task run finished successfully and is ready for review.task.approved— a task was reviewed and approved.task.approval-revoke— an approved task was sent back tovalidating.task.failed— a task run ended with a failure (errorMessageis set in the payload).
Available options:
task.completed, task.approved, task.approval-revoke, task.failed Optional overrides applied to the sample payload.
Show child attributes
Show child attributes
Response
Result of the test request to your endpoint
true when the request reached your endpoint (regardless of the HTTP status it returned).
HTTP status returned by your endpoint; 0 when the request could not be completed.
Response body returned by your endpoint.
Round-trip time in milliseconds.
Error message when the request could not be completed (timeout, DNS failure, ...).