Update a webhook
curl --request PATCH \
--url https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"topics": [
"<string>"
],
"enabled": true,
"description": "<string>"
}
'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}"
payload = {
"url": "<string>",
"topics": ["<string>"],
"enabled": True,
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', topics: ['<string>'], enabled: true, description: '<string>'})
};
fetch('https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}', 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.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'topics' => [
'<string>'
],
'enabled' => true,
'description' => '<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.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"topics\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"topics\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"topics\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "webhook",
"createdAt": "<string>",
"url": "<string>",
"topics": [
"<string>"
],
"enabled": true,
"description": "<string>",
"consecutiveFailures": 0,
"cooldownUntil": "<string>",
"autoDisabledAt": "<string>",
"secret": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Webhooks
Update a webhook
PATCH
/
v2
/
projects
/
{projectId}
/
environments
/
{environmentId}
/
webhooks
/
{id}
Update a webhook
curl --request PATCH \
--url https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"topics": [
"<string>"
],
"enabled": true,
"description": "<string>"
}
'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}"
payload = {
"url": "<string>",
"topics": ["<string>"],
"enabled": True,
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', topics: ['<string>'], enabled: true, description: '<string>'})
};
fetch('https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}', 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.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'topics' => [
'<string>'
],
'enabled' => true,
'description' => '<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.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"topics\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"topics\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"topics\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "webhook",
"createdAt": "<string>",
"url": "<string>",
"topics": [
"<string>"
],
"enabled": true,
"description": "<string>",
"consecutiveFailures": 0,
"cooldownUntil": "<string>",
"autoDisabledAt": "<string>",
"secret": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Authorizations
Body
application/json
Topic subscriptions: "*" (everything); "event.tracked" (all behavior events) or "event.tracked." for one; "content" / "content.published"; "user" or "user.created" / "user.updated" / "user.deleted"; "company" or "company.created" / "company.updated" / "company.deleted". A bare family name also covers topics added to it later. High-volume events (page_viewed) are excluded from the wildcard forms and must be subscribed explicitly.
Required array length:
1 - 100 elementsRequired string length:
1 - 200Response
Webhook updated