Authentication
Bearer tokens, one header, no cookies.
Header format
Every request carries the key in an Authorization header. There is no query-string auth and no cookie session.
GET /api/v1/jurisdictions is public: the on-page inspector, check-digit and generator tools read the schema from it without shipping a key. The encode endpoint is not public.
Authorization: Bearer vpdf_live_7f3c...Key prefixes
| Prefix | Environment | Quota |
|---|---|---|
vpdf_live_ | Production | Plan limit |
vpdf_test_ | Sandbox | 500/mo, watermarked |
Rotation
Keys do not expire. Rotate by requesting a second key, deploying it, then asking for the first to be revoked. Both stay valid during the overlap.
What a key is scoped to
A key belongs to one account and one plan. It is not scoped to a jurisdiction: the same key encodes California and New York, and the jurisdiction is a request field rather than a permission. Team plans issue five keys against one shared quota, which is the right shape for separate services that should not share a secret but should share a bill.
Keys carry no environment other than the prefix. A production key used from a laptop is still a production key, so the prefix is a warning label rather than a safety switch. Treat any key that reaches a browser bundle or a mobile binary as leaked, because it is.
Storing it
Put the key in an environment variable or a secrets manager and read it at start-up. Do not put it in a template, a query string, a git repository or a support ticket. Query string auth is not accepted, which removes one common leak path, but a key pasted into a cURL example in a public issue is still public.
Rotate on a schedule even without a suspected leak. The overlap procedure above means rotation is a deploy, not an outage: issue the second key, deploy it to every consumer, confirm traffic moved, then revoke the first.
Failure modes
| Status | Cause |
|---|---|
401 | Header absent, malformed, or key unknown |
402 | No live plan and no credit balance; the body carries buy_url |
403 | Account suspended |
429 | Quota or rate limit exceeded |
A 401 is a client configuration error and retrying will not fix it. A 402 means the key is
valid but there is nothing left to spend: either renew the plan or buy a package from
buy_url. A 403 means the account is suspended, so the fix is a support
message, not a different header. A 429 is the only one of the four worth retrying, and
only after the interval in Retry-After.