Rotate a virtual key's API key
/v1/virtual-keys/{slug}/rotateRotate a virtual key's API key.
Issues a new API key and answers it once: store it now. The previous API key stops authenticating on the next request (for a key created before API keys existed, the bare slug stops working). The slug, settings, limits, usage and logs are unchanged, so routing configs that use the key keep working.
Requires an organization admin key, or a workspace admin key for the key's workspace.
Errors: 403 without the required role; 404 when no key has this slug; 409 when the key is EXPIRED.
Authorization
AuthorizationBearer va_A platform API key (
va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.
Path parameters
slugstringrequiredthe key's slug
Responses
slugstringrequiredThe key's slug, unchanged by the rotation.
api_keystringrequiredThe new API key: the slug, a dot, then a new secret. Shown only once.
token_hintstringrequiredThe last characters of the new secret, as later shown on the key as
token_hint.rotated_atstring<date-time>requiredWhen the key was rotated (ISO 8601 date-time).