Authentication

Reevit uses API keys for server-to-server authentication.

API Keys

Format

  • pfk_live_ — Production keys
  • pfk_test_ — Sandbox/test keys

Creating Keys

Response:
⚠️ Important: The full key is only shown once. Store it securely!

Listing Keys

Revoking Keys


Required Headers

Example Request


Scopes

API keys are scoped to limit access:

Scope Errors

If you call an endpoint without the required scope:

Idempotency

All mutation endpoints (POST, PATCH, DELETE) require an Idempotency-Key header.

How It Works

  1. First request with key order-12345 → Processed, response cached
  2. Retry with same key → Cached response returned (no duplicate)
  3. Different key → New request processed

Best Practices

  • Use unique, deterministic keys (e.g., order-{order_id})
  • Keys are valid for 24 hours
  • Include enough context to be unique

Error Responses

401 Unauthorized

403 Forbidden

429 Too Many Requests


Security Best Practices

  1. Never expose keys in client-side code — Use server-to-server calls only
  2. Use environment variables — Don’t commit keys to version control
  3. Rotate keys regularly — Create new keys and revoke old ones
  4. Use minimal scopes — Only grant permissions you need
  5. Monitor usage — Check dashboard for unusual activity

Session Authentication

For dashboard and web applications, Reevit supports session-based authentication:
  1. Request a magic link:
  1. User clicks link in email, which calls:
  1. Session cookie is set automatically (reevit_session)

Two-Factor Authentication (2FA)

Users can enable TOTP-based 2FA:

WebAuthn/Passkeys

Passwordless authentication using WebAuthn:

Platform Admin Authentication

Platform administrators have elevated access across all organizations: Platform admin endpoints require session authentication and platform admin role:
Platform admin actions are logged in the platform audit log for compliance.