lads_subscribe_lead_notifications
LinkedIn Ads write medium risk
Part of the Lead Sync Agent.
What it does
Subscribe to real-time Lead Gen Form lead notifications (push) delivered to a validated webhook. POST a leadNotifications subscription tying an owner (and optionally a specific form) to your registered HTTPS webhook. From 2026-03-16 ONLY validated webhooks (those that answered LinkedIn's challenge) receive notifications. Payloads arrive as text/plain but parse as JSON, reference urn:li:leadGenFormResponse:{id}, and are retried up to 5x; consume them then fetch the full lead via lads_get_lead_form_responses with field projection. Preview->approve->execute->log: confirm the webhook is validated and the owner/form scope, then subscribe. Pull remains LinkedIn's recommended primary path; add push for speed. (This is the canonical lead-subscription tool; the prior duplicate-named entry has been corrected.) The preview includes the webhook host (the rest of the URL is withheld: it can carry a secret) and the lead type; a webhook that is not https, or an unknown lead_type, is refused at preview. Two-phase (parity with Google, ADR-028/029): the first call (no preview_id) builds the request locally and returns a preview_id — nothing is sent to LinkedIn; re-call with that preview_id and identical arguments to COMMIT (single-use, 30-min; a changed/forged/replayed token fails closed).
When to use it
Use to turn on near-real-time lead delivery for a lead-gen client after the initial backfill pull. Validate the webhook first, then subscribe. Do NOT subscribe an unvalidated or third-party endpoint.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
owner | string | yes | Owner URN — urn:li:sponsoredAccount:{id} or urn:li:organization:{id}. Wrapped server-side into the required union object (sponsoredAccount|organization). Within bearer scope. |
webhook_url | string | yes | HTTPS endpoint that MUST be pre-validated against LinkedIn's challenge, or notifications are silently not sent (post 2026-03-16). |
form | string | no | Optional urn:li:versionedLeadGenForm:(urn:li:leadGenForm:{id},{ver}) to scope to one form via versionedForm; omit for all owner forms. |
lead_type | enum(SPONSORED|EVENT|COMPANY|ORGANIZATION_PRODUCT) | no | REQUIRED on the wire (default SPONSORED) — the kind of lead the subscription delivers. |
associated_entity | object | no | Optional entity-level scope union, e.g. {event:urn} or {associatedCreative:urn}. Distinct from form/versionedForm. |
preview_id | string | no | Omit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview. |
Safeguards
A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.
Policy
Lead Sync push: only validated webhooks receive notifications (since 2026-03-16); deliver leads only to the authorizing client's validated endpoint; payloads are member-derived lead data subject to retention limits — no cross-account pooling.
Reminder
Deliver push leads only to a validated client endpoint; treat payloads as member PII under retention limits and never build a cross-account store.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
VALIDATION_REQUIRED | Webhook not validated — notifications will not be delivered (post 2026-03-16 requirement). | Complete the challenge/validation handshake, then re-subscribe. | yes |
INVALID_ARGUMENT | Bad owner key or non-HTTPS/unreachable webhook (400) — surface message. | Provide an HTTPS reachable endpoint and percent-encoded owner; fix and retry. | no |
PERMISSION_DENIED | Missing Lead Sync scope or owner access (403). | Verify scope + owner role; re-auth if needed (needs_reauth). | no |
CONFLICT | A subscription already exists for this owner/form/webhook (409). | Reuse or update the existing subscription instead of duplicating. | no |
TOKEN_REVOKED | Token expired/revoked (401). | Refresh and retry once; else re-auth. | yes |
RESOURCE_EXHAUSTED | Rate limit (429). | Backoff 5/10/20s cap 60s; respect Retry-After. | yes |
Edge cases
- Unvalidated webhook silently receives nothing -> verify validation status before reporting success.
- Duplicate subscription -> 409 or double delivery; list existing subscriptions first.
- Notification body is text/plain but JSON -> parse accordingly, then fetch the full lead by response URN.
- Notifications retried up to 5x -> the consumer must be idempotent on the leadGenFormResponse id.
- Scoping to a single form vs all owner forms changes volume — confirm intent.
- Push complements but does not replace the one-time backfill Pull.