# POST /v1/webhook-endpoints Register an address for notices; its secret is shown once, in this answer. | Access | | | --- | --- | | Keys | secret only | | Plan | every plan | | Environment | live and sandbox | | Acts for | the account | | While the account is suspended | refused | | During a data stop | works | ## Headers | Name | Description | | --- | --- | | `Idempotency-Key` | A new random value for this action, such as a UUID. A repeat with the same value and the same request gets the first answer again, and nothing is saved twice ([idempotency](../../concepts/idempotency.md)). | ## Body | Field | Type | Description | | --- | --- | --- | | `url` | string | https://, with a host name, at most 2,048 characters. It must answer a ping with a 2xx. | | `eventTypes` | list of `saved_search.matches`, `favorite.listing_updated`, `favorite.listing_removed`, `listing.removed`, `account.suspended`, `account.reinstated`, `data.stale` | (optional) The notice types the endpoint receives. Left out when creating: all seven. | | `description` | string | (optional) A note of your own, 1 to 200 characters. | ```json { "url": "https://example.com/webhooks/apidata", "eventTypes": [ "saved_search.matches", "listing.removed" ], "description": "Production site" } ``` ## Answers ### 201: Registered. The answer holds the secret, this once The answer is `{ data, meta }`; `meta` holds `requestId` and `environment`. `data`: | Field | Type | Description | | --- | --- | --- | | `id` | string | "wh_…". | | `url` | string | The https:// address notices are sent to. It can not be changed. | | `eventTypes` | list of `saved_search.matches`, `favorite.listing_updated`, `favorite.listing_removed`, `listing.removed`, `account.suspended`, `account.reinstated`, `data.stale` | The notice types the endpoint receives. | | `description` | string or null | | | `enabled` | boolean | false pauses the endpoint: nothing is sent to it, and what it misses is not sent later. | | `createdAt` | string | | | `secret` | string | (not always present) "whsec_…": what signs requests to this endpoint. Shown this once; a repeat under the same Idempotency-Key leaves it out. | ## Errors | Status | Codes | | --- | --- | | 400 | [`validation_failed`](../../errors/validation_failed.md), [`webhook_destination_refused`](../../errors/webhook_destination_refused.md), [`webhook_ping_failed`](../../errors/webhook_ping_failed.md), [`webhook_url_invalid`](../../errors/webhook_url_invalid.md) | | 401 | [`invalid_api_key`](../../errors/invalid_api_key.md), [`key_revoked`](../../errors/key_revoked.md), [`missing_api_key`](../../errors/missing_api_key.md) | | 403 | [`account_pending`](../../errors/account_pending.md), [`account_suspended`](../../errors/account_suspended.md), [`origin_not_allowed`](../../errors/origin_not_allowed.md), [`secret_key_in_browser`](../../errors/secret_key_in_browser.md), [`secret_key_required`](../../errors/secret_key_required.md) | | 409 | [`idempotency_conflict`](../../errors/idempotency_conflict.md), [`limit_reached`](../../errors/limit_reached.md) | | 429 | [`rate_limited`](../../errors/rate_limited.md) | | 500 | [`internal_error`](../../errors/internal_error.md), [`temporarily_unavailable`](../../errors/temporarily_unavailable.md) | Every error has the same body, and says how to fix it ([responses and errors](../../concepts/responses-and-errors.md)). ## More ```json { "url": "https://example.com/webhooks/apidata", "eventTypes": ["saved_search.matches", "listing.removed"], "description": "Production site" } ``` A `url` that isn't `https://`, names an IP address instead of a host name, or holds a user name, a password or a fragment (`#…`) is [`400 webhook_url_invalid`](../../errors/webhook_url_invalid.md). Any other problem with the body is `400 validation_failed`, naming each field under `body.`. **Registration sends a ping.** Before anything is saved, the API: 1. resolves the host and checks that **every** address it resolves to is public. If not: [`400 webhook_destination_refused`](../../errors/webhook_destination_refused.md); 2. sends a signed [`ping`](../../concepts/webhooks.md#the-seven-types) to the URL and waits up to 10 seconds for a 2xx. If it doesn't get one: [`400 webhook_ping_failed`](../../errors/webhook_ping_failed.md), with `result` saying what happened (`timeout`, `http_status` with `statusCode`, `tls_failed`, `connection_failed` or `redirect_not_followed`). So your endpoint must be deployed and answering before you register it. This first ping is signed with the new secret, which you receive only in the answer, so it can't be verified. The rule for your endpoint ([in full](../../concepts/webhooks.md#receiving-a-webhook)): - **answer every `ping` with a 2xx**, whether or not its signature verifies, and never act on one. A ping is a request whose `ApiData-Event-Type` header is `ping`, and it carries nothing; - **until the secret is stored on your server, answer every other request `503`.** It is retried for 24 hours, so nothing is lost. A 2xx would mean "received", and that notice would never come again; - **once the secret is stored, verify every other request**, and answer one that fails `400`. This holds for a second endpoint as well: its registration ping is signed with its own new secret, not with one you already hold. **Deliveries start as soon as the endpoint is saved.** It receives every notice given out from then on, which can include one recorded a few seconds earlier, so store `secret` at once. To check that your verification works, send `POST …/{id}/test` and log whether its ping verified. Response `201`: the object, plus the secret. ```json { "id": "wh_…", "url": "https://example.com/webhooks/apidata", "eventTypes": ["saved_search.matches", "listing.removed"], "description": "Production site", "enabled": true, "createdAt": "2026-11-13T15:00:00.000Z", "secret": "whsec_…" } ``` **Store `secret` now.** It is never shown again, by any route. If you lose it, delete the endpoint and create it again. - The 11th endpoint of an account is `409 limit_reached`. - An account may make 10 registrations and tests in any 10 minutes, and two registrations at the same time. Past that: `429 rate_limited` with `Retry-After`. A request refused for its body or its URL doesn't count. - `Idempotency-Key` is accepted ([idempotency](../../concepts/idempotency.md)). A repeat of a registration that succeeded returns the same endpoint **without `secret`**: the secret is never kept where it could be shown again. If the first answer was lost, delete the endpoint and create it again. A repeat while the first request is still pinging is `409 idempotency_conflict`. - Refused with `403 account_suspended` while the account is suspended. _This page is made from the route's own declaration by `npm run openapi`. To change it, change the declaration or its explanation, never this file._