Petnow LogoPetnow

Webhooks Overview

Receive the result of a registration, verification, or identification job at your server as a signed HTTPS event, instead of polling.

What are webhooks?

Registration, verification, and identification are asynchronous jobs. Without webhooks, your server polls the job until it leaves PENDING. With webhooks, Petify sends one signed HTTPS POST to your server when a job finishes, with the result in the body.

Webhooks are available on every plan. You set them up yourself in the Petify Console.

Webhooks do not replace the job endpoints. The poll endpoint (GET /v2/.../jobs/{jobId}) stays the authoritative source for a job's status. Use webhooks to learn about results sooner, and poll to recover anything you missed. See Delivery & Retries.

Jobs created by a hosted session send no webhook events today. Sessions issued for Web Integration (link or server integration) complete through the redirect and the result code instead. Webhooks cover jobs you create through the Server API.

How it works

  1. Your server starts a job through the API, as before.
  2. When the job reaches SUCCESS or FAILED, Petify sends an event to every enabled endpoint that subscribes to that event type.
  3. Your endpoint verifies the signature, processes the event, and answers with a 2xx status.
  4. If your endpoint does not answer 2xx, Petify retries on a fixed schedule.

Quick start in the Console

  1. Build an HTTPS endpoint that accepts POST requests with a JSON body. Start from the signature verification samples.
  2. In the Petify Console, open Integration and select the Webhooks tab.
  3. Click Add endpoint.
  4. Enter the Endpoint URL. Optionally add a Description (up to 200 characters).
  5. Under Events, select the event types you want, or select All events (including ones added later). Select at least one.
  6. Click Add endpoint to save. The Console shows the signing secret (whsec_...) once in a dialog. Copy it and store it safely, for example in your secret manager.
  7. Open the endpoint and click Send test event. Petify sends one signed webhook.test event and shows whether your endpoint answered with a 2xx status.

You can read the signing secret again at any time: open the endpoint and click Reveal secret.

Manage endpoints

ActionWhat it does
Add endpointCreates an endpoint that starts enabled, with a new signing secret.
EditChanges the URL, description, or subscribed events. The signing secret stays the same. A subscription change applies to events sent after you save.
Enabled switchTurns the endpoint on or off. While it is off, matching events are recorded as Skipped and not sent. See Disabled endpoints.
Reveal secret / Rotate secretShows the current signing secret, or creates a new one. After a rotation the previous secret keeps signing for 24 hours. See Rotating the secret.
Send test eventSends one signed webhook.test event now, even if the endpoint is disabled. It is not retried and does not appear in the delivery log.
DeleteRemoves the endpoint and its delivery log. This cannot be undone.

Endpoint requirements and limits

ItemRule
URL schemehttps only.
HostMust be reachable from the public internet. Private and local addresses (for example localhost or 10.x.x.x) are refused.
URL lengthUp to 500 characters.
DescriptionOptional, up to 200 characters.
Endpoints per accountUp to 5. Delete one to add another.
RedirectsNot followed. A 3xx answer counts as a failed attempt.
Response timeAnswer within 10 seconds.
Request headersUser-Agent: Petify-Webhooks/1, plus the signature headers.

If several endpoints subscribe to the same event type, each one receives the event with the same body and the same webhook-id.

Next steps

On this page