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. Open piifirewall.com/console
  2. Enter your email address and verify with the 6-digit code sent to you (OTP)
  3. Click 🔑 API Key Management → enter a key name and click Issue
  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 (console → Revoke)

.env Example

bash
# .env
PII_FIREWALL_API_KEY=pf_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. Issue a new key at piifirewall.com/console
  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.