Authentication
Reevit uses API keys for server-to-server authentication.API Keys
Format
pfk_live_— Production keyspfk_test_— Sandbox/test keys
Creating Keys
⚠️ Important: The full key is only shown once. Store it securely!
Listing Keys
Revoking Keys
Required Headers
| Header | Required | Description |
|---|---|---|
X-Reevit-Key | Yes | Your API key |
X-Org-Id | Yes | Your organization ID |
X-Reevit-Client-Version | Recommended | SDK/Client version for tracking |
Idempotency-Key | For mutations | Unique request identifier |
Content-Type | For POST/PATCH | application/json |
X-Actor-Id | Optional | User ID for audit logs |
Example Request
Scopes
API keys are scoped to limit access:| Scope | Permissions |
|---|---|
connections:read | View PSP connections |
connections:write | Create/update/delete connections |
payments:read | View payments and stats |
payments:write | Create/confirm/refund payments |
fraud:read | View fraud policies |
fraud:write | Update fraud policies |
webhooks:read | View webhook events and config |
webhooks:write | Configure webhooks, replay events |
subscriptions:read | View subscriptions |
subscriptions:write | Create/update/cancel subscriptions |
invoices:read | View invoices |
invoices:write | Retry/cancel invoices |
api_keys:read | List API keys |
api_keys:write | Create/revoke API keys |
workflows:read | View workflow automation |
workflows:write | Manage workflows |
Scope Errors
If you call an endpoint without the required scope:Idempotency
All mutation endpoints (POST, PATCH, DELETE) require anIdempotency-Key header.
How It Works
- First request with key
order-12345→ Processed, response cached - Retry with same key → Cached response returned (no duplicate)
- 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
- Never expose keys in client-side code — Use server-to-server calls only
- Use environment variables — Don’t commit keys to version control
- Rotate keys regularly — Create new keys and revoke old ones
- Use minimal scopes — Only grant permissions you need
- Monitor usage — Check dashboard for unusual activity
Session Authentication
For dashboard and web applications, Reevit supports session-based authentication:Magic Link Authentication
- Request a magic link:
- User clicks link in email, which calls:
- 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:| Role | Permissions |
|---|---|
platform_admin | View/manage all organizations, approve/reject KYC |
platform_owner | All platform_admin permissions + manage platform admins |

