Skip to main content

On the way in

Send the X-Idempotency-Key header with each event. hooksnode stores the first event with a key. When the same key comes again to the same project, hooksnode stores nothing and answers:
The status is 200, so your sender does not retry.
  • Keys are unique for each project.
  • A key can be up to 255 characters.
  • Use an ID that your system already has, such as the provider’s event ID.
hooksnode sets keys for you on other sources:

On the way out

hooksnode delivers at least once. Your endpoint can get the same event twice. Make your handler safe to run twice:
  1. Find a stable ID in the event. For example, Paystack’s data.reference, the email’s message.id, or the bank event’s email.id.
  2. Before you do the work, check if you already did it for that ID.
  3. Store the ID in the same database transaction as the work.