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.
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"
}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"
}