> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lonescale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Notification Payload

> The JSON event a webhook notification posts after LoneScale finds a signal or syncs it to your CRM

A **notification** is a rule attached to a workflow. Its destination is a Slack channel or a webhook. A webhook notification posts **one JSON event per contact** (per account for Job Postings), right after the HubSpot or Salesforce push, so you can trigger your own flow (lead scoring, round-robin assignment, sequence enrollment) as soon as LoneScale creates or updates a record.

Create one from the workflow form (**Output & Integration → Notifications → New notification**) or from **Settings → Notifications**. Job Changes, New Hires and Job Postings workflows all accept webhook notifications.

> [!TIP]
>
> **Send test event** in the notification editor posts a sample event to your webhook before any run, so Zapier, Make or n8n can map its fields. A test event has `origin: "test"`: skip it in your flow.

## When an event is sent

| Workflow | One event per | Sent | Signal |
| - | - | - | - |
| Job Changes | contact | Right after the contact's CRM push; when the workflow has no CRM destination, when the change is found | `signal.job_change`, `signal.promotion` |
| New Hires | new hire | Right after the new hire's CRM push; when the workflow has no CRM destination, when it is found | `signal.new_hire` |
| Job Postings | account and run | Once the run is synced, after the account's CRM push, with every job posting the account matched | `signal.job_posting` |

Each event counts as one task in Zapier or Make.

## Triggers

A notification fires on two families of triggers. Any selected trigger within a family is enough; when both families are selected, one of each must hold; a family left empty means "any". New Hires and Job Postings notifications select CRM events only: their signal is on every event.

| Trigger | Fires when |
| - | - |
| `crm.contact.created` | LoneScale created the contact |
| `crm.contact.updated` | LoneScale sent an update to an existing contact |
| `crm.contact.moved` | The imported contact was re-associated to its new company (job change) |
| `crm.lead.created` | LoneScale created a Salesforce lead instead of a contact |
| `crm.account.created` | LoneScale created the company / account |
| `crm.account.updated` | LoneScale sent an update to an existing company / account |
| `crm.sync.failed` | The CRM refused the write (validation error, rate limit retries exhausted) |
| `signal.job_change` | The contact joined a new company |
| `signal.promotion` | The contact has a new title in the same company |
| `signal.new_hire` | A new hire was found (New Hires) |
| `signal.job_posting` | The account has new job postings (Job Postings) |

"Updated" means LoneScale sent a write to the record. A company found while the account update mapping is empty is associated but not written: its action is `unchanged` and no event fires. Job Postings push accounts only: their events have no contact.

## Delivery

* `POST` to the webhook URL, `Content-Type: application/json`, with the headers set on the webhook connection.
* No answer (timeout, connection reset, DNS), `408`, `425`, `429` and any `5xx` are retried: four attempts in all, 5 s, 30 s and 90 s apart. A `Retry-After` header is honoured up to 2 minutes. Any other `4xx` is not retried.
* An endpoint that stays down for three events in a row gets one attempt per event for the rest of the run.
* Every delivery is listed in **Logs** (Integrations, type `WEBHOOK`) with the request, the answer and the number of attempts. A delivery that got no answer shows as an error with status `599`.
* When the last delivery fails, the webhook shows **Webhook error** in **Integrations → Webhook** and on the notifications that use it, until a delivery or a test succeeds.
* Deduplicate on `event_id`: a retry after a timeout or a CRM rate-limit retry can deliver the same event twice.

## Repush

Pushing runs to the CRM again from the app (select them in the run history, then **Push**) evaluates the webhook notifications again for every contact or account it pushes, on what this push did:

* `origin` is `repush`, and `event_id` ends with `#repush-<id>`, one id per repush. Deduplicating on `event_id` keeps the repush events.
* A record the repush finds again never fires `created`: `crm.contact.created` and `crm.account.created` only fire when the repush creates a new record.
* A push that fails sends `crm.sync.failed`.
* Contacts the CRM settings keep out of the push send nothing, and Slack notifications are not posted again.

Branch on `origin` to skip what your flow already did for the run, such as a round-robin assignment.

## Resend notifications

**Resend notifications** in the run history (select runs, then **Resend notifications**) sends the webhook notifications of those runs again, **without pushing anything to the CRM**. Use it when your endpoint was down during the run, or to feed a flow you set up afterwards:

* Each event is the run's own: same `event_id`, with `origin` set to `replay`. Deduplicating on `event_id` skips what you already processed.
* The events say what the run did: a contact the run created is still `created`, and `sync.synced_at` is when the run pushed it.
* `owner_id` is the owner the run read. If the run read none (no webhook notification fired for that record), the replay reads it and keeps it for later replays.
* Every webhook notification the workflow uses fires, with its triggers as they are now, including one added or edited after the run. A record the run did not notify can therefore get an event. Slack notifications are not posted again.

## Payload

