SET Merchant API · API keys
Rotate an API key, with an overlap
POST/v1/api_keys/{id}/rotate
A new key, shown once, with the old key's scopes, label, allowedCidrs and pinned SET-Version. The old key keeps working for the overlap, so you can deploy the new one without downtime, and then answers 401 api_key_expired. A key may rotate itself. Event api_key.rotated, which never carries the key.
Path parameters
idstringrequired- The key's id.
Headers
Idempotency-Keystring- Optional. The same key and body run once; a replay answers with
Idempotent-Replayed: true. Kept 24 hours.
Body
overlapHoursinteger- 0–72, default 24. The overlap never runs past the old key's own expiry.
expiresAtISO time- The new key's expiry, at least a minute ahead. Null or absent means no expiry.
Notes
- A key can be rotated once: a second rotation is
409 api_key_already_rotated. A revoked or expired key is409 api_key_inactive; issue a new key instead.
Errors
400 overlap_invalid400 expires_at_invalid403 scope_exceeds_caller403 operator_cannot_issue404 api_key_unknown409 api_key_inactive409 api_key_already_rotated409 too_many_keys401 api_key_required401 api_key_invalid401 api_key_wrong_mode401 api_key_expired403 scope_missing403 platform_api_paused429 rate_limited503 api_disabled