🔑 Authentication
Every request to the DocParse API must include an API key in the
Authorization header.
Get your API key
- Sign in to the dashboard.
- Open the API page from the sidebar.
- Click Create new API key, give it a name (e.g. Production), and copy the key that appears. You only see the full key once.
You can have up to 5 active keys at a time. Revoke a key from the same page — requests using it will start failing immediately.
Treat your API key like a password. Store it in a server-side secret manager. Never commit it to git, ship it in client-side JavaScript, or share it in chat.
Use your API key
Pass the key as a Bearer token in the Authorization header on
every request:
bash
curl https://api.docparse-labs.vercel.app/v1/extractions \
-H "Authorization: Bearer dp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"typescript
const res = await fetch("https://api.docparse-labs.vercel.app/v1/extractions", {
headers: {
"Authorization": `Bearer ${process.env.DOCPARSE_API_KEY}`,
"Content-Type": "application/json",
},
});python
import os, requests
headers = {"Authorization": f"Bearer {os.environ['DOCPARSE_API_KEY']}"}
res = requests.get("https://api.docparse-labs.vercel.app/v1/extractions", headers=headers)Errors
A missing or invalid key returns 401 Unauthorized:
json
{
"error": "Invalid or revoked API key."
}A revoked or rate-limited key returns the same code with a different message — check the body for the specific reason.
Rotating keys
To rotate a key without downtime:
- Create a new key in the dashboard.
- Update your servers to use it.
- Revoke the old key once you've confirmed traffic moved over.
Because each key is independent, you can run both for as long as you need during the migration.