Render template
render_templateCreate a PDF from a stored template (a curated makesPDF library template or one the user saved) filled with the user's data. Use when the user asks for a PDF of a structured document, such as an invoice, receipt, quote, certificate or resume, that a template covers. Uses the user's makesPDF credits: 1 credit per 10 pages. Returns JSON metadata (pageCount, creditsDeducted, creditsRemaining, artifactId, downloadUrl) plus the PDF bytes as an embedded base64 resource and a resource_link to downloadUrl. On the Free and Hobbyist plans, unless the account holds Growth credits, each page carries a small makespdf.com link. Mirrors POST /api/v1/render with the { templateId, data } body shape.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"templateId": "<templateId>"
},
"name": "render_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Binding data substituted into {{var}} expressions. When omitted, the `const sampleData` declared inside the template's DSL is used; the separately stored sampleData field is not. | |
| title | No | Document title written to the PDF metadata. PDF viewers show it in the window title instead of the file name. When omitted, the template's saved name is used; a title set in the DSL's doc() is not. | |
| templateId | Yes | Template ID — slug for library rows (e.g. 'invoice-classic') or UUID for user rows. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| renderMs | Yes | Server-side render time in milliseconds. | |
| pageCount | Yes | Pages in the rendered PDF. | |
| sizeBytes | Yes | Size of the PDF in bytes. | |
| artifactId | No | ID of the stored render artifact, also served at GET /api/v1/artifacts/{id}/pdf. Absent when the artifact could not be recorded. | |
| templateId | Yes | Template ID: a slug for library templates, a UUID for your own. | |
| downloadUrl | No | Short-lived signed URL that downloads the rendered PDF with no credential of its own. Absent when the artifact could not be recorded. | |
| creditsDeducted | Yes | Credits charged for this render: 1 per 10 pages, rounded up; 0 when the caller is not billed. | |
| creditsRemaining | Yes | Credit balance after the charge; null when the caller is not billed. | |
| templateWarnings | Yes | Problems found while binding data (unsupported expressions, unknown filters, bad currency codes, invalid chart data, …). Unresolved expressions render as empty text and bad chart data affects the chart. Each originates in the DSL or the data. | |
| downloadUrlExpiresAt | No | When `downloadUrl` stops working, as an ISO 8601 timestamp. |