On the way in
Send theX-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:
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.
On the way out
hooksnode delivers at least once. Your endpoint can get the same event twice. Make your handler safe to run twice:- Find a stable ID in the event. For example, Paystack’s
data.reference, the email’smessage.id, or the bank event’semail.id. - Before you do the work, check if you already did it for that ID.
- Store the ID in the same database transaction as the work.