Skip to main content
Webhooks deliver real-time HTTP POST notifications to your endpoint when data changes in a Lofty account. Instead of polling the API, register an HTTPS callback URL and Lofty pushes a JSON payload on each subscribed event.

Subscribe

The response contains the subscription and its signing secret:
If the callbackUrl carries a query string (for example ?token=...) or uses http, the response also has a warnings array and the subscription is still created:
A token in the URL ends up in logs and proxies, and it proves neither the sender nor the body. Use the signature instead: see Verify webhook signatures. The warnings key is absent when there is nothing to report.
Store the secret now. It is shown only in this response and is never returned again — not by the list endpoint, not by a later call. If you lose it, rotate it. Use it to verify that each delivery comes from Lofty.
Use a publicly reachable https callbackUrl. An http URL is still accepted for now, and the create response then carries a CALLBACK_URL_NOT_HTTPS warning; we will announce in the changelog, ahead of time, before http stops being accepted for new subscriptions. URLs that carry credentials or point to internal or private addresses are rejected with WEBHOOK_CALLBACK_URL_INVALID. Subscriptions created earlier keep working unchanged.

Manage subscriptions

Verify webhook signatures

Deliveries of a signed subscription carry a signature, so your endpoint can check that the request really comes from Lofty and that nobody changed the body on the way. The signature follows the Standard Webhooks v1 scheme (HMAC-SHA256), so existing open-source verification libraries work with Lofty webhooks too. Do not rely on a secret in the callback URL for this. A URL ends up in server logs, proxies and browser history, and it does not prove that the body is unchanged.

Headers on signed deliveries

Every new subscription is signed. A subscription created earlier is signed once you rotate its secret; until then it receives no signature headers. The Lofty-Webhook-Id header stays as it was.

How to verify

  1. Read the raw request body as bytes, before any JSON parsing. A parsed and re-serialized body no longer matches the signature.
  2. Build the signed content: webhook-id + . + webhook-timestamp + . + the raw body.
  3. Take your secret without the whsec_ prefix, base64-decode it, and compute HMAC-SHA256 of the signed content with that key.
  4. Base64-encode the result and compare it with each v1 signature in webhook-signature. Use a constant-time comparison. One match is enough.
  5. Reject the request if webhook-timestamp is more than 5 minutes away from your clock. This stops someone from replaying an old, valid request.
Return 401 for a request that fails verification and do not process it.
Lofty does not retry a 4xx response (other than 429 and 410) — it discards the event; see Response handling. A receiver that rejects genuine deliveries because of a wrong or outdated secret therefore loses events. Check your verification against a real delivery, or log failures without rejecting, before you start returning 401.
Ping probes are signed in the same way, with a webhook-id that starts with probe-. If you verify signatures, answer a valid ping with 2xx as usual.
A receiver can only verify a request whose body it has not changed. In Express, read the body with express.raw() on the webhook route instead of express.json(); see the example receiver.

Rotate the secret

Call POST /v1.0/webhook/{subscribeId}/secret/rotate to get a new secret. An API key needs the Rotate a webhook signing secret permission (under Webhooks) for this call. It is a separate permission, and keys that can already create webhooks get it automatically. Do this when:
  • the subscription was created before signing existed and you want to switch signing on for it, or
  • a secret may have leaked.
The new secret is shown only in this response. The previous secret keeps signing for 7 days, until previousSecretExpiresAt. During that time every delivery carries a signature for both secrets, so you can switch without downtime: deploy the new secret, and the old one stops being needed. Only the user who created the subscription, or another user of the same integration (vendor) in the same team, can rotate its secret.
The rotate call has no request body, but like every non-GET call to the API it must still send Content-Type: application/json. Without it the API answers 400 with code 20001 (“Content-type must be: application/json”). The same applies to DELETE /v1.0/webhook/{subscribeId}.
Subscriptions created before signing existed are not signed and are not changed in any way: their deliveries stay exactly as they were, with no new headers. Calling the rotate endpoint once is what switches signing on for such a subscription, and from then on its deliveries carry the signature headers. That first rotation has no previous secret, so the response has no previousSecretExpiresAt and each delivery carries a single signature.

Custom authentication header

