Attest tools · template_render

Document and card renderer

a task needs a PNG or PDF built from content the caller already has — HTML, Markdown, or a built-in social card, invoice, certificate or pull-quote template — for example an OG image, a receipt, a one-page report or a…

2 credits per successful callPOST /api/v1/render

Bearer key · JSON

POST /api/v1/render

curl -s -X POST https://getattest.com.au/api/v1/render \
  -H "authorization: Bearer $ATTEST_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'

Send the key as a bearer token in the authorization header. One key and one credit balance cover every service, including Attest Capture. A failed call is refunded automatically. No key yet? POST /api/v1/keys issues one with 25 free credits and no signup — see the key guide.

For agents

Use when

Use this when a task needs a PNG or PDF built from content the caller already has — HTML, Markdown, or a built-in social card, invoice, certificate or pull-quote template — for example an OG image, a receipt, a one-page report or a printable summary. It renders content you supply; it does not visit or screenshot a live website (use /api/v1/capture for that).

Not documented yet: a captured example response. This page only shows what the module publishes about itself, so the missing parts are absent rather than guessed at.

10 fields

Input

Scroll the table horizontally to see all fields.

Field / Type / Required / What it does
FieldTypeRequiredWhat it does
htmlstringOptionalHTML to render. Exactly one of html, markdown or data.
markdownstringOptionalMarkdown to render.
dataobjectOptionalFields for a built-in template. Name the template with data.template: og_card, invoice, certificate or quote.
formatstringOptionalpng (default) or pdf.
widthintegerOptionalRender width in pixels, 200-2400.
heightintegerOptionalRender height in pixels, 200-4000. PNG only.
scaleintegerOptionalDevice pixel ratio, 1-3. PNG only.
page_sizestringOptionalPage size such as A4. PDF only.
landscapebooleanOptionalLandscape orientation. PDF only.
margin_mmintegerOptionalPage margin in millimetres, 0-50.

HTTP 200

Response

Every successful response also carries call_id (your receipt for the charge), credits_charged and credits_remaining.

Scroll the table horizontally to see all fields.

Field / What it holds
FieldWhat it holds
formatpng or pdf.
source_formatWhether the content came from html, markdown or a template.
templateThe built-in template used, when one was.
widthWidth of the output, in unit.
heightHeight of the output, in unit.
pagesPage count, for a PDF.
content_typeThe media type of the produced file.
bytesSize of the produced file.
sha256SHA-256 of the produced bytes.
file_base64The produced file.
subresourcesWhat the page was allowed to load while rendering.
templatesEvery built-in template name.
limitsThe caps that applied.

Machine-readable failures

Errors

Errors return JSON such as {"error":"invalid_api_key"}. A failed call is refunded automatically.

Scroll the table horizontally to see all fields.

Code / Status / Meaning
CodeStatusMeaning
content_required400None of html, markdown or data was sent.
multiple_content_sources400More than one of html, markdown or data was sent.
height_not_supported_for_pdf400height was sent with format pdf, which sizes by page instead.
scale_not_supported_for_pdf400scale was sent with format pdf.
page_size_not_supported_for_png400page_size was sent with format png.
landscape_not_supported_for_png400landscape was sent with format png.
invalid_template400data.template is not a built-in template.
template_field_required400The template needs a field that was not supplied.
unknown_template_field400data carries a field the template does not have.
data_uri_not_allowed400The HTML embeds a data: URI of a kind this renderer refuses.
navigation_not_allowed400The content tried to navigate the renderer to another page.
content_too_complex400The content is past the render budget.
render_timeout502The render did not finish inside the budget. Not charged.
render_too_large502The render produced more than the response cap. Not charged.
render_failed502The content could not be rendered. Not charged.

On every service

Scroll the table horizontally to see all fields.

Code / Status / Meaning
CodeStatusMeaning
invalid_api_key401The authorization header is missing or the key is unknown.
insufficient_credits402The balance is below this call's cost. The response carries credits_required and credits_remaining.
rate_limit_exceeded429Free keys share 10 calls a minute across every service. The response carries limit and window_seconds.
services_unavailable503The credit store could not be reached. Retry once after 30 seconds.

Where the answer comes from

Source and scope

Rendered from the content supplied, in a headless Chromium whose network access is limited to public http(s) addresses. It does not visit or screenshot a live website - /api/v1/capture does that. Attest does not check the figures or wording of what is rendered.

Attest reports what it read, with the source it read it from. It is general information, not advice, and not a legal record.

All Attest tools · Service list as JSON · OpenAPI

Same key as every Attest tool

One key. One balance. 2 credits a call.

Issue a free key, then use it here, on Attest Capture and on every other tool in the box.

Get a free key