keys

Rotate Api Key

Issue a new key with the same tier/email, then retire the old one.

Used by the portal's "rotate" action. The new key inherits the old key's label with a _rotated suffix, the same tier, and the same user_email so it appears in the same scoped list. The plaintext key is returned exactly once — same contract as POST /v1/keys.

Old-key retirement (task #618): with no body (or grace_period_hours = 0) the old key is revoked immediately — the historical contract. A positive grace_period_hours instead sets expires_at on the old key so both keys overlap for that window, letting integrations swap credentials without a hard cut.

post/v1/keys/{key_id}/rotate

Request

  • Base URL: https://api.ctindex.io
  • URL: https://api.ctindex.io/v1/keys/{key_id}/rotate
  • Auth: one of:
    • API key in header X-API-Key
    • HTTP bearer

Path parameters

key_idstring uuid required

Cookies

ctix_sessionstring nullable

Request body

grace_period_hoursinteger

Hours the OLD key keeps working after rotation. 0 (default) revokes it immediately; max 168 (7 days).

Response

Successful Response

idstring uuid required
keystring required
labelstring nullable
tierstring required
commercial_use_allowedboolean
created_atstring date-time nullable
example_callstring nullable

Copy-paste curl against a known-indexed domain (GH #706). Host is taken from EXAMPLE_CALL_DOMAIN (allow-listed); substitute $CERTINDEX_API_KEY.

old_key_idstring uuid nullable
old_key_revokedboolean
old_key_expires_atstring date-time nullable

Changes

No recorded changes to this operation across all 1 revision of this API.