Register a webhook endpoint
Registers a destination for this brand’s events and mints its signing secret.
The 201 body carries the secret in plain text, and that is the only
time it is ever shown: store it where your receiver can read it before
you finish the call. Verify with any Standard Webhooks library.
The URL is checked here so an unusable one is refused synchronously rather than becoming silent delivery failures — but the check is a courtesy, not the boundary: every attempt re-checks the address it is actually about to connect to, so a name that resolves somewhere else later is still refused then.
Cleartext endpoints are never deliverable: http:// is refused here
and the scheme is checked again before every attempt. Loopback and
private addresses are refused too, so a receiver running only on
localhost cannot use webhooks. Use GET /v1/streams/events while developing
locally, until you have a public TLS endpoint.
Body ParametersJSON
Where to POST events. Must be absolute and https, and must not carry
credentials in the url.
What is checked WHEN. Registration refuses the faults that are visible in the url itself: the scheme, credentials, and a literal IP address that is private, loopback or link-local. It does NOT resolve hostnames, so a NAME pointing at a private address is accepted here and refused later, at every delivery attempt, when the address it actually resolves to is checked immediately before the connection is made. That second check is the one that is load-bearing, and it cannot be done at registration: a name can resolve differently a second after you register it.
So a synchronous 422 means the url can never work. A 201 means it
looked fine — watch the endpoint’s health for what happened next.
Your own label for this endpoint. Text a human reads: control characters are refused.
The event kinds to deliver here. Omit it — or send an empty array — for
every kind, including kinds added later, which is what most integrations
want. Kinds are the same values the stream’s event: carries.
The phone numbers whose events to deliver here. Omit it — or send an
empty array — for every current and future number, which is what most
integrations want. A non-empty list names exact phone-number ids from
GET /v1/phone_numbers for this account and mode. An id this account
cannot use — unknown, belonging to another account or to the other mode,
or not an active number of this account — is refused with HTTP 422
(webhook_phone_number_not_found) pointered at the list,
/phone_number_ids, never at the id, so the refusal discloses nothing
about whose number it is; only an id that is malformed (empty, or over
128 bytes) is pointered at its own index, /phone_number_ids/{i}, before
any lookup. Nothing is created. Account-wide events that carry no phone
number go only to an unscoped endpoint.
Register a webhook endpoint
curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \
-d '{
"url": "url"
}'{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"disabled_at": "2019-12-27T18:11:19.117Z",
"event_kinds": [
"string"
],
"health": {
"consecutive_failures": 0,
"last_failure_at": "2019-12-27T18:11:19.117Z",
"last_failure_reason": "last_failure_reason",
"last_failure_status": 0,
"last_success_at": "2019-12-27T18:11:19.117Z"
},
"secret": "secret",
"secret_id": "secret_id",
"status": "status",
"updated_at": "2019-12-27T18:11:19.117Z",
"url": "url",
"backlog_dropped": 0,
"backlog_resume_cursor": "backlog_resume_cursor",
"description": "description",
"phone_number_ids": [
"string"
]
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"disabled_at": "2019-12-27T18:11:19.117Z",
"event_kinds": [
"string"
],
"health": {
"consecutive_failures": 0,
"last_failure_at": "2019-12-27T18:11:19.117Z",
"last_failure_reason": "last_failure_reason",
"last_failure_status": 0,
"last_success_at": "2019-12-27T18:11:19.117Z"
},
"secret": "secret",
"secret_id": "secret_id",
"status": "status",
"updated_at": "2019-12-27T18:11:19.117Z",
"url": "url",
"backlog_dropped": 0,
"backlog_resume_cursor": "backlog_resume_cursor",
"description": "description",
"phone_number_ids": [
"string"
]
}