Skip to main content
POST
Create a webhook endpoint

Authorizations

Authorization
string
header
required

The API key, created in Settings › API, in the header Authorization: Bearer . The default.

Headers

Idempotency-Key
string

Up to 255 characters. Repeat the key with the same body within 24 hours and you get the same response plus an Idempotent-Replayed header set to true. 402, 409, 429 and 5xx responses (except send_outcome_unknown) are not stored: fix the cause and retry with the same key.

Required string length: 1 - 255

Body

application/json

An endpoint belongs to one agent: send text_agent_id or voice_agent_id, exactly one. A text agent listens for lead and message events and a voice agent for call events. Each agent has at most 3 active endpoints.

url
string<uri>
required

https only. It cannot point to a private address, and redirects are not followed.

Maximum string length: 2048
Pattern: ^https://
Example:

"https://n8n.example.com/webhook/newlead"

events
enum<string>[]
required
Minimum array length: 1

call.* events belong to voice agents; the others belong to text agents. What each event carries and how to verify the signature are at https://docs.newlead.ai/webhook-events.

Available options:
call.started,
call.rejected,
call.ended,
call.analyzed,
lead.created,
lead.qualified,
lead.appointment_booked,
lead.handoff,
follow_up.sent,
message.received,
message.failed
text_agent_id
string<uuid>
voice_agent_id
string<uuid>
description
string
Maximum string length: 200

Response

The endpoint, with its secret. This is the only time you see it.

The newly created endpoint, with its secret. This is the only time you see it.

object
string
required
Allowed value: "webhook_endpoint"
id
string<uuid>
required
url
string<uri>
required
events
enum<string>[]
required

call.* events belong to voice agents; the others belong to text agents. What each event carries and how to verify the signature are at https://docs.newlead.ai/webhook-events.

Available options:
call.started,
call.rejected,
call.ended,
call.analyzed,
lead.created,
lead.qualified,
lead.appointment_booked,
lead.handoff,
follow_up.sent,
message.received,
message.failed
text_agent_id
string<uuid> | null
required

The endpoint's text agent, or null if it belongs to a voice agent.

voice_agent_id
string<uuid> | null
required

The endpoint's voice agent, or null if it belongs to a text agent.

description
string | null
required
active
boolean
required

false: paused, receives no deliveries. It pauses itself after 20 consecutive failed deliveries; when reactivated, consecutive_failures resets to 0.

last_success_at
string<date-time> | null
required
last_failure_at
string<date-time> | null
required
consecutive_failures
integer
required

Consecutive failed deliveries, each after its 13 attempts. Test deliveries do not count.

Required range: x >= 0
created_at
string<date-time>
required
secret
string
required

Only in the POST /webhook_endpoints response: the key that signs deliveries (X-Webhook-Signature header). Store it: it is never shown again.

Pattern: ^whsec_[0-9a-f]{64}$