Get Started
Templating
API Documentation
Sync/Async options
Template
From Template
Create the template and directly return the raw result.
POST
/
v1
/
template
/
{id}
Copy
curl --request POST \
--url https://api.doczilla.app/v1/template/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"page": {
"url": "<string>",
"html": "<string>",
"htmlTemplate": "<string>",
"templateData": {},
"waitUntil": "auto",
"waitForMilliseconds": 2500,
"waitForSelector": {
"selector": "<string>",
"options": {
"visible": false,
"hidden": false,
"timeout": 10000
}
},
"waitForFunction": {
"pageFunction": "window.innerWidth < 100",
"options": {
"polling": "raf",
"timeout": 10000
}
},
"headers": {
"x-foo": "bar"
},
"adblock": true,
"javascript": true,
"cookies": [
{
"name": "<string>",
"value": "<string>",
"domain": "<string>",
"url": "<string>",
"path": "<string>",
"secure": true,
"httpOnly": true,
"sameSite": "Strict",
"expires": 123
}
],
"authentication": {
"username": "<string>",
"password": "<string>"
},
"colorScheme": "<string>",
"mediaType": "screen",
"timezone": "<string>"
},
"screenshot": {
"type": "png",
"device": "Macbook Pro 16",
"viewport": {
"width": 2240,
"height": 1260,
"deviceScaleFactor": 1,
"isMobile": false,
"hasTouch": false,
"isLandscape": false
},
"fullPage": false,
"fromSurface": true,
"omitBackground": false,
"optimizeForSpeed": true,
"quality": 50,
"captureBeyondViewport": false,
"clip": {
"scale": 1,
"width": 2240,
"height": 1260,
"x": 123,
"y": 123
},
"element": "<string>",
"overlay": {
"background": "<string>",
"filter": "none",
"margin": 0.2,
"browser": "light",
"screenshotBorderRadius": 0
}
},
"pdf": {
"scale": 1,
"displayHeaderFooter": false,
"headerHtml": "<string>",
"footerHtml": "<string>",
"printBackground": false,
"landscape": false,
"pageRanges": "1-5",
"format": "letter",
"width": "<string>",
"height": "<string>",
"preferCSSPageSize": false,
"margin": {
"top": "<string>",
"bottom": "<string>",
"left": "<string>",
"right": "<string>"
},
"omitBackground": false,
"outline": false,
"tagged": false
}
}'
Copy
This response does not have an example.
All provided options are optional and will be merged with those defined in the template.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Body
application/json
Response
201
application/pdf
Raw PDF/Image document
Was this page helpful?
Copy
curl --request POST \
--url https://api.doczilla.app/v1/template/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"page": {
"url": "<string>",
"html": "<string>",
"htmlTemplate": "<string>",
"templateData": {},
"waitUntil": "auto",
"waitForMilliseconds": 2500,
"waitForSelector": {
"selector": "<string>",
"options": {
"visible": false,
"hidden": false,
"timeout": 10000
}
},
"waitForFunction": {
"pageFunction": "window.innerWidth < 100",
"options": {
"polling": "raf",
"timeout": 10000
}
},
"headers": {
"x-foo": "bar"
},
"adblock": true,
"javascript": true,
"cookies": [
{
"name": "<string>",
"value": "<string>",
"domain": "<string>",
"url": "<string>",
"path": "<string>",
"secure": true,
"httpOnly": true,
"sameSite": "Strict",
"expires": 123
}
],
"authentication": {
"username": "<string>",
"password": "<string>"
},
"colorScheme": "<string>",
"mediaType": "screen",
"timezone": "<string>"
},
"screenshot": {
"type": "png",
"device": "Macbook Pro 16",
"viewport": {
"width": 2240,
"height": 1260,
"deviceScaleFactor": 1,
"isMobile": false,
"hasTouch": false,
"isLandscape": false
},
"fullPage": false,
"fromSurface": true,
"omitBackground": false,
"optimizeForSpeed": true,
"quality": 50,
"captureBeyondViewport": false,
"clip": {
"scale": 1,
"width": 2240,
"height": 1260,
"x": 123,
"y": 123
},
"element": "<string>",
"overlay": {
"background": "<string>",
"filter": "none",
"margin": 0.2,
"browser": "light",
"screenshotBorderRadius": 0
}
},
"pdf": {
"scale": 1,
"displayHeaderFooter": false,
"headerHtml": "<string>",
"footerHtml": "<string>",
"printBackground": false,
"landscape": false,
"pageRanges": "1-5",
"format": "letter",
"width": "<string>",
"height": "<string>",
"preferCSSPageSize": false,
"margin": {
"top": "<string>",
"bottom": "<string>",
"left": "<string>",
"right": "<string>"
},
"omitBackground": false,
"outline": false,
"tagged": false
}
}'
Copy
This response does not have an example.
Assistant
Responses are generated using AI and may contain mistakes.