capabilities.work

Rotate an API Key for an Owner

A 3-step recipe with Temporal. We can help you get access.

Recipe · 3 steps

Rotate an API Key for an Owner

with Temporal · Developer Identity & Credential Management

Issue a replacement API key for the same owner and revoke the old key.

  1. Read the existing API key to capture its owner id and owner type so the replacement can be bound to the same principal.
  2. Create the replacement API key for the same owner with the new expiry.
  3. Delete the original API key now that the replacement has been issued.
What you'll need to have ready
  • bearerToken: API key used as the Bearer token for Authorization.
  • keyId: The identifier of the existing API key to rotate out.
  • newDisplayName: The display name for the replacement API key.
  • newExpiryTime: RFC3339 timestamp at which the replacement key expires.
For your developer

Arazzo workflow temporal:rotate-api-key, 3 operations: getApiKey → createApiKey → deleteApiKey. Specs on APIs.io.