Webhooks
Create Webhook Endpoint
Add a webhook endpoint with POST /api/webhooks. The response holds the signing secret, which is only returned once.
POST
/
api
/
webhooks
Create Webhook Endpoint
curl --request POST \
--url https://octanist.com/api/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"url": "https://crm.example.com/webhooks/octanist",
"events": [
"lead.created",
"lead.status_changed"
],
"description": "CRM sync"
}
'import requests
url = "https://octanist.com/api/webhooks"
payload = {
"url": "https://crm.example.com/webhooks/octanist",
"events": ["lead.created", "lead.status_changed"],
"description": "CRM sync"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://crm.example.com/webhooks/octanist',
events: ['lead.created', 'lead.status_changed'],
description: 'CRM sync'
})
};
fetch('https://octanist.com/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://octanist.com/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://crm.example.com/webhooks/octanist',
'events' => [
'lead.created',
'lead.status_changed'
],
'description' => 'CRM sync'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://octanist.com/api/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://crm.example.com/webhooks/octanist\",\n \"events\": [\n \"lead.created\",\n \"lead.status_changed\"\n ],\n \"description\": \"CRM sync\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://octanist.com/api/webhooks")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://crm.example.com/webhooks/octanist\",\n \"events\": [\n \"lead.created\",\n \"lead.status_changed\"\n ],\n \"description\": \"CRM sync\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octanist.com/api/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://crm.example.com/webhooks/octanist\",\n \"events\": [\n \"lead.created\",\n \"lead.status_changed\"\n ],\n \"description\": \"CRM sync\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "9b2f1c4e-6a1d-4f7e-9a51-2c8f0f3d1a77",
"url": "https://crm.example.com/webhooks/octanist",
"description": "CRM sync",
"events": [
"lead.created",
"lead.status_changed"
],
"enabled": true,
"disabledReason": null,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}Adds an endpoint that receives the events you choose. The response includes the signing secret (
An organization can have up to 10 endpoints.
whsec_...): store it, because it is only returned here. See Webhooks for the payload and how to verify the signature.
Needs an API key with full access.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | HTTPS URL on a public host, up to 2048 characters. |
events | string[] | Yes | One or more of lead.created, lead.status_changed and lead.updated. |
description | string | No | A note for yourself, up to 200 characters. |
Example Request
curl -X POST \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://crm.example.com/webhooks/octanist",
"events": ["lead.created", "lead.status_changed"],
"description": "CRM sync"
}' \
"https://octanist.com/api/webhooks"
Example Response
{
"success": true,
"data": {
"id": "9b2f1c4e-6a1d-4f7e-9a51-2c8f0f3d1a77",
"url": "https://crm.example.com/webhooks/octanist",
"description": "CRM sync",
"events": ["lead.created", "lead.status_changed"],
"enabled": true,
"disabledReason": null,
"createdAt": "2026-11-30T10:00:00.000Z",
"updatedAt": "2026-11-30T10:00:00.000Z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-11-30T10:00:00.000Z"
}
}
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_ERROR | The URL is not HTTPS, points to a private address or cannot be found; no or unknown events; already 10 endpoints. |
| 403 | FORBIDDEN | The API key is read-only. |
Body
application/json
⌘I
Create Webhook Endpoint
curl --request POST \
--url https://octanist.com/api/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"url": "https://crm.example.com/webhooks/octanist",
"events": [
"lead.created",
"lead.status_changed"
],
"description": "CRM sync"
}
'import requests
url = "https://octanist.com/api/webhooks"
payload = {
"url": "https://crm.example.com/webhooks/octanist",
"events": ["lead.created", "lead.status_changed"],
"description": "CRM sync"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://crm.example.com/webhooks/octanist',
events: ['lead.created', 'lead.status_changed'],
description: 'CRM sync'
})
};
fetch('https://octanist.com/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://octanist.com/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://crm.example.com/webhooks/octanist',
'events' => [
'lead.created',
'lead.status_changed'
],
'description' => 'CRM sync'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://octanist.com/api/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://crm.example.com/webhooks/octanist\",\n \"events\": [\n \"lead.created\",\n \"lead.status_changed\"\n ],\n \"description\": \"CRM sync\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://octanist.com/api/webhooks")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://crm.example.com/webhooks/octanist\",\n \"events\": [\n \"lead.created\",\n \"lead.status_changed\"\n ],\n \"description\": \"CRM sync\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octanist.com/api/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://crm.example.com/webhooks/octanist\",\n \"events\": [\n \"lead.created\",\n \"lead.status_changed\"\n ],\n \"description\": \"CRM sync\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "9b2f1c4e-6a1d-4f7e-9a51-2c8f0f3d1a77",
"url": "https://crm.example.com/webhooks/octanist",
"description": "CRM sync",
"events": [
"lead.created",
"lead.status_changed"
],
"enabled": true,
"disabledReason": null,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}