POST/v1/pdfs
Make a PDF from a template, HTML or a public URL
Costs one unit per page. A template without format prints at its own pixel size, one page; HTML and URLs paginate at the paper size you pick.
REQUEST BODY · APPLICATION/JSON · REQUIRED
{
"html": "<h1>Invoice #1042</h1><p>Total due: $420.00</p>",
"format": "A4",
"margin": "20mm"
}
REQUEST
curl -X POST "https://api.imageapis.com/v1/pdfs" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Invoice #1042</h1><p>Total due: $420.00</p>",
"format": "A4",
"margin": "20mm"
}'
import requests
r = requests.post("https://api.imageapis.com/v1/pdfs", headers={"X-API-Key": "YOUR_KEY"}, json={
"html": "<h1>Invoice #1042</h1><p>Total due: $420.00</p>",
"format": "A4",
"margin": "20mm"
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.imageapis.com/v1/pdfs", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"html": "<h1>Invoice #1042</h1><p>Total due: $420.00</p>",
"format": "A4",
"margin": "20mm"
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200With response=binary: the file itself, with X-Image-Id and X-Image-Url headers
201Created
{
"id": "pdf_2wq9tkz7hvbx4nmc8rde",
"object": "pdf",
"status": "completed",
"url": "https://img.imageapis.com/i/pdf_2wq9tkz7hvbx4nmc8rde.pdf",
"format": "pdf",
"pages": 2,
"bytes": 90412,
"units": 2,
"created": "2026-10-10T18:10:40Z",
"completed": "2026-10-10T18:10:42Z",
"expires": "2026-11-09T18:10:40Z"
}
202Accepted: rendering in the background; the record has status pending and the webhook gets the finished one
{
"id": "pdf_2wq9tkz7hvbx4nmc8rde",
"object": "pdf",
"status": "completed",
"url": "https://img.imageapis.com/i/pdf_2wq9tkz7hvbx4nmc8rde.pdf",
"format": "pdf",
"pages": 2,
"bytes": 90412,
"units": 2,
"created": "2026-10-10T18:10:40Z",
"completed": "2026-10-10T18:10:42Z",
"expires": "2026-11-09T18:10:40Z"
}