Passer au contenu principal
PUT
/
v2
/
api
/
webhooks
/
{webhook_id}
Update webhook
curl --request PUT \
  --url https://api.withallo.com/v2/api/webhooks/{webhook_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "topics": [
    "call.received",
    "call.completed"
  ],
  "enabled": false
}
'
import requests

url = "https://api.withallo.com/v2/api/webhooks/{webhook_id}"

payload = {
    "topics": ["call.received", "call.completed"],
    "enabled": False
}
headers = {
    "Authorization": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({topics: ['call.received', 'call.completed'], enabled: false})
};

fetch('https://api.withallo.com/v2/api/webhooks/{webhook_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.withallo.com/v2/api/webhooks/{webhook_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'topics' => [
        'call.received',
        'call.completed'
    ],
    'enabled' => false
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <api-key>",
    "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.withallo.com/v2/api/webhooks/{webhook_id}"

	payload := strings.NewReader("{\n  \"topics\": [\n    \"call.received\",\n    \"call.completed\"\n  ],\n  \"enabled\": false\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "<api-key>")
	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.put("https://api.withallo.com/v2/api/webhooks/{webhook_id}")
  .header("Authorization", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"topics\": [\n    \"call.received\",\n    \"call.completed\"\n  ],\n  \"enabled\": false\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.withallo.com/v2/api/webhooks/{webhook_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"topics\": [\n    \"call.received\",\n    \"call.completed\"\n  ],\n  \"enabled\": false\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "ep_2NfDKEm9sF8xK3pQr1Zt",
    "url": "https://example.com/webhooks/allo",
    "topics": [
      "call.received",
      "sms.received"
    ],
    "description": "Production event stream",
    "enabled": true,
    "created_at": "2026-04-21T14:30:00Z"
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "retryable": true,
    "request_id": "<string>",
    "retry_after_seconds": 123
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "retryable": true,
    "request_id": "<string>",
    "retry_after_seconds": 123
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "retryable": true,
    "request_id": "<string>",
    "retry_after_seconds": 123
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "retryable": true,
    "request_id": "<string>",
    "retry_after_seconds": 123
  }
}
Scope requis : WEBHOOKS_READ_WRITE
Met à jour un endpoint webhook. Seuls les champs envoyés sont modifiés ; les champs omis restent inchangés. Envoyez enabled: false pour suspendre les livraisons sans supprimer l’endpoint.

Autorisations

Authorization
string
header
requis

Paramètres de chemin

webhook_id
string
requis

The webhook endpoint ID (e.g. "ep_2NfDKEm9sF8xK3pQr1Zt").

Exemple:

"ep_2NfDKEm9sF8xK3pQr1Zt"

Corps

application/json

All fields optional. Only the fields you provide are changed.

url
string<uri>

New HTTPS delivery URL.

topics
enum<string>[]

Replacement set of event topics.

An event topic. See the Event Catalog for payloads.

Options disponibles:
call.received,
call.triggered,
call.answered,
call.completed,
tag.added,
tag.removed,
sms.received,
sms.sent,
contact.created,
contact.updated,
summary.updated
description
string

New label.

enabled
boolean

Enable or disable the endpoint.

Réponse

Webhook updated

data
object

A webhook endpoint.