API Reference
One endpoint turns HTML or a URL into a PDF. Authenticate with an API token from your dashboard.
Endpoint
POST /api/v1/generate
Headers
| Authorization | Bearer <your-api-token> |
| Content-Type | application/json |
Body parameters
| Param | Type | Description |
|---|---|---|
| html | string | Raw HTML to render. Required if url is omitted. |
| url | string | A webpage to render instead of raw HTML. Required if html is omitted. |
| engine | string | chrome (default) or dompdf. Must be allowed on your plan. |
| response_type | string | file (default, streams the PDF binary) or url (returns JSON with a hosted URL). |
| options | object | Optional: landscape (bool), format (e.g. "a4"), margins (object). |
Example request
curl -X POST https://pdfhtml.yajada.co.id/api/v1/generate \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello World</h1>","engine":"dompdf"}' \
--output document.pdf
Error responses
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API token. |
| 422 | Validation failed (e.g. missing both html and url). |
| 403 | Engine not available on your plan. |
| 429 | Monthly quota exceeded. |