Some receivers sit behind an API gateway that only accepts a fixed credential, such as an Authorization header, and cannot check a signature. For them, add an authHeader when you create the subscription:
Lofty adds this header to every delivery and ping probe of that subscription, together with the signature headers. It is an addition, not a replacement: the signature is the only check that also proves the body was not changed. An invalid authHeader is rejected with INVALID_PARAMETER.

What changes for existing integrations

Nothing, unless you choose it. A subscription created before signing existed keeps receiving exactly the requests it receives today: same body, same URL, same headers, no signature. Signing starts for it only when you rotate its secret. If your callback URL already carries a token, it keeps working, and so does everything else you rely on today, such as Lofty-Webhook-Id for deduplication. New subscriptions are signed from the start. Each signed request carries about 200 bytes of extra headers, so a gateway that allows only a fixed list of request headers must allow webhook-id, webhook-timestamp and webhook-signature. We recommend signature verification over a token in the URL, but nothing forces you to move.

Delivery timing

Events to a healthy endpoint are typically delivered within 1 minute of the triggering change. Actual delivery speed depends on your endpoint. Lofty delivers to each endpoint over a limited number of concurrent connections, so a slow handler queues its own events: an endpoint that responds in under a second keeps up with any volume, while one that takes several seconds per request can fall minutes behind at peak — see the throughput note under Best practices. Failed deliveries follow the retry schedule below. Deliveries to a disabled subscription pause and resume automatically after recovery — see Health probes.

Retries and failure handling

A delivery counts as successful when your endpoint returns any 2xx status code. Any other response — an error status, a timeout, or a connection failure — is handled by the rules in this section.

Retry schedule

Failed deliveries are retried up to 9 total attempts within 48 hours, with exponential backoff between attempts: Each delay includes ±20% random jitter so retries from many events don’t arrive in synchronized bursts. An event that still cannot be delivered 48 hours after it was created is discarded.

Response handling

Idempotent delivery

Every delivery request carries a Lofty-Webhook-Id header, and a signed subscription also receives the same value in webhook-id. It is unique per event and stable across retries. If a timeout caused your response to be lost, the retry arrives with the same id — use it to deduplicate instead of processing the event twice. The webhook-timestamp header is the exception: it changes on each attempt.

Endpoint health and automatic disabling

Lofty tracks delivery health per subscription and disables a subscription automatically when:
  • your endpoint returns 410 Gone — immediately, or
  • deliveries fail continuously with no successes in between — within hours for high-volume endpoints, or after roughly a day of sustained failures otherwise.
While a subscription is disabled, Lofty stops attempting deliveries to it. Pending events wait for recovery but still expire 48 hours after creation.

Health probes and automatic recovery

Disabled subscriptions receive a ping probe approximately every 6 hours:
The first probe that gets a 2xx response re-enables the subscription, and all pending unexpired events are delivered immediately. No manual action is needed on either side.
Your receiver must return 2xx to ping probes. If your endpoint rejects unrecognized event types with an error status, a disabled subscription can never recover automatically. Acknowledge first, then ignore event types you don’t handle.

Notification recipients

Which subscribed users receive a callback depends on the subscription’s delivery mode (permissionMode). In both modes, only users in the lead’s team who have subscribed to the event type are considered.

Assignment-based delivery — permissionMode: 0 (default)

A subscriber receives the callback only for leads assigned to them or that they administer:
  • Hidden leads — only the assigned agent receives the notification.
  • Other leads — the subscriber receives it if they are the assigned agent, or a Company Owner / Company Admin. All other subscribers are excluded.

Ownership-based delivery — permissionMode: 1

A subscriber receives the callback for any lead they manage, regardless of who it is assigned to:
  • Every assignment-based case above still applies (assigned agent, Company Owner / Company Admin).
  • In addition, the subscriber receives the callback for any lead within their ownership scope — owned by their team or office, or personally owned by them — even if it is assigned to someone else.
  • Hidden leads are still delivered only to users who manage them.
Ownership-based mode is intended for team/account-level integrations that need to cover every lead in their scope, not only assigned leads. Set permissionMode when creating the subscription; it defaults to 0, so existing subscriptions are unaffected.

Payload structure

Every callback body is a JSON object with two common fields plus one or more action keys that carry the events. There is no generic events array: read the action keys for the subscription’s listId. Action keys by event type. Only the keys for actions that happened in the batch are present:
Normalize before iterating: updatedNote and deletedNote are objects and Listing Alert’s alertId is a number, so code that assumes every action key holds an array will skip or crash on them. The example receiver shows one way to handle this.
A ping probe is the exception to this structure: its body is {"eventType": "ping", "webhookId": 123456} (see Health probes).

Event types

Call, Email, and Text webhooks do not fire for AUTO communications. Only agent-initiated (MANUAL) and after-the-fact logged (LOGGED) events trigger webhooks. Automated messages sent by Lofty (drip campaigns, auto-responders, Smart Plans, etc.) are excluded. If your integration depends on tracking all communications, you must also poll the Communication API for AUTO type events.

Event payloads

1. Agent Info

Triggered when an agent is created or updated.

2. Lead Info

Triggered when a lead is created, updated, or deleted. Only the relevant action fields are present.

3. Lead Activity

Triggered when a lead performs site activity (SiteBrowse, SiteFavorite, SiteSearch, etc.).

4. Listing Alert

Triggered when a listing alert changes.

5. Transaction

Triggered when a transaction is created, updated, or deleted. Only the relevant action fields are present.

6. Call

Triggered on a call event.

7. Email

Triggered on an email event.

8. Text

Triggered on a text/SMS event.
communicationType values — MANUAL: agent-initiated communication. LOGGED: communication recorded after the fact. AUTO events are excluded from webhooks.

9. Note

Triggered when a note is created, updated, or deleted. Only the relevant action fields are present.

10. Task

Triggered when a task is created, updated, finished, or deleted. Multiple action fields may appear in a single payload.

11. Appointment

Triggered when an appointment is created, updated, finished, or deleted. Multiple action fields may appear in a single payload.

12. Pipeline Change

Triggered when a lead’s pipeline stage changes.

13. Showing

Triggered when a property showing on a lead is created, changed or cancelled, and when feedback is added to one. Covers showings created through POST /v2.0/showings as well as showings created inside Lofty. The payload mirrors GET /v2.0/showings/{id}: statuses are the same strings, times are ISO 8601 UTC. Exactly one of the three event keys is present per callback:
Showings created inside Lofty move from scheduled to in_progress, completed or expired by the clock, not by an explicit action, and no webhook fires for those transitions. Showings created through the API never change status by the clock.

Best practices

Respond immediately. Return a 2xx before processing and move your logic to a background job. Lofty limits concurrent deliveries per endpoint, so a slow handler directly reduces your delivery throughput — at high event volume, synchronous processing is the most common cause of delayed webhooks. Handle duplicates. The same event may be delivered more than once (for example, when a timeout swallowed your response). Deduplicate with the Lofty-Webhook-Id header — it is stable across retries of the same event. Don’t assume ordering. Retries mean an older event can arrive after a newer one. Order by the updateTime field inside the payload, not by arrival time. Acknowledge pings. Return 2xx to {"eventType": "ping"} probes — they are how a disabled subscription recovers automatically. Decommission cleanly. When you shut an endpoint down for good, return 410 Gone so Lofty stops delivering immediately instead of retrying against a dead URL. Verify signatures. Check webhook-signature against the raw body before you trust a request, and reject a stale webhook-timestamp. See Verify webhook signatures. Validate payloads. Check that listId matches your expected event type before processing. Use HTTPS. The callback carries lead data, so serve it over HTTPS from a publicly reachable host.
Use ngrok during development to tunnel webhooks to your local machine.

Example receiver

Resolving communication events to full records

After receiving a Call / Email / Text webhook, fetch the full record by passing the event’s timelineId as the communicationId path parameter of the v2 by-ID endpoint: timelineId is the recommended round-trip key — it always points to the same lead_timeline row regardless of whether the event is MANUAL or LOGGED. The legacy callId / emailId / textId fields still ship for backward compatibility, but their underlying record changes between the two communicationType values, so they are not safe to pass to the v2 by-ID endpoints.
All IDs in webhook payloads are 64-bit integers. JavaScript clients must handle them carefully — see JS / TS Integration.