Use idempotency keys to ensure that your batch emails are sent only once.
We recently enabled idempotency keys for the /emails
endpoint to help you avoid sending duplicate emails.
An idempotency key is a unique identifier for a specific email request. It ensures that the same email request is processed only once, even if the request is sent multiple times.
While useful for single transactional emails, idempotency keys are also useful for sending emails in bulk.
Our bulk endpoint enables up to 100 emails to be sent in a single API call. Today, we're excited to announce that the /emails/batch
endpoint now supports idempotency keys.
Idempotency keys can be up to 256 characters and should be unique per API request.
We keep idempotency keys in our system for 24 hours. This should give you an ample window to retry any failed processes on your end without having to keep track of the sent status.
If you have multiple events related to an entity in your system, you can format your idempotency keys to take advantage of that entity's ID (i.e., <event-type>/<entity-id>
). For batch sends, choose a key that represents the whole batch, like a team, workspace, or project (i.e., team-quota/123456789
).
As with all new features, we're supporting idempotency keys in all of our SDKs.
We look forward to adding additional features like automatic retries and more. For more details, see our idempotency documentation.