Build

API keys

Key format, test and live environments, scopes, storage, rotation and revocation.

Key format

A v2 API key is one bearer value bound to an organisation, workspace and environment. It contains a public identifier and a secret; send the whole key as Authorization: Bearer <key>.

PartTreat it asPurpose
wf_v2_test or wf_v2_live prefixConfigurationSelects the test or live environment
wf_pub_… identifierNot secret, but do not publish itIdentifies the key
wf_sec_… secretSecret: server onlyAuthenticates the request
ScopesConfigurationLimit the operations the key can call
ExpiryConfiguration30, 90 or 365 days after creation

Rotation

  • Rotate the key in the dashboard or with POST /api/v2/keys/{keyId}/rotate, or create a replacement with only the scopes it needs.
  • Deploy the new key and confirm that requests succeed.
  • If you created a replacement, revoke the old key and confirm it returns 401 AUTHENTICATION_REQUIRED.
  • Investigate any unexpected usage before you delete records.

Scopes and separation

Use a separate key for each service and environment. One key shared by several applications makes rotation, usage tracking and incident response harder.

  • Grant only the scopes that service calls.
  • Use wf_v2_test keys outside production and wf_v2_live keys only in production.
  • Name each key after its service and environment, never after a secret.
  • Check a key's usage before you revoke it.

If a key leaks

  • If the service must keep running, create and deploy a replacement key first.
  • Revoke the exposed key and confirm it no longer works.
  • Search server, CI, deployment, analytics and support logs for the exposed value.
  • Review the key's recent requests, downloads and request-unit use.
  • Never send an old or new key in a support ticket.