Skip to main content

1. Back-fill existing records

Page through every list with limit=100. Stop when offset >= count.
Lists are sorted newest first. Records created while you page can shift later pages, so upsert by OutReign id rather than inserting blindly.

2. Subscribe to changes

In OutReign open Settings → Webhooks, add your HTTPS endpoint and select lead.created, lead.updated, lead.deleted, deal.created, deal.updated, deal.stage_changed and deal.closed. See webhook events for payloads and security and retries to verify signatures.
upsertIntoCrm, upsertDealIntoCrm, enqueueDurablyOnce, app and express are your integration’s adapter/framework functions, not OutReign SDK exports. A separate worker consumes accepted events: handle deletion by ID and fetch current records when an event contains only partial stage-change data. Do not acknowledge first and then risk losing an in-memory task.

3. Write back from the CRM

Push changes into OutReign with PATCH /leads/{id} or PATCH /deals/{id}. Lead, deal and activity updates normalize the whole record, so read the record first and send back the values you want to keep. Contact updates only change the fields you send.

4. Reconcile nightly

Webhooks can be delayed or retried. Run the back-fill again once a day with your upsert logic to catch anything missed.