Skip to content

cURL quickstart

The public demo key works immediately (rate-limited: 3 req/min, 50 renders/month, shared by everyone):

Terminal window
curl -X POST https://api.docjet.dev/v1/render \
-H "Authorization: Bearer binfra_9afb57dbb6478c441ad101129fca65847f5745403f9d718b3de6d934c9b63f88" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello from DocJet</h1><p>My first branded PDF.</p>"}' \
--output hello.pdf

Open hello.pdf — that’s a Chromium-rendered PDF from your HTML.

100 renders/month, no card required:

Terminal window
curl -X POST https://api.docjet.dev/v1/signup \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com"}'

Response:

{
"apiKey": "binfra_...",
"tier": "free",
"message": "Save this key — it is shown only once"
}

The key is shown once. Store it (e.g. export DOCJET_API_KEY=binfra_...) and send it as a Bearer token on every request:

Terminal window
-H "Authorization: Bearer $DOCJET_API_KEY"

List the public template catalog (no auth needed):

Terminal window
curl https://api.docjet.dev/v1/templates

Returns [{ "id": "invoice-ro", "name": "Invoice (România)", "description": "...", "outputType": "pdf" }, ...] — 15 templates: invoices (EN/RO), proforma, quote, receipt, certificate, gift certificate, packing slip, shipping label, monthly/analytics reports, OG and social images.

Render one — data holds the template’s Handlebars variables:

Terminal window
curl -X POST "https://api.docjet.dev/v1/render?response=url" \
-H "Authorization: Bearer binfra_9afb57dbb6478c441ad101129fca65847f5745403f9d718b3de6d934c9b63f88" \
-H "Content-Type: application/json" \
-d '{"template_id":"invoice-ro","data":{"supplier":{"name":"DocJet Demo SRL","cui":"RO12345678","regCom":"J40/1234/2026","address":"Str. Exemplu 1, Bucuresti"},"client":{"name":"Acme SRL","cui":"RO87654321","address":"Str. Test 2, Cluj-Napoca"},"series":"DJ","invoiceNo":"001","issueDate":"12.06.2026","items":[{"name":"Consulting","qty":1,"unitPrice":1000,"value":1000}]}}'

POST /v1/render (and /v1/image) support three response modes via the response query parameter:

QueryResponse
(omitted)Raw binary (PDF or PNG) — pipe to a file with --output
?response=urlJSON {"url": "..."} — a signed, expiring download URL
?response=jsonJSON with the document as base64

Signed URLs are the best fit for agents and workflows: pass the URL onward instead of moving binary blobs between steps.

POST /v1/image takes the same body as /v1/render. Image dimensions come from the template (e.g. og-blog is 1200x630, social-square is 1080x1080):

Terminal window
curl -X POST "https://api.docjet.dev/v1/image?response=url" \
-H "Authorization: Bearer $DOCJET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"template_id":"og-blog","data":{"title":"My Post","author":"Me"}}'
Terminal window
curl https://api.docjet.dev/v1/keys/usage \
-H "Authorization: Bearer $DOCJET_API_KEY"

Returns your tier, monthly quota, used and remaining renders for the current period. When you hit the quota, the API returns 429 QUOTA_EXCEEDED with an upgrade hint — see Pricing.