Authentication & Multi-Tenancy
All requests to the HeyPeppy API must be authenticated using an API key passed in the standard Authorization HTTP header (or X-API-Key header).
Authorization: Bearer hp_test_your_api_key_here
X-Tenant-ID: your_tenant_id
Requests made without valid credentials will return an HTTP 401 Unauthorized status.
Multi-Tenancy & Tenant Resolution
HeyPeppy is architected as a fully isolated multi-tenant platform. Each B2B partner account is assigned a unique tenantId (e.g. stepup, odyssey, classwallet, partner_demo).
Specifying Tenant Context
You can specify the tenant in one of two ways:
- HTTP Header (Recommended):
X-Tenant-ID: your_tenant_id
- Request Body Property:
{"tenantId": "your_tenant_id","receiptUrl": "..."}
If neither is explicitly supplied, the API resolves the tenant automatically from the API key credentials.
Tenant Isolation Guarantees
- Data Segregation: Work jobs, audit logs, and extraction results are partitioned strictly by tenant.
- Dedicated Queue Quotas: Cloud Tasks queue capacity and rate limits are metered per tenant so one partner's deadline rush never starves another.
- Custom Policy Catalogs: Handbooks, purchasing rules, and category catalogs are loaded according to the tenant and requested
programKey.
Environment & Key Format
| Environment | Key Prefix | Base URL |
|---|---|---|
| Sandbox / Staging | hp_test_... | https://staging-api.heypeppy.ai/v1 |
- Sandbox / Staging Environment: Connects to the same AI extraction models with test guidelines. No billable usage is charged, and test jobs are purged after 24 hours.
Mock Simulation Mode in the Test Console
When exploring endpoints in the interactive API reference documentation, the right-side test console includes a "Mock Simulation Mode" checkbox (enabled by default):
-
Enabled (Default - In-Browser Mock):
- Requests never leave your browser.
- The console simulates realistic network latency (~500ms) and returns verified, schema-accurate mock responses directly.
- You do not need real API credentials or an active account to test; the pre-filled
hp_test_sample_keyis completely sufficient. - No network connectivity or CORS configuration is required.
-
Disabled (Live Sandbox Network Calls):
- When unchecked, the console sends genuine HTTP requests directly over the network to the live Staging sandbox backend (
https://staging-api.heypeppy.ai/v1). - Enter your actual sandbox key (
hp_test_...) and optional tenant identifier. - Your API Key and
X-Tenant-IDheader are saved in browserlocalStorageand will automatically persist across pages and sessions so you don't have to re-enter them.
- When unchecked, the console sends genuine HTTP requests directly over the network to the live Staging sandbox backend (
API Key Security Best Practices
- Keep Keys Secret: Never expose API keys in client-side code (browsers, mobile apps) or commit them to public Git repositories.
- Key Rotation: HeyPeppy supports simultaneous active keys to enable zero-downtime key rotation. You can generate a new secondary key in your partner portal before revoking the old key.
- IP Allowlisting (Optional): Enterprise partners can configure static IP addresses or CIDR blocks directly in the Partner Portal under API Keys & Authentication > IP Allowlisting. When enabled, requests originating from outside authorized IPs or subnets will be rejected with
HTTP 403 Forbidden.
Webhook Authentication
When HeyPeppy delivers asynchronous event notifications to your webhook URL, every request includes an HMAC-SHA256 signature in the X-HeyPeppy-Signature header.
Refer to the Webhooks Documentation for full instructions on verifying webhook signatures.