How to make sure you do not duplicate API sends

Idempotent requests is a great optional feature.

When sending requests through our API, it is crucial to avoid duplicating any requests. Accidentally sending an item twice is a common human error that can lead to unnecessary issues. Fortunately, we have implemented a powerful feature to address this problem and prevent duplicated requests from occurring. The Idempotency key and Idempotent requests.

To add an idempotency key to your requests, the process is straightforward. You simply need to include a header in your request called Idempotency-Key: {key}. The {key} can be any value, but we highly recommend using a Universally Unique Identifier (UUID) with a high level of entropy to minimize the chances of collisions.

Once you have added the idempotency key, we store these requests for a period of 24 hours. If a request with the same key is made within this timeframe, our system will respond with a 409 status. In this scenario, the mailing will not be sent, and you will not be charged for the duplicate request.

Ensuring that your requests are idempotent is essential for maintaining the integrity and efficiency of our API. By following this process, you can avoid accidental duplication and streamline your interactions with our system.