Method | Where used | Scope | Conflict behavior | Retention |
---|---|---|---|---|
Transaction ID | Event ingestion (/ingest , Segment) | Usage events | Ignores subsequent events with the same ID | 34 days |
Ingest alias | Customer writes (create or update) | Customers | Returns 409 Conflict if ingest alias is already in use | Until released |
uniqueness_key | Resource creation | Select resources (see below) | Returns 409 Conflict | Until released (only available for Alerts) |
Idempotency-Key header | POST API requests | Request cache | Returns 409 Conflict if parameters differ | ≥ 24 hours |
transaction_id
field as an idempotency key.
Once a usage event has been accepted with a given transaction ID, Metronome ignores subsequent events with the same transaction ID within the next 34 days. This allows you to safely retry sending events without risk of duplication.
uniqueness_key
field in the request payload. This uniqueness key is stored as part of the resource in Metronome, and Metronome ensures that no resources can share the same uniqueness key. If you attempt to create a resource with a uniqueness key already in use, you receive an HTTP 409 Conflict
error with message “This uniqueness key has already been used.”
Examples of resources with uniqueness keys:
Idempotency-Key
header for endpoints that don’t include a dedicated uniqueness key. Metronome supports sending an Idempotency-Key
header for all POST endpoints. If the Idempotency-Key
header is provided and the request begins executing (it passes validation and doesn’t conflict with another concurrent request), the results of the API call are persisted, and the same results returned.
Behavior:
409 Conflict
.Idempotency-Key
header returns an error, Metronome caches the error and returns it for subsequent retries with the same idempotency key. This behavior follows industry best practices—when an operation fails midway, retries without manual review can make the situation worse. In these situations, Metronome caches and returns the error to ensure you see the failure consistently, investigate the state of the system, and decide whether to retry or resolve manually.
Idempotency-Key
header).uniqueness_key
for resource creation like contracts instead of the Idempotency-Key
header.