Create Agent Webhook
curl --request POST \
--url https://api.tess.im/agents/{id}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"url": "<string>",
"method": "<string>",
"status": "<string>"
}
'import requests
url = "https://api.tess.im/agents/{id}/webhooks"
payload = {
"url": "<string>",
"method": "<string>",
"status": "<string>"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', method: '<string>', status: '<string>'})
};
fetch('https://api.tess.im/agents/{id}/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://api.tess.im/agents/{id}/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>',
'method' => '<string>',
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.tess.im/agents/{id}/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
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.tess.im/agents/{id}/webhooks")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/agents/{id}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAgent Webhooks
Create Agent Webhook
Create a new webhook for a specific agent.
POST
/
agents
/
{id}
/
webhooks
Create Agent Webhook
curl --request POST \
--url https://api.tess.im/agents/{id}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"url": "<string>",
"method": "<string>",
"status": "<string>"
}
'import requests
url = "https://api.tess.im/agents/{id}/webhooks"
payload = {
"url": "<string>",
"method": "<string>",
"status": "<string>"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', method: '<string>', status: '<string>'})
};
fetch('https://api.tess.im/agents/{id}/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://api.tess.im/agents/{id}/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>',
'method' => '<string>',
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.tess.im/agents/{id}/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
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.tess.im/agents/{id}/webhooks")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/agents/{id}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCode Examples
curl --request POST \
--url 'https://api.tess.im/agents/{id}/webhooks' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'x-workspace-id: YOUR_WORKSPACE_ID' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/webhook",
"method": "POST",
"status": "active"
}'
const axios = require('axios');
const data = {
url: 'https://example.com/webhook',
method: 'POST',
status: 'active'
};
const config = {
method: 'post',
url: 'https://api.tess.im/agents/{id}/webhooks',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'x-workspace-id': 'YOUR_WORKSPACE_ID',
'Content-Type': 'application/json'
},
data: data
};
try {
const response = await axios(config);
console.log(response.data);
} catch (error) {
console.error(error);
}
import requests
import json
url = "https://api.tess.im/agents/{id}/webhooks"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"x-workspace-id": "YOUR_WORKSPACE_ID",
"Content-Type": "application/json"
}
data = {
"url": "https://example.com/webhook",
"method": "POST",
"status": "active"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
<?php
$curl = curl_init();
$data = [
'url' => 'https://example.com/webhook',
'method' => 'POST',
'status' => 'active'
];
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/agents/{id}/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($data),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"x-workspace-id: YOUR_WORKSPACE_ID",
"Content-Type: application/json"
]
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Error: " . $err;
} else {
echo $response;
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String data = "{\"url\":\"https://example.com/webhook\",\"method\":\"POST\",\"status\":\"active\"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.tess.im/agents/{id}/webhooks"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("x-workspace-id", "YOUR_WORKSPACE_ID")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(data))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
data := map[string]string{
"url": "https://example.com/webhook",
"method": "POST",
"status": "active",
}
jsonData, err := json.Marshal(data)
if err != nil {
fmt.Println(err)
return
}
client := &http.Client{}
req, err := http.NewRequest("POST", "https://api.tess.im/agents/{id}/webhooks", bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
req.Header.Add("x-workspace-id", "YOUR_WORKSPACE_ID")
req.Header.Add("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
client.DefaultRequestHeaders.Add("x-workspace-id", "YOUR_WORKSPACE_ID");
var data = new StringContent(
"{\"url\":\"https://example.com/webhook\",\"method\":\"POST\",\"status\":\"active\"}",
Encoding.UTF8,
"application/json"
);
try
{
var response = await client.PostAsync("https://api.tess.im/agents/{id}/webhooks", data);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch(HttpRequestException e)
{
Console.WriteLine("\nException Caught!");
Console.WriteLine("Message :{0} ",e.Message);
}
}
}
}
require 'uri'
require 'net/http'
require 'json'
uri = URI('https://api.tess.im/agents/{id}/webhooks')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['x-workspace-id'] = 'YOUR_WORKSPACE_ID'
request['Content-Type'] = 'application/json'
request.body = {
url: 'https://example.com/webhook',
method: 'POST',
status: 'active'
}.to_json
response = http.request(request)
puts response.read_body
Headers
integer
required
Workspace ID. Required as of 2026-09-01. Until then, if omitted, the user’s selected workspace is used (deprecated). After the cutoff, a missing header returns 422.
Path Parameters
integer
required
The agent ID
Body Parameters
string
required
The URL that will receive webhook notifications
string
required
The HTTP method to use for the webhook (POST)
string
The status of the webhook (active or inactive)
Response
{
"template_id": 8794,
"user_id": 0,
"url": "https://webhook.site/3bea4d55-0734-4bbd-aab9-95639585e539",
"method": "POST",
"status": "active",
"updated_at": "2025-01-05T23:35:20.000000Z",
"created_at": "2025-01-05T23:35:20.000000Z",
"id": 18
}
⌘I