keys rotate

Rotate your secret key, immediately invalidating all previous keys.

npx formdata-dev keys rotate

Confirmation

The CLI warns before proceeding:

Rotate Secret Key ───────────────── Warning: This will immediately invalidate your current key. Warning: MCP connections and API integrations will break until reconfigured. Continue? (y/n):

Output

Done: Secret key rotated New key: sk_live_newkey123... Saved to: ~/.config/formdata/credentials Warning: The old key is now permanently invalid. Updated MCP configuration: { "mcpServers": { "formdata": { "url": "https://api.formdata.dev/mcp", "headers": { "Authorization": "Bearer sk_live_newkey123..." } } } }

What Happens

  1. The current secret key is permanently revoked
  2. A new sk_ key is generated
  3. Local credentials file is updated automatically
  4. Updated MCP configuration is printed for you to copy
WARNING

Key rotation is immediate and irreversible. After rotation:

  • All existing API integrations using the old key will fail with 401 Unauthorized
  • All MCP client connections using the old key will disconnect
  • You must update every integration with the new key :::

:::tip MCP equivalent: rotate_key. Note that rotating via MCP will disconnect the current MCP session, since the bearer token becomes invalid.