Create Webhook Endpoint
Register an HTTPS URL that receives outreach events. The signing secret is returned once.
curl --request POST \
--url https://api.aiclicks.io/api/v1/outreach/webhooks \
--header 'Authorization: Bearer ak_live_xxx' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://hooks.your-platform.com/aiclicks/outreach",
"events": ["opportunity.status_changed", "opportunity.action_needed", "opportunity.completed", "campaign.balance_low"],
"description": "Production outreach sync"
}'
import httpx, os
resp = httpx.post(
"https://api.aiclicks.io/api/v1/outreach/webhooks",
headers={"Authorization": f"Bearer {os.environ['AICLICKS_API_KEY']}"},
json={"url": "https://hooks.your-platform.com/aiclicks/outreach", "events": ["*"]},
)
resp.raise_for_status()
endpoint = resp.json()["data"]
print(endpoint["id"], endpoint["secret"]) # store the secret now
const resp = await fetch("https://api.aiclicks.io/api/v1/outreach/webhooks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AICLICKS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://hooks.your-platform.com/aiclicks/outreach",
events: ["*"],
}),
});
const { data } = await resp.json();
console.log(data.id, data.secret); // store the secret now
{
"data": {
"id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
"url": "https://hooks.your-platform.com/aiclicks/outreach",
"events": ["opportunity.status_changed", "opportunity.action_needed", "opportunity.completed", "campaign.balance_low"],
"campaign_id": null,
"description": "Production outreach sync",
"status": "enabled",
"last_delivery_at": "2026-12-04T10:30:00.000Z",
"last_delivery_status": 200,
"team_id": "2b1f8c3d-4a5e-4f10-9c21-3d8e5a6b7c90",
"secret": "whsec_4f9b2c1e8d7a6b5c4d3e2f1a0b9c8d7e2a1b3c4d5e6f7a8b",
"created_at": "2026-12-04T10:30:00.000Z"
},
"generated_at": "2026-12-04T10:30:00.080Z"
}
{
"detail": "Webhook URL is not allowed: Site must use https (credentials over http are insecure)"
}
Registers a URL that receives outreach events. AIclicks sends a ping event to the URL first. The endpoint is created only if your server answers the ping with a 2xx status within 10 seconds. A team can have up to 10 endpoints. Each endpoint can listen to all events or to a list of event types, and to all campaigns or to one campaign.
The response has the signing secret only once. Store it in your secret manager at once. If you lose it, delete the endpoint and create a new one.
Body parameters
The HTTPS URL that receives the events. Private and internal addresses are refused. It must answer the ping event with a 2xx status.
The event types to send, or ["*"] for all. Default ["*"].
Send only the events of this campaign. Default: all campaigns of the team.
The team that owns the endpoint. Required only for a master key (a key for all your teams) when you do not send campaign_id.
A label for the endpoint.
Errors
The URL is not HTTPS, an event type is unknown, the ping event failed, or the team already has 10 endpoints.