Skip to main content
POST
/
v2
/
api
/
webhooks
Create webhook
curl --request POST \
  --url https://api.withallo.com/v2/api/webhooks \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://example.com/webhooks/allo",
  "topics": [
    "call.received",
    "sms.received"
  ],
  "description": "Production event stream"
}
'
import requests

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

payload = {
"url": "https://example.com/webhooks/allo",
"topics": ["call.received", "sms.received"],
"description": "Production event stream"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhooks/allo',
topics: ['call.received', 'sms.received'],
description: 'Production event stream'
})
};

fetch('https://api.withallo.com/v2/api/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.withallo.com/v2/api/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' => 'https://example.com/webhooks/allo',
'topics' => [
'call.received',
'sms.received'
],
'description' => 'Production event stream'
]),
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"

payload := strings.NewReader("{\n \"url\": \"https://example.com/webhooks/allo\",\n \"topics\": [\n \"call.received\",\n \"sms.received\"\n ],\n \"description\": \"Production event stream\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.withallo.com/v2/api/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhooks/allo\",\n \"topics\": [\n \"call.received\",\n \"sms.received\"\n ],\n \"description\": \"Production event stream\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhooks/allo\",\n \"topics\": [\n \"call.received\",\n \"sms.received\"\n ],\n \"description\": \"Production event stream\"\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,
    "signing_secret": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD",
    "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
}
}
Required scope: WEBHOOKS_READ_WRITE
Creates a webhook endpoint subscribed to one or more event topics.
  • url must be a publicly reachable HTTPS URL.
  • topics must contain at least one valid event type. Unknown topics return a 400 with code INVALID_EVENT_TYPE.
  • The signing_secret is returned only in this response. Store it to verify signatures.

Authorizations

Authorization
string
header
required

Body

application/json
url
string<uri>
required

HTTPS URL that will receive event deliveries.

topics
enum<string>[]
required

Event topics to subscribe to (at least one).

An event topic. See the Event Catalog for payloads.

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

Optional human-readable label.

Response

Webhook created

data
object

A webhook endpoint.