Admin endpoints are protected by a separate key set via the ADMIN_API_KEY environment variable. Include it in every admin request:
curl -H "x-admin-key: YOUR_ADMIN_API_KEY" ...The admin dashboard is accessible at /admin on your frontend URL. Sign in with your ADMIN_API_KEY.
/admin/billing for a platform-wide billing overviewcurl -X POST https://your-api.docustream.com/api/admin/customers \
-H "x-admin-key: YOUR_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp",
"email": "admin@acme.com",
"plan": "starter"
}'The response includes an apiKey. It is shown only once — copy and deliver it to the customer securely.
/admincurl https://your-api.docustream.com/api/admin/customers/cust_abc123/stats \
-H "x-admin-key: YOUR_ADMIN_API_KEY"Response:
{
"customerId": "cust_abc123",
"pdfsGenerated": {
"thisMonth": 47,
"lastMonth": 120,
"total": 342
},
"apiCalls": {
"thisMonth": 215,
"total": 1873
}
}curl https://your-api.docustream.com/api/admin/billing \
-H "x-admin-key: YOUR_ADMIN_API_KEY"Response:
[
{
"customerId": "cust_abc123",
"customerName": "Acme Corp",
"month": "2026-04",
"pdfsGenerated": 47,
"plan": "starter"
}
]