Skip to main content
PATCH
/
radar
/
operator
/
v1
/
webhooks
Update webhook configuration
curl --request PATCH \
  --url https://api.snitcher.com/radar/operator/v1/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "delivery": {
    "webhook_url": "https://example.com/webhook",
    "webhook_secret": "my-little-secret"
  },
  "event_aggregation": "per_session"
}
'
import requests

url = "https://api.snitcher.com/radar/operator/v1/webhooks"

payload = {
    "delivery": {
        "webhook_url": "https://example.com/webhook",
        "webhook_secret": "my-little-secret"
    },
    "event_aggregation": "per_session"
}
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({
    delivery: {webhook_url: 'https://example.com/webhook', webhook_secret: 'my-little-secret'},
    event_aggregation: 'per_session'
  })
};

fetch('https://api.snitcher.com/radar/operator/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://api.snitcher.com/radar/operator/v1/webhooks",
  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([
    'delivery' => [
        'webhook_url' => 'https://example.com/webhook',
        'webhook_secret' => 'my-little-secret'
    ],
    'event_aggregation' => 'per_session'
  ]),
  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.snitcher.com/radar/operator/v1/webhooks"

	payload := strings.NewReader("{\n  \"delivery\": {\n    \"webhook_url\": \"https://example.com/webhook\",\n    \"webhook_secret\": \"my-little-secret\"\n  },\n  \"event_aggregation\": \"per_session\"\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.snitcher.com/radar/operator/v1/webhooks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"delivery\": {\n    \"webhook_url\": \"https://example.com/webhook\",\n    \"webhook_secret\": \"my-little-secret\"\n  },\n  \"event_aggregation\": \"per_session\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.snitcher.com/radar/operator/v1/webhooks")

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  \"delivery\": {\n    \"webhook_url\": \"https://example.com/webhook\",\n    \"webhook_secret\": \"my-little-secret\"\n  },\n  \"event_aggregation\": \"per_session\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": [
    {
      "delivery": {
        "webhook_url": "<string>",
        "signature": "<string>"
      },
      "event_aggregation": "per_session"
    }
  ],
  "message": "Webhook configuration updated successfully"
}

Authorizations

Authorization
string
header
required

Enter your personal access token (PAT) to authenticate

Body

application/json

Webhook configuration parameters

delivery
object

Webhook delivery configuration

event_aggregation
enum<string>

Delivery mode. per_session (recommended) groups all events of a session into one payload sent after the session ends. per_event pushes each event in near real-time. per_event is not available while identifications are enabled.

Available options:
per_event,
per_session
Example:

"per_session"

Response

Webhook configuration updated successfully

success
boolean
Example:

true

data
object[]
message
string
Example:

"Webhook configuration updated successfully"