Guides · Custom software

Connecting systems with APIs and webhooks

With an API pull, the receiving system asks for data on a schedule or when needed. A webhook tells it that something happened. An event can also trigger an API request for the current record.

Connect a website form to a CRM

When someone submits a form, use the submission ID to identify the CRM record. Give the delivery its own event ID and reuse that ID on retries. If the source also sends updates, include the revision so the CRM can keep the most recent state.

In the fictional examples below, the webhook simulator plays the part of the receiving system and shows the final record in memory.

New submission and repeat delivery
The first delivery of event-101 saves REQ-01 as open at revision 1. The identical copy leaves it unchanged. The same event ID with a different status is flagged as a conflict.
Older update arrives late
REQ-02 stays closed at revision 3 when revision 2 arrives with an open status.
CRM temporarily unavailable
The first event-301 returns a retry outcome. When the same event arrives after the destination recovers, it saves REQ-03 as open at revision 1.

Open the webhook replay simulator, choose each scenario, and run it. Compare the event outcomes and final record with the results above. The same fixtures are in the replay module.

These examples use IDs, statuses, and revisions. For a real form, add a separate acceptance test for missing required contact details. Decide what the visitor should correct and which incomplete submissions should go to review before the CRM is updated.

Decide which system owns each field

Give each important field a source. For example, an inquiry tracker owns the ID while a support tool owns the status. Decide what should happen if changes travel in both directions.

Record which events matter, how quickly changes should appear, and which data you can recover by running a sync.

Handle redelivery and late revisions

A system can deliver an event more than once. Record the event ID when the outcome has been saved consistently. If the same ID arrives with different data, send it for review.

When the source sends a revision number, an older revision should leave a newer record in place. If there is no reliable revision, consider reading the source’s current state before applying an update.

Stripe’s documented example of duplicate-event handling

Run failure cases before connecting live data

Test an event delivered twice, an old update after a new one, and a destination that fails on the first attempt. Record the final state and how to retry a failed attempt.

In a live integration, verify signatures according to the event provider’s instructions, scope the account permissions, and keep secrets out of error logs.

A brief for the project

Systems
Source, destination, and the fields each one owns.
Timing
Event, scheduled check, or a combination.
Recovery
Duplicate, late-event, retry, and alert rules.
Acceptance
Examples and the expected record after each test.