Create a webhook endpoint
curl --request POST \
--url https://api.bevits.com/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.example.com/webhooks/bevits",
"events": [
"email.clicked",
"contact.unsubscribed"
],
"description": "ERP"
}
'import requests
url = "https://api.bevits.com/v1/webhook-endpoints"
payload = {
"url": "https://api.example.com/webhooks/bevits",
"events": ["email.clicked", "contact.unsubscribed"],
"description": "ERP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://api.example.com/webhooks/bevits',
events: ['email.clicked', 'contact.unsubscribed'],
description: 'ERP'
})
};
fetch('https://api.bevits.com/v1/webhook-endpoints', 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.bevits.com/v1/webhook-endpoints",
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://api.example.com/webhooks/bevits',
'events' => [
'email.clicked',
'contact.unsubscribed'
],
'description' => 'ERP'
]),
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.bevits.com/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"https://api.example.com/webhooks/bevits\",\n \"events\": [\n \"email.clicked\",\n \"contact.unsubscribed\"\n ],\n \"description\": \"ERP\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.bevits.com/v1/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.example.com/webhooks/bevits\",\n \"events\": [\n \"email.clicked\",\n \"contact.unsubscribed\"\n ],\n \"description\": \"ERP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/webhook-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.example.com/webhooks/bevits\",\n \"events\": [\n \"email.clicked\",\n \"contact.unsubscribed\"\n ],\n \"description\": \"ERP\"\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "wep_0mgc2k1a7000a1b2c3d4e5f6g7",
"url": "https://api.example.com/webhooks/bevits",
"description": "ERP",
"events": [
"email.clicked",
"contact.unsubscribed"
],
"status": "enabled",
"disabled_reason": null,
"api_version": "2026-11-23",
"livemode": true,
"failing_since": null,
"last_success_at": "2026-11-23T14:03:02.000Z",
"previous_secret_expires_at": null,
"created_at": "2026-11-23T12:00:00.000Z",
"updated_at": "2026-11-23T12:00:00.000Z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSwT4nGeGyXbmc="
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key does not have the required \"write\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "conflict",
"code": "duplicate_endpoint_url",
"message": "This URL is already registered: it would receive every event twice. Add the event types to the existing endpoint instead.",
"param": "url",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "validation_error",
"code": "unknown_event_type",
"message": "\"customer.unsubscribed\" is not a webhook event type. Did you mean \"contact.unsubscribed\"? GET /v1/webhook-event-types lists them.",
"param": "events[0]",
"suggestion": "contact.unsubscribed",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}Webhooks
Create a webhook endpoint
Registers an https URL to receive the event types in events, or [”*”] for all of them, including types added later. The response includes the signing secret (whsec_…) this one time. An organization has up to 20 endpoints. Requires an API key with the write scope.
POST
/
v1
/
webhook-endpoints
Create a webhook endpoint
curl --request POST \
--url https://api.bevits.com/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.example.com/webhooks/bevits",
"events": [
"email.clicked",
"contact.unsubscribed"
],
"description": "ERP"
}
'import requests
url = "https://api.bevits.com/v1/webhook-endpoints"
payload = {
"url": "https://api.example.com/webhooks/bevits",
"events": ["email.clicked", "contact.unsubscribed"],
"description": "ERP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://api.example.com/webhooks/bevits',
events: ['email.clicked', 'contact.unsubscribed'],
description: 'ERP'
})
};
fetch('https://api.bevits.com/v1/webhook-endpoints', 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.bevits.com/v1/webhook-endpoints",
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://api.example.com/webhooks/bevits',
'events' => [
'email.clicked',
'contact.unsubscribed'
],
'description' => 'ERP'
]),
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.bevits.com/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"https://api.example.com/webhooks/bevits\",\n \"events\": [\n \"email.clicked\",\n \"contact.unsubscribed\"\n ],\n \"description\": \"ERP\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.bevits.com/v1/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.example.com/webhooks/bevits\",\n \"events\": [\n \"email.clicked\",\n \"contact.unsubscribed\"\n ],\n \"description\": \"ERP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/webhook-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.example.com/webhooks/bevits\",\n \"events\": [\n \"email.clicked\",\n \"contact.unsubscribed\"\n ],\n \"description\": \"ERP\"\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "wep_0mgc2k1a7000a1b2c3d4e5f6g7",
"url": "https://api.example.com/webhooks/bevits",
"description": "ERP",
"events": [
"email.clicked",
"contact.unsubscribed"
],
"status": "enabled",
"disabled_reason": null,
"api_version": "2026-11-23",
"livemode": true,
"failing_since": null,
"last_success_at": "2026-11-23T14:03:02.000Z",
"previous_secret_expires_at": null,
"created_at": "2026-11-23T12:00:00.000Z",
"updated_at": "2026-11-23T12:00:00.000Z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSwT4nGeGyXbmc="
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key does not have the required \"write\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "conflict",
"code": "duplicate_endpoint_url",
"message": "This URL is already registered: it would receive every event twice. Add the event types to the existing endpoint instead.",
"param": "url",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "validation_error",
"code": "unknown_event_type",
"message": "\"customer.unsubscribed\" is not a webhook event type. Did you mean \"contact.unsubscribed\"? GET /v1/webhook-event-types lists them.",
"param": "events[0]",
"suggestion": "contact.unsubscribed",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}Headers
Body
application/json
Response
The endpoint, with the signing secret.