Skip to content

Authentication

API Keys

All API requests are authenticated with an API key.

http
Authorization: Bearer YOUR_API_KEY

Getting Your API Key

  1. Sign in at piifirewall.com/app
  2. Go to Settings → API Keys
  3. Click Generate New Key
  4. Copy the key — it is shown only once

Key Security

  • Never commit API keys to source control
  • Use environment variables: PII_FIREWALL_API_KEY
  • Rotate keys immediately if compromised (Settings → Revoke)

.env Example

bash
# .env
PII_FIREWALL_API_KEY=pfk_live_xxxxxxxxxxxxxxxx
typescript
import { PIIFirewall } from 'pii-firewall-sdk'

const firewall = new PIIFirewall({
  apiKey: process.env.PII_FIREWALL_API_KEY!,
})

Key Scopes

ScopeDescription
readdetect, credits check
writemask, restore, all operations
adminmanage keys, view usage logs

Default keys have write scope. Restrict scope for read-only integrations.

Rotating Keys

To rotate a key without downtime:

  1. Generate a new key in the dashboard
  2. Update your environment variable
  3. Redeploy your service
  4. Revoke the old key

IP Allowlisting (Enterprise)

Enterprise plans can restrict API key usage to specific IP ranges. Contact enterprise@piifirewall.com.

Privacy by Design.