keys

Rotate Key

Rotate an API key's secret in place, within the caller's organization.

Requires master key authentication.

Generates a new secret for the same key row (id, user, name, expiry, and metadata are preserved) and returns the new raw key once, using the same response shape as key creation. The previous secret stops authenticating immediately; there is no grace window.

post/v1/keys/{key_id}/rotate

Path parameters

key_idstring required

Response

Successful Response

allowed_modelsstring[] nullable required
capture_agent_telemetryboolean nullable required
created_atstring required
exclude_from_budgetboolean required
expires_atstring nullable required
idstring required
is_activeboolean required
keystring required
key_namestring nullable required
key_prefixstring nullable required
metadataobject required
reject_user_mismatchboolean nullable required
user_idstring nullable required

Changes

Changed in 7 of the 143 revisions of this API.17

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • the endpoint scheme security XApiKeyAuth was added to the API

      api-security-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 21 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog