Create a webhook destination
curl --request POST \
--url https://us.api.hellotars.com/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"sources": "all",
"events": [],
"name": "<string>",
"timeoutMs": 10000,
"enabled": true
}
'import requests
url = "https://us.api.hellotars.com/api/v1/webhooks"
payload = {
"url": "<string>",
"sources": "all",
"events": [],
"name": "<string>",
"timeoutMs": 10000,
"enabled": True
}
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>',
sources: 'all',
events: [],
name: '<string>',
timeoutMs: 10000,
enabled: true
})
};
fetch('https://us.api.hellotars.com/api/v1/webhooks', 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://us.api.hellotars.com/api/v1/webhooks",
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>',
'sources' => 'all',
'events' => [
],
'name' => '<string>',
'timeoutMs' => 10000,
'enabled' => true
]),
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://us.api.hellotars.com/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"sources\": \"all\",\n \"events\": [],\n \"name\": \"<string>\",\n \"timeoutMs\": 10000,\n \"enabled\": true\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://us.api.hellotars.com/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"sources\": \"all\",\n \"events\": [],\n \"name\": \"<string>\",\n \"timeoutMs\": 10000,\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.hellotars.com/api/v1/webhooks")
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 \"sources\": \"all\",\n \"events\": [],\n \"name\": \"<string>\",\n \"timeoutMs\": 10000,\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"secret": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}Webhooks
Create a webhook destination
Create an event destination and receive its signing secret once.
POST
/
api
/
v1
/
webhooks
Create a webhook destination
curl --request POST \
--url https://us.api.hellotars.com/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"sources": "all",
"events": [],
"name": "<string>",
"timeoutMs": 10000,
"enabled": true
}
'import requests
url = "https://us.api.hellotars.com/api/v1/webhooks"
payload = {
"url": "<string>",
"sources": "all",
"events": [],
"name": "<string>",
"timeoutMs": 10000,
"enabled": True
}
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>',
sources: 'all',
events: [],
name: '<string>',
timeoutMs: 10000,
enabled: true
})
};
fetch('https://us.api.hellotars.com/api/v1/webhooks', 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://us.api.hellotars.com/api/v1/webhooks",
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>',
'sources' => 'all',
'events' => [
],
'name' => '<string>',
'timeoutMs' => 10000,
'enabled' => true
]),
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://us.api.hellotars.com/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"sources\": \"all\",\n \"events\": [],\n \"name\": \"<string>\",\n \"timeoutMs\": 10000,\n \"enabled\": true\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://us.api.hellotars.com/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"sources\": \"all\",\n \"events\": [],\n \"name\": \"<string>\",\n \"timeoutMs\": 10000,\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.hellotars.com/api/v1/webhooks")
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 \"sources\": \"all\",\n \"events\": [],\n \"name\": \"<string>\",\n \"timeoutMs\": 10000,\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"secret": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_json",
"retryable": true,
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"required": "<string>",
"region": "<string>",
"field": "email",
"contactId": "<string>",
"callId": "<string>",
"reason": "<string>"
}Store the returned whsec_ secret securely. Read the destination list for its remaining fields. The default timeout is 10 seconds.
Related pages
Authorizations
An API key (tars_sk_…) sent as Authorization: Bearer <key>. Each operation names the permission it needs. Create keys in Settings → Integrations → API keys.
Body
application/json
A new webhook destination.
A public https URL.
Maximum string length:
2048Where events come from: "all", or the chat agents, voice agents and campaigns to receive events from.
Minimum array length:
1Available options:
conversation.started, conversation.ended, conversation.analyzed, call.transcript_updated, call.transfer_ringing, call.transfer_connected, call.transfer_bridged, call.transfer_failed, call.transfer_cancelled, call.guardrail_triggered, call.sms_sent, call.continued_in_chat, handoff.requested, handoff.accepted, handoff.unmet, handoff.completed, campaign.message_sent, campaign.message_delivered, campaign.message_read, campaign.message_replied, campaign.message_failed, campaign.completed, contact.created, contact.updated Maximum string length:
80Required range:
1000 <= x <= 30000⌘I
