{"openapi":"3.1.0","info":{"title":"printpipe.io API","version":"1.0.0","description":"Convert HTML, a web page or a saved template to PDF, PNG or JPEG with headless Chromium, and manage templates, usage and conversion history. Each file costs 1 credit per started MB; failed conversions are free. Authenticate with your API key in the X-API-Key header (or Authorization: Bearer)."},"servers":[{"url":"https://api.printpipe.io"}],"security":[{"apiKey":[]},{"bearer":[]}],"tags":[{"name":"Conversion","description":"Make PDFs and screenshots."},{"name":"Templates","description":"Saved templates: HTML with {{placeholders}}, filled per request."},{"name":"Account","description":"Usage and conversion history."}],"paths":{"/v1/generate":{"post":{"operationId":"generate","tags":["Conversion"],"summary":"Convert HTML, a URL or a template to PDF or an image","description":"Send html (the HTML itself, or a public URL to open) or templateId with data. The answer is the file. With callBackUrl the API answers 202 at once and POSTs the file to your URL later.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequest"}},"text/html":{"schema":{"type":"string","description":"The HTML; options go in the query string."}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","contentEncoding":"binary","description":"The HTML file (or send it in a field named html)."}},"additionalProperties":{"type":"string"},"description":"The HTML in a file field; every other option as a form field."}}}},"responses":{"200":{"description":"The file.","headers":{"X-Credits-Charged":{"schema":{"type":"integer"},"description":"Credits this file cost."},"X-Credits-Remaining":{"schema":{"type":"integer"},"description":"Credits left this billing month."},"Content-Disposition":{"schema":{"type":"string"},"description":"attachment; filename=\"…\""}},"content":{"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}},"image/png":{"schema":{"type":"string","contentEncoding":"binary"}},"image/jpeg":{"schema":{"type":"string","contentEncoding":"binary"}}}},"202":{"description":"Accepted (with callBackUrl): the file will be POSTed to callBackUrl.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"accepted"}},"required":["status"]}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"errorCode 30: All credits of your billing month are used. They reset on your monthly billing date.\n\nerrorCode 31: The PDF or image is larger than your plan allows (5 MB on Free).\n\nerrorCode 34: Your plan doesn’t include this feature, e.g. callBackUrl (Plus, Pro and Enterprise) or passwords and header/footer templates (Basic, Plus, Pro and Enterprise). Also for an API key or saved template beyond your plan’s allowance after a downgrade: it’s kept, and works again after an upgrade.\n\nerrorCode 35: This API key’s own monthly credit limit is used (set in your dashboard). Your other keys keep working.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"errorCode 10: the request body is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"errorCode 10: unsupported Content-Type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"errorCode 32: Too many conversions at the same time for your plan, or for this key’s own parallel limit. Retry shortly.\n\nerrorCode 33: Too many requests: the Free plan’s daily limit, or the online converter’s hourly limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"errorCode 50: Something broke on our side. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"errorCode 51: All renderers are busy. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"callbacks":{"document":{"{$request.body#/callBackUrl}":{"post":{"summary":"The finished file (async conversions)","description":"Signed with the X-Webhook-Signature header; check it before trusting the body. A failed conversion sends no callback.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"string","contentEncoding":"base64","description":"The file."},"state":{"anyOf":[{"type":"string","description":"The state you sent."},{"type":"null"}]},"contentType":{"type":"string","enum":["application/pdf","image/png","image/jpeg"]}},"required":["document","state","contentType"]}}}},"responses":{"200":{"description":"Received. Any 2xx answer counts."}}}}}}}},"/v1/templates":{"get":{"operationId":"listTemplates","tags":["Templates"],"summary":"List saved templates","responses":{"200":{"description":"The templates and the plan’s allowance.","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"bytes":{"type":"integer","description":"Size of the HTML in bytes."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"disabled":{"type":"boolean","description":"Beyond the plan’s allowance (after a downgrade): kept but not usable."}},"required":["id","name","bytes","createdAt","updatedAt"]}},"maxTemplates":{"type":"integer"},"plan":{"type":"string"}},"required":["templates","maxTemplates","plan"]}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTemplate","tags":["Templates"],"summary":"Create a template","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateInput"}}}},"responses":{"201":{"description":"The new template.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"errorCode 30: All credits of your billing month are used. They reset on your monthly billing date.\n\nerrorCode 31: The PDF or image is larger than your plan allows (5 MB on Free).\n\nerrorCode 34: Your plan doesn’t include this feature, e.g. callBackUrl (Plus, Pro and Enterprise) or passwords and header/footer templates (Basic, Plus, Pro and Enterprise). Also for an API key or saved template beyond your plan’s allowance after a downgrade: it’s kept, and works again after an upgrade.\n\nerrorCode 35: This API key’s own monthly credit limit is used (set in your dashboard). Your other keys keep working.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/preview":{"post":{"operationId":"previewTemplate","tags":["Templates"],"summary":"Preview a template for free","description":"A draft (html, css, options, sampleData) or a saved template (templateId, sampleData), rendered with a \"Preview\" stamp. Free, up to 60 an hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TemplatePreviewDraft"},{"$ref":"#/components/schemas/TemplatePreviewSaved"}]}}}},"responses":{"200":{"description":"The preview.","content":{"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}},"image/png":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"errorCode 13: There is no template with this templateId in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"errorCode 32: Too many conversions at the same time for your plan, or for this key’s own parallel limit. Retry shortly.\n\nerrorCode 33: Too many requests: the Free plan’s daily limit, or the online converter’s hourly limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The template id (see GET /v1/templates).","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTemplate","tags":["Templates"],"summary":"Get a template","responses":{"200":{"description":"The template.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"errorCode 13: There is no template with this templateId in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"replaceTemplate","tags":["Templates"],"summary":"Replace a template","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateInput"}}}},"responses":{"200":{"description":"The changed template.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"errorCode 13: There is no template with this templateId in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateTemplate","tags":["Templates"],"summary":"Change some fields of a template","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePatch"}}}},"responses":{"200":{"description":"The changed template.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"errorCode 13: There is no template with this templateId in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteTemplate","tags":["Templates"],"summary":"Delete a template","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string","format":"uuid"}},"required":["deleted"]}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"errorCode 13: There is no template with this templateId in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/{id}/duplicate":{"parameters":[{"name":"id","in":"path","required":true,"description":"The template id (see GET /v1/templates).","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"duplicateTemplate","tags":["Templates"],"summary":"Copy a template","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Default \"Copy of …\"."}},"additionalProperties":false}}}},"responses":{"201":{"description":"The copy.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"errorCode 30: All credits of your billing month are used. They reset on your monthly billing date.\n\nerrorCode 31: The PDF or image is larger than your plan allows (5 MB on Free).\n\nerrorCode 34: Your plan doesn’t include this feature, e.g. callBackUrl (Plus, Pro and Enterprise) or passwords and header/footer templates (Basic, Plus, Pro and Enterprise). Also for an API key or saved template beyond your plan’s allowance after a downgrade: it’s kept, and works again after an upgrade.\n\nerrorCode 35: This API key’s own monthly credit limit is used (set in your dashboard). Your other keys keep working.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"errorCode 13: There is no template with this templateId in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"operationId":"getUsage","tags":["Account"],"summary":"Plan, credits and daily usage","parameters":[{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"Usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/conversions":{"get":{"operationId":"listConversions","tags":["Account"],"summary":"Conversion history, newest first","description":"printpipe.io records that a conversion happened, never the HTML, URL or file.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["success","failed"]}},{"name":"keyId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["html","url","template"]}},{"name":"output","in":"query","required":false,"schema":{"type":"string","enum":["pdf","png","jpeg"]}}],"responses":{"200":{"description":"One page of conversions. Pass next as before to get the following page.","content":{"application/json":{"schema":{"type":"object","properties":{"conversions":{"type":"array","items":{"$ref":"#/components/schemas/Conversion"}},"next":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"retentionDays":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["conversions","next","retentionDays"]}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/conversions.csv":{"get":{"operationId":"exportConversions","tags":["Account"],"summary":"Conversion history as CSV","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["success","failed"]}},{"name":"keyId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["html","url","template"]}},{"name":"output","in":"query","required":false,"schema":{"type":"string","enum":["pdf","png","jpeg"]}}],"responses":{"200":{"description":"CSV, newest first.","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"errorCode 10: The body is not a JSON object, HTML file or multipart form, or the request is malformed. An unsupported Content-Type gets 415 with this code.\n\nerrorCode 11: A parameter is unknown or invalid. The message names it.\n\nerrorCode 12: The page could not be rendered: unreachable or blocked URL, DNS error, TLS error or timeout.\n\nerrorCode 14: The template could not be filled in: a syntax error, or the result is larger than 5 MB. The message says where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"errorCode 20: The X-API-Key header is missing, or the key is invalid, revoked or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"},"bearer":{"type":"http","scheme":"bearer","description":"The API key as a bearer token."}},"schemas":{"Error":{"type":"object","properties":{"errorCode":{"type":"integer","enum":[10,11,12,13,14,15,20,30,31,32,33,34,35,50,51]},"message":{"type":"string","description":"What went wrong, for people."}},"required":["errorCode","message"]},"GenerateRequest":{"type":"object","properties":{"html":{"type":"string","minLength":1,"description":"The HTML to convert, or a public URL (http or https) to open. Up to 5 MB; for larger pages pass a URL. Not needed with templateId."},"output":{"default":"pdf","type":"string","enum":["pdf","png","jpeg"],"description":"What to produce: a PDF, or a screenshot of the page as PNG or JPEG. Screenshots cost credits like PDFs (1 per started MB)."},"fullPage":{"type":["boolean","null"],"description":"Screenshots only. Capture the whole page (default), or false for just the browser window. Pages are cut off at 16384 device pixels."},"quality":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}],"description":"JPEG screenshots only. Image quality; higher is sharper and larger. Default 80."},"landscape":{"default":false,"type":"boolean","description":"Landscape orientation."},"format":{"default":"A4","type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"],"description":"Paper size. Ignored when width and height are set, and for screenshots."},"width":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":19200},{"type":"null"}],"description":"Custom page width in CSS pixels (96 per inch). Use together with height. Screenshots: the browser window width (default 1280)."},"height":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":19200},{"type":"null"}],"description":"Custom page height in CSS pixels. Use together with width. Screenshots: the browser window height (default 800)."},"singlePage":{"default":false,"type":"boolean","description":"Put the whole document on one page as tall as the content (up to 200 inches). Width comes from width or format; height is ignored. (Paid plans.)"},"marginTop":{"default":0,"type":"integer","minimum":0,"maximum":2000,"description":"Top margin in CSS pixels."},"marginRight":{"default":0,"type":"integer","minimum":0,"maximum":2000,"description":"Right margin in CSS pixels."},"marginBottom":{"default":0,"type":"integer","minimum":0,"maximum":2000,"description":"Bottom margin in CSS pixels."},"marginLeft":{"default":0,"type":"integer","minimum":0,"maximum":2000,"description":"Left margin in CSS pixels."},"waitFor":{"default":0,"type":"number","minimum":0,"maximum":10,"description":"Extra seconds to wait after the page loaded, for content added by JavaScript."},"lazyLoad":{"type":"boolean","description":"Scroll through the page first, so images and sections that load or fade in on scroll appear (stops after 12 s). Default: on for URLs, off for HTML; set false to skip it for a URL."},"acceptCookies":{"type":"boolean","description":"Click \"Accept all\" on cookie banners first, so they don’t cover the page. Works with the common consent tools (OneTrust, Cookiebot, Didomi, Usercentrics and more) and banners in most European languages. Default: on for URLs, off for HTML; set false to capture the page as a first-time visitor sees it."},"media":{"default":"screen","type":"string","enum":["print","screen"],"description":"Which CSS media type to apply: screen styles (as in a browser window) or your @media print rules."},"printBackground":{"default":true,"type":"boolean","description":"Print background colours and images."},"scale":{"default":1,"type":"number","minimum":0.1,"maximum":2,"description":"Zoom factor for the content. Screenshots: the pixel density, e.g. 2 for a sharp (retina) image twice the size."},"headerTemplate":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"description":"HTML printed at the top of every page. Elements with the classes pageNumber, totalPages, date, title and url are filled in. Needs a top margin to be visible. (Paid plans.)"},"footerTemplate":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"description":"Like headerTemplate, at the bottom of every page. Needs a bottom margin. (Paid plans.)"},"userPassword":{"anyOf":[{"type":"string","maxLength":127},{"type":"null"}],"description":"Password needed to open the PDF. Setting it (or ownerPassword) encrypts the file with AES-256. (Paid plans.)"},"ownerPassword":{"anyOf":[{"type":"string","maxLength":127},{"type":"null"}],"description":"Password that lifts the permission restrictions. Random when you set only userPassword. (Paid plans.)"},"permissions":{"default":["print"],"maxItems":8,"type":"array","items":{"type":"string","enum":["print","modify","copy","edit","fillform","extract","assemble","printbest"]},"description":"What readers may do with an encrypted PDF without the owner password. (Paid plans.)"},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Instead of html: the id of a template you saved in your dashboard (under Templates). It is filled in with data."},"data":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The values for templateId, as JSON. {{name}} in the template prints a value (HTML-escaped), {{#items}}…{{/items}} repeats for each item of a list."},"css":{"type":["string","null"],"description":"Override CSS for this request, e.g. a customer’s brand colours: added after the styles of the HTML (or of the template, including its own override CSS), so it wins. Plain CSS, not filled with data. Works with html and templateId, not with a URL."},"callBackUrl":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}],"description":"Plus, Pro and Enterprise plans. Convert in the background: the API answers 202 at once and POSTs {\"document\": base64 file, \"state\": …, \"contentType\": \"application/pdf\"} to this public URL when done."},"state":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"description":"Any text (up to 1 KB) returned unchanged in the callback, e.g. your order id or a secret to verify the callback."},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"File name for the result (sent in Content-Disposition). \".pdf\", \".png\" or \".jpg\" is added when missing."}},"additionalProperties":false},"TemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"html":{"type":"string","minLength":1},"css":{"default":"","type":"string"},"options":{"default":{},"type":"object","properties":{"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"width":{"type":"integer","exclusiveMinimum":0,"maximum":19200},"height":{"type":"integer","exclusiveMinimum":0,"maximum":19200},"marginTop":{"type":"integer","minimum":0,"maximum":2000},"marginRight":{"type":"integer","minimum":0,"maximum":2000},"marginBottom":{"type":"integer","minimum":0,"maximum":2000},"marginLeft":{"type":"integer","minimum":0,"maximum":2000},"printBackground":{"type":"boolean"},"media":{"type":"string","enum":["print","screen"]},"scale":{"type":"number","minimum":0.1,"maximum":2}},"additionalProperties":false},"sampleData":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["name","html"],"additionalProperties":false},"TemplatePatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"html":{"type":"string","minLength":1},"css":{"default":"","type":"string"},"options":{"default":{},"type":"object","properties":{"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"width":{"type":"integer","exclusiveMinimum":0,"maximum":19200},"height":{"type":"integer","exclusiveMinimum":0,"maximum":19200},"marginTop":{"type":"integer","minimum":0,"maximum":2000},"marginRight":{"type":"integer","minimum":0,"maximum":2000},"marginBottom":{"type":"integer","minimum":0,"maximum":2000},"marginLeft":{"type":"integer","minimum":0,"maximum":2000},"printBackground":{"type":"boolean"},"media":{"type":"string","enum":["print","screen"]},"scale":{"type":"number","minimum":0.1,"maximum":2}},"additionalProperties":false},"sampleData":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":[],"additionalProperties":false,"description":"Only the fields to change; the others keep their values."},"TemplatePreviewDraft":{"type":"object","properties":{"html":{"type":"string","minLength":1,"maxLength":524288},"css":{"default":"","type":"string","maxLength":524288},"options":{"default":{},"type":"object","properties":{"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"width":{"type":"integer","exclusiveMinimum":0,"maximum":19200},"height":{"type":"integer","exclusiveMinimum":0,"maximum":19200},"marginTop":{"type":"integer","minimum":0,"maximum":2000},"marginRight":{"type":"integer","minimum":0,"maximum":2000},"marginBottom":{"type":"integer","minimum":0,"maximum":2000},"marginLeft":{"type":"integer","minimum":0,"maximum":2000},"printBackground":{"type":"boolean"},"media":{"type":"string","enum":["print","screen"]},"scale":{"type":"number","minimum":0.1,"maximum":2}},"additionalProperties":false},"sampleData":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"output":{"default":"pdf","type":"string","enum":["pdf","png"]}},"required":["html"],"additionalProperties":false},"TemplatePreviewSaved":{"type":"object","properties":{"templateId":{"type":"string","format":"uuid"},"sampleData":{"anyOf":[{"type":"object","description":"Overrides the template’s example data."},{"type":"null"}]},"output":{"type":"string","enum":["pdf","png"],"default":"pdf"}},"required":["templateId"],"additionalProperties":false},"Template":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"bytes":{"type":"integer","description":"Size of the HTML in bytes."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"html":{"type":"string"},"css":{"type":"string","description":"Override CSS, applied after the HTML’s own styles."},"options":{"type":"object","description":"Saved page settings (the generate options)."},"sampleData":{"anyOf":[{"type":"object"},{"type":"null"}]}},"required":["id","name","bytes","createdAt","updatedAt","html","css","options","sampleData"]},"Usage":{"type":"object","properties":{"plan":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"monthlyCredits":{"type":"integer"},"concurrency":{"type":"integer","description":"Conversions at the same time."},"maxPdfBytes":{"anyOf":[{"type":"integer"},{"type":"null"}]}}},"credits":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"},"left":{"type":"integer"},"periodStart":{"type":"string","format":"date-time"},"resetsAt":{"type":"string","format":"date-time"}}},"apiKeys":{"type":"object","properties":{"active":{"type":"integer"},"max":{"type":"integer"}}},"templates":{"type":"object","properties":{"saved":{"type":"integer"},"max":{"type":"integer"}}},"subscription":{"type":"object","properties":{"status":{"type":"string","description":"free, active, trialing, past_due, canceled, …"},"interval":{"anyOf":[{"type":"string","enum":["month","year"]},{"type":"null"}]},"currentPeriodEnd":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"cancelAtPeriodEnd":{"type":"boolean"}}},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"credits":{"type":"integer"}}}}},"required":["plan","credits","apiKeys","templates","subscription","days"]},"Conversion":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"sourceType":{"type":"string","enum":["html","url","template"]},"output":{"type":"string","enum":["pdf","png","jpeg"]},"status":{"type":"string","enum":["success","failed"]},"errorCode":{"anyOf":[{"type":"integer"},{"type":"null"}]},"pdfBytes":{"anyOf":[{"type":"integer","description":"Size of the file produced."},{"type":"null"}]},"credits":{"type":"integer"},"durationMs":{"anyOf":[{"type":"integer"},{"type":"null"}]},"isAsync":{"type":"boolean"},"apiKey":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"revoked":{"type":"boolean"}}},{"type":"null"}]},"template":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}}