Send a test webhook
curl --request POST \
--url https://api.usecobalt.com/v1/webhook/test \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>'import requests
url = "https://api.usecobalt.com/v1/webhook/test"
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {client_id: '<api-key>', client_secret: '<api-key>', access_token: '<api-key>'}
};
fetch('https://api.usecobalt.com/v1/webhook/test', 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.usecobalt.com/v1/webhook/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"access_token: <api-key>",
"client_id: <api-key>",
"client_secret: <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"
"net/http"
"io"
)
func main() {
url := "https://api.usecobalt.com/v1/webhook/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("client_id", "<api-key>")
req.Header.Add("client_secret", "<api-key>")
req.Header.Add("access_token", "<api-key>")
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.usecobalt.com/v1/webhook/test")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/webhook/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client_id"] = '<api-key>'
request["client_secret"] = '<api-key>'
request["access_token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"webhook_urls_count": 123,
"event": {}
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Webhooks
Send Test Webhook
Sends a test webhook event to verify your integration is working correctly.
POST
/
webhook
/
test
Send a test webhook
curl --request POST \
--url https://api.usecobalt.com/v1/webhook/test \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>'import requests
url = "https://api.usecobalt.com/v1/webhook/test"
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {client_id: '<api-key>', client_secret: '<api-key>', access_token: '<api-key>'}
};
fetch('https://api.usecobalt.com/v1/webhook/test', 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.usecobalt.com/v1/webhook/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"access_token: <api-key>",
"client_id: <api-key>",
"client_secret: <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"
"net/http"
"io"
)
func main() {
url := "https://api.usecobalt.com/v1/webhook/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("client_id", "<api-key>")
req.Header.Add("client_secret", "<api-key>")
req.Header.Add("access_token", "<api-key>")
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.usecobalt.com/v1/webhook/test")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/webhook/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client_id"] = '<api-key>'
request["client_secret"] = '<api-key>'
request["access_token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"webhook_urls_count": 123,
"event": {}
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Sends a
401 - Invalid Access Token
401 - Access Token Mismatch
test.event webhook to all configured webhook URLs for your client. Use this endpoint to:
- Verify your webhook endpoint is receiving events correctly
- Test your webhook signature verification logic
- Validate your event processing pipeline
- Debug webhook delivery issues
test.event type.
Prerequisites
You must have at least one webhook URL configured before sending a test event. If you haven’t configured a webhook URL yet, use the Create Webhook endpoint first.Example Request
curl -X POST https://api.usecobalt.com/v1/webhook/test \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: at_live_abc123def456'
Example Response
{
"success": true,
"message": "Test webhook sent to 2 URL(s)",
"webhook_urls_count": 2,
"event": {
"id": "test-event-1703172600000",
"access_token_reference_id": "your-reference-id",
"object": "event",
"created": "2025-10-21T14:30:00.000Z",
"type": "test.event",
"data": {
"message": "This is a test webhook event",
"timestamp": "2025-10-21T14:30:00.000Z"
}
}
}
What Your Webhook Endpoint Will Receive
Your webhook endpoint will receive the test event with a signature header that you should verify:{
"id": "test-event-1703172600000",
"access_token_reference_id": "your-reference-id",
"object": "event",
"created": "2025-10-21T14:30:00.000Z",
"type": "test.event",
"data": {
"message": "This is a test webhook event",
"timestamp": "2025-10-21T14:30:00.000Z"
}
}
The test webhook will be signed with your webhook secret key. Make sure to verify the
cobalt-verification header to ensure the webhook is authentic. See Receiving Webhooks for signature verification details.Common Use Cases
Verify Initial Setup
Verify Initial Setup
After configuring your first webhook URL, send a test event to confirm your endpoint is reachable and processing webhooks correctly.
Test After Code Changes
Test After Code Changes
After updating your webhook handler code, send a test event to verify your changes work as expected before going live.
Debug Delivery Issues
Debug Delivery Issues
If you’re not receiving production webhooks, send a test event to isolate whether the issue is with your endpoint or with specific event types.
Validate Signature Verification
Validate Signature Verification
Send a test event and verify the
cobalt-verification header to ensure your signature verification logic is working correctly.Error Responses
404 - No Webhook URLs Configured{
"success": false,
"message": "No webhook URLs configured. Please add a webhook URL first using POST /v1/webhook."
}
{
"success": false,
"message": "Invalid access token"
}
{
"success": false,
"message": "Access token does not belong to this client"
}