Authentication
All API requests require an Authorization header with your API key:
Authorization: Bearer pk_live_xxxxxxxxxxxx
Get an API key
Visit policynumbers.com/api, enter your email, and click Generate API key.
If you enter an email address:
- A verification link is sent to that address.
- Click the link to activate your key (expires after 24 hours).
- Once activated, the key is shown on the portal — save it immediately, it is only displayed once.
If you enter a name (no @):
The key is shown immediately after generation. Copy it before leaving the page.
warning
Your API key grants access to your verification credits. Never commit it to source control or expose it in client-side code.
info
Free-plan keys that have never been used are automatically deactivated after 7 days. Make your first API call within that window to keep the key active.
Key types
| Prefix | Mode | Credits consumed |
|---|---|---|
pk_live_ | Production | Yes |
pk_test_ | Sandbox | No |
Generate a test key from the same portal page to develop and test without using real credits.
Using your key
- curl
- Python
- Node.js
curl -X POST https://policynumbers.com/api/v1/verify \
-H "Authorization: Bearer pk_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"policy_number":"ABC12345","country":"UK","insurance_type":"motor"}'
import requests
resp = requests.post(
"https://policynumbers.com/api/v1/verify",
headers={"Authorization": "Bearer pk_live_xxxxxxxxxxxx"},
json={"policy_number": "ABC12345", "country": "UK", "insurance_type": "motor"},
)
print(resp.json())
const resp = await fetch("https://policynumbers.com/api/v1/verify", {
method: "POST",
headers: {
"Authorization": "Bearer pk_live_xxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({ policy_number: "ABC12345", country: "UK", insurance_type: "motor" }),
});
console.log(await resp.json());
Error codes
| Code | Meaning |
|---|---|
401 | Missing or invalid API key |
402 | Insufficient verification credits |
429 | Rate limit exceeded |