← All Posts
Getting Started

API Key Management: Generating, Rotating, and Revoking Paychainly API Keys

May 21, 2026· 1 min read

Key Naming Convention

Paychainly API keys follow the format:

pk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx   (production)
pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxx   (sandbox)

The prefix makes it easy to grep your codebase for accidentally committed keys.

Creating Keys in the Dashboard

  1. Navigate to Settings → API Keys → New Key.
  2. Name the key (e.g., "Production Backend", "Staging CI").
  3. Set an optional expiry date.
  4. Copy the key — it is shown only once.

Hashed Storage

Paychainly stores only the HMAC-SHA256 hash of your key — not the key itself. This means if the database is compromised, attackers cannot recover your raw API key.

Environment-Per-Key Strategy

EnvironmentKey TypeExpiry
Productionpk_live_...1 year (auto-rotate)
Stagingpk_test_...3 months
Local Devpk_test_...No expiry
CI/CDpk_test_...30 days

Key Rotation Procedure

  1. Generate new key in dashboard.
  2. Deploy new key to environment variables (zero-downtime if using secret managers).
  3. Wait 15 minutes to confirm no errors.
  4. Revoke old key from dashboard.

Detecting Leaked Keys

Set up GitHub secret scanning and git-secrets pre-commit hook to prevent keys from being committed. Paychainly dashboard shows last-used timestamp per key — unexpected activity is a sign of compromise.

← Back to Blog
API keyssecuritykey rotationauthenticationdashboard