Compare Webhook Payloads With API Docs

Short answer

Check real webhook payloads against their API documentation: required fields, types, nested objects, and extra fields.

Try Assistly Open consoleAssistly · 4 min read

The integration worked in testing and broke in production, and the difference was never a bug — it was a field. The documentation said amount is a number; production sent it as a string in one webhook type. The documentation described order.created; production also sent order.updated, undocumented, and nobody's parser handled it. Assistly compares the payloads you paste against the documentation you paste — required fields present, types agreeing, nested objects shaped as described, extra fields named — and lists the differences per event type with the doc language quoted beside each finding. Continue with a related workflow: Check Exhibition Loan Packing Lists With AI

The prompt to use in Assistly

Compare these captured webhook payloads against the pasted documentation. I will mark which doc parts are schema and which are examples — check against schema only. Per payload: missing required fields, type mismatches, nested-object shape differences, undocumented event types, and extra fields not in the schema. Quote the doc language beside each finding and give severity (high: breaks parsing or arithmetic; low: ask the vendor). End with a verdict per event type: works, needs a guard, or needs a vendor answer.
Try this task

Separate the doc's three voices

API documentation speaks in three registers, and the check must know which it is reading: the schema (field tables — the contract), the example (a sample payload — illustrative, not exhaustive), and the prose (warnings and notes — where the real rules hide, like "amount is a string for legacy accounts"). A comparison against examples produces false findings when the example omits optional fields; a comparison against schemas produces the real ones. Tell Assistly which parts of the pasted documentation are schema and which are examples, and the findings gain a property every integration team wants: no false alarms. Continue with a related workflow: Check Museum Exhibition Labels With AI

Examples you can follow

  • Two event types, four payloads, three findings

    What to give Assistly. The documentation excerpt: schema for order.created (fields order_id string required, amount number required, currency string required 3-letter, customer object with email string, items array required, coupon string optional) and a note "order.updated is sent for any order state change; payload mirrors order.created plus status"; plus an example payload marked as example. Then four captured payloads: two order.created, two order.updated. Instruction: per payload, check against schema — missing required, type mismatches, undocumented event types, extra fields.

    What Assistly returns. Findings per payload. Payload 1 (order.created): clean — every required field present with agreeing types. Payload 2 (order.created): amount arrives as "1450.00" in quotes — string against the schema's number; flagged with the schema line quoted, severity high because arithmetic downstream will coerce or crash. Payload 3 (order.updated): mirrors order.created plus status, as the note promised — clean, and the note is cited as the doc basis for accepting the event type. Payload 4 (order.updated): carries an extra field legacy_total not in any schema — flagged as undocumented-extra, severity low, action ask-the-vendor rather than fix-our-parser, plus currency "AED" where the payload 4 order is USD-denominated — flagged as a value-domain question, since the schema constrains format, not correctness. The record ends with the integration verdict per event type: created needs a string-amount guard; updated works, with one vendor question open.

    How to verify it. Look at payload 2's raw JSON and confirm the quotes around the amount — the finding is visible in ten seconds and the parser guard is a one-line change. Send the payload 4 question to the vendor with both the payload and the schema line attached; vendors answer field questions fast because the answer protects their other integrants too.

FAQs

Can it fix our parser or write the guard code?

It can describe the guard precisely — "coerce amount strings to numbers before arithmetic, and alert when the coercion fires" is an implementable instruction for your developer — and drafting the actual code is your team's step. The comparison's value is that the guard list is complete: every payload you've captured was checked, so the parser hardening covers the reality of the feed, not just the one failure that woke you up.

How many captured payloads make a fair comparison?

Enough to include each event type at least once, and ideally the odd ones — a refund, a partial capture, a failed payment. Two clean order.created payloads prove little; the finding usually lives in the payload nobody thought to capture. Run the check after each new event type appears in production, and the payload library becomes the integration's regression suite.

The vendor says the docs are outdated. Now what?

Then the comparison just earned its keep: the finding set becomes the input to a doc-correction request, sent with payloads and schema lines attached. Until the docs are fixed, record the vendor's email as the temporary schema — the check can re-run against quoted-email-rules instead of quoted-docs — and note in the record that the authority moved, so nobody silently trusts the stale page six months later.

Try the workflow in Assistly

Create an account