Suede Agent StudioDocsStart buildingOpen workspace
Navigation menu

Developers2 min readUpdated

Send an Idempotency-Key so a retried webhook runs once

Quick answer

Agent Studio CRM inbound webhooks accept an Idempotency-Key header. The first delivery with a key writes the contact and fires Inbound webhook received. A repeat of the same key answers { ok: true, duplicate: true } and writes nothing, so a sender that retries never starts your workflows twice.

What you'll have

  • A retried delivery that changes nothing
  • One workflow run per lead, however many times the sender retries
  • Clear responses for duplicates and deliveries still in progress
On this page
  1. Why send an Idempotency-Key?
  2. How do I send the key?
  3. What does the webhook answer?
  4. What if I send no key?
  5. Questions

Why send an Idempotency-Key?#

Tools that call webhooks retry when a request times out, so one lead can arrive twice. With a key, Agent Studio recognizes the repeat. The first delivery writes the contact, records the visit, counts once and starts your workflows. A repeat does none of that.

How do I send the key?#

Add the header to each delivery. Use a value that is the same on every retry of one delivery, such as your system's event id. Create the webhook under Forms, Inbound webhooks, then post to its address.

A delivery with an idempotency keybash
curl -X POST 'https://<your webhook address>' \
  -H 'content-type: application/json' \
  -H 'x-suede-hook-secret: YOUR_SECRET' \
  -H 'Idempotency-Key: lead-48213' \
  -d '{"email":"test@example.com","first_name":"Test","phone":"555-0100"}'
Rules for the key
RuleDetail
HeaderIdempotency-Key, or x-suede-idempotency-key. If you send both, the values must match.
Length1 to 200 characters
CharactersVisible ASCII with no spaces
ScopeOne webhook. The same key on a different webhook is a different delivery.

What does the webhook answer?#

Responses
StatusBodyMeaning
200{ ok: true }First delivery with this key. The contact was written and workflows started.
200{ ok: true, duplicate: true }Repeat of a key already delivered. Nothing was written.
409in_progressA delivery with this key is still being processed. Send it again in a few seconds.
400invalid_requestThe key is malformed, or two key headers disagree.

What if I send no key?#

Every delivery is processed. Add the header on the sender's retrying calls to make them safe. Your webhook's secret is checked first, so a caller without the secret learns nothing about keys. Set up the webhook and its field mapping in Forms.

Questions buyers ask#

Does the Idempotency-Key header have to be unique per lead?

Yes. Use one value per delivery you want to run once, and the same value on every retry of it. An event id from your system works well.

Does a duplicate fire the Inbound webhook received trigger again?

No. A duplicate changes no contact, records no visit, leaves the count alone and starts no workflow.

Can two webhooks use the same key?

Yes. A key belongs to one webhook, so the same value on a different webhook counts as a different delivery.

Can I test it?

Yes. The test command on each webhook includes an Idempotency-Key header. Run it twice with the same value and the second answer says duplicate.

Was this page helpful?

Good work starts with a clear flow.

Give an agent a job. Connect the steps. See how the work becomes a service someone else can call.

Input
Reason
Output

A workflow you can inspect

Make the steps visible.

Start with a template or describe the job. Connect inputs, reasoning, and output on the canvas.

Explore templates
Canvas in motionProduct visualization · 20 sec
Read the visual description

A stylized organization chart opens into a workflow canvas. Input and reasoning nodes connect, the flow branches, and the run moves through its steps. The film ends with Suede Agent Studio. Music only; no spoken narration.