```json theme={null}
{
  "event_id": "run_8f3c#item_2b71#ntf_41",
  "version": 1,
  "source": "LoneScale",
  "origin": "run",
  "triggers": ["crm.contact.created", "crm.account.updated", "signal.job_change"],
  "matched": ["crm.contact.created", "signal.job_change"],
  "notification": { "id": "ntf_41", "title": "Contact created → scoring" },
  "workflow": {
    "id": "wf_c9d4",
    "title": "Customers – job changes",
    "type": "CONTACT_TRACKING",
    "run_id": "run_8f3c"
  },
  "crm": { "type": "hubspot", "hub_id": "2451930", "instance_url": null },
  "contact": {
    "action": "created",
    "id": "901274",
    "object": "contact",
    "url": "https://app.hubspot.com/contacts/2451930/record/0-1/901274",
    "owner_id": "81234567",
    "message": "Contact successfully created",
    "error": null
  },
  "previous_contact": {
    "action": "updated",
    "id": "118201",
    "object": "contact",
    "url": "https://app.hubspot.com/contacts/2451930/record/0-1/118201",
    "owner_id": "81234567",
    "message": null,
    "error": null
  },
  "account": {
    "action": "updated",
    "id": "55310",
    "object": "company",
    "url": "https://app.hubspot.com/contacts/2451930/record/0-2/55310",
    "owner_id": null,
    "message": "Company successfully updated",
    "error": null
  },
  "lead": null,
  "sync": {
    "status": "synced",
    "scenario": "update_all",
    "synced_at": "2026-10-31T09:14:02.000Z",
    "error": null
  },
  "signal": {
    "type": "job_change",
    "from": { "company": "OldCo", "title": "Head of Sales" },
    "to": { "company": "NewCo", "title": "VP Sales" }
  },
  "input": {
    "contact_id": "118201",
    "email": "m.durand@oldco.com",
    "linkedin_url": "https://www.linkedin.com/in/mdurand",
    "company_name": "OldCo",
    "current_position": "Head of Sales"
  },
  "result": {
    "full_name": "Marie Durand",
    "job_title": "VP Sales",
    "company_name": "NewCo",
    "company_domain": "newco.io",
    "change_company": true,
    "change_job_title": false,
    "matched_personas": "Sales leader",
    "main_email": "marie.durand@newco.io"
  }
}
```

A **New Hires** event has the same shape with `signal.type` `new_hire`, no `previous_contact` and an empty `input`. A **Job Postings** event has no `contact`, `previous_contact` nor `lead`, the account's fields in `result` and its job postings in `jobs`:

```json theme={null}
{
  "event_id": "run_51aa#company_93f0#ntf_52",
  "origin": "run",
  "triggers": ["crm.account.created", "signal.job_posting"],
  "matched": ["crm.account.created"],
  "workflow": { "id": "wf_a1b2", "title": "Hiring SDRs", "type": "REVEAL", "run_id": "run_51aa" },
  "contact": null,
  "account": {
    "action": "created",
    "id": "55310",
    "object": "company",
    "url": "https://app.hubspot.com/contacts/2451930/record/0-2/55310",
    "owner_id": "81234567",
    "message": "Company created",
    "error": null
  },
  "signal": { "type": "job_posting", "from": { "company": null, "title": null }, "to": { "company": "NewCo", "title": null } },
  "result": { "company_name": "NewCo", "company_domain": "newco.io", "matched_job_offers_company_count": 2 },
  "jobs": [
    { "job_id": "job_7f21", "job_name": "Senior Account Executive", "job_link": "https://careers.newco.io/jobs/7f21" },
    { "job_id": "job_7f22", "job_name": "Sales Development Representative", "job_link": "https://careers.newco.io/jobs/7f22" }
  ]
}
```

### Fields

| Field | Description |
| - | - |
| `event_id` | `run#item#notification`, stable across a retry and a replay. A repush adds `#repush-<id>`, a test starts with `test#` |
| `origin` | `run` for the workflow run, `repush` when the run is pushed to the CRM again, `replay` for **Resend notifications**, `test` for **Send test event** |
| `triggers` | Every trigger true for this event |
| `matched` | The selected triggers that held: why this notification fired |
| `crm` | The CRM the workflow syncs to. `hub_id` is the HubSpot portal id, as a string. `null` when the workflow has no CRM destination: the event is sent when the signal is found |
| `contact` | The contact record LoneScale wrote. `action` is `created`, `updated`, `unchanged`, `skipped` or `failed` |
| `previous_contact` | Only when the job change push created a new contact: the record the contact was imported from, updated with the former-company fields. `null` when LoneScale updated the imported contact itself (moved to its new company, or no company change): `contact` is then that record |
| `account` | The company (HubSpot) or account (Salesforce). `object` says which |
| `lead` | Salesforce only, when a lead was created or updated instead of a contact |
| `owner_id` | On each record: its CRM owner (HubSpot owner id, Salesforce `OwnerId`) read right after the push, `null` when it has none. A replay sends the owner the run read |
| `sync` | `status` is `synced`, `failed` or `skipped`; `scenario` is the job change scenario of the CRM settings (Job Changes only); `synced_at` is when the record was pushed (on a replay, the run's push); `error` carries the CRM message on a refusal |
| `signal` | The signal that was found: a job change or promotion with the previous and current company and title, a new hire, or new job postings |
| `input` | The contact as imported: the `client_*` columns of the workflow, without their prefix (custom columns included) |
| `result` | What LoneScale found: the `lonescale_*` columns without their prefix, plus `main_email` / `main_phone` when enriched. Job Postings: the account's fields |
| `jobs` | Job Postings only: the job postings the account matched in the run |

The `url` of a record is a deep link to HubSpot or Salesforce, built from the ids above, so a flow can open or write back to the record immediately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.