APITemplate.io MCP by usefulapi

v1.27.4
io.usefulapi/apitemplate Checked 6 hours ago Published 14 days ago

Generate PDFs and images with APITemplate.io from templates, HTML, Markdown or a URL.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

apitemplate_get_account Get account and quota

The APITemplate.io account behind this key: plan, subscription status and period, and the quota: api_quota, api_used, api_remaining (generations), plus the template quota and count. Check api_remaining before generating. GET /v2/account-information.

apitemplate_list_templates List templates

List the templates of the account (PDF and image): template_id, name, format (PDF or JPEG), status, group and dates. Use the template_id with the create tools. Read-only; templates are never changed. GET /v2/list-templates.

ParameterTypeDescription
formatstringOnly PDF or only image (JPEG) templates.
group_namestringOnly templates of this group.
limitintegerNumber of records, 1-500 (default 50).
offsetintegerRecords to skip (default 0). Next page: offset + limit.
template_idstringThe template id (apitemplate_list_templates, or the web console, Manage Templates).

apitemplate_get_template Get PDF template source

One PDF template's HTML body, CSS and print settings (the vendor marks this endpoint experimental, so it can answer with an error for some accounts or image templates). Read-only. GET /v2/get-template.

ParameterTypeDescription
template_id *stringThe template id (apitemplate_list_templates, or the web console, Manage Templates).

apitemplate_list_objects List generated files

List the PDFs and images generated so far, newest first: transaction_ref, template_id, type (PDF, JPEG or MERGE), your meta reference, the hosted file URLs (primary_url, secondary_url for the PNG) and dates. Files already deleted or expired have deletion_status set. Read-only. GET /v2/list-objects.

ParameterTypeDescription
limitintegerNumber of records, 1-500 (default 50).
offsetintegerRecords to skip (default 0). Next page: offset + limit.
template_idstringOnly files generated from this template.
transaction_typestringOnly this kind of file.

apitemplate_create_pdf Create a PDF from a template

WRITE: renders one PDF from a saved PDF template and your JSON data (the keys the template uses, e.g. invoice_number, items), and returns the hosted download_url (never the file bytes). Synchronous. COST: uses 1 generation of your APITemplate.io plan quota per call (see apitemplate_get_account). Do not retry or repeat it unless needed; every call is counted. POST /v2/create-pdf (export_type=json).

ParameterTypeDescription
data *objectJSON data merged into the template, e.g. {"invoice_number":"INV-1","total":42}. Keys depend on the template.
template_id *stringThe template id (apitemplate_list_templates, or the web console, Manage Templates).
expirationintegerMinutes until the hosted file expires: 0 = keep permanently (default), or 1-10080.
filenamestringCustom file name ending in .pdf (default: a random UUID).
generation_delayintegerMilliseconds to wait before rendering (0-30000), for pages that load content late.
metastringYour own reference id for this file; it shows up in apitemplate_list_objects.
output_htmlbooleanAlso return html_url, the rendered HTML.

apitemplate_create_image Create an image from a template

WRITE: renders one image (JPEG and PNG) from a saved image template, changing the named layers with overrides (e.g. [{"name":"text_1","text":"Hello"},{"name":"image_1","src":"https://..."}]), and returns the hosted download URLs (never the file bytes). COST: uses 1 generation of your APITemplate.io plan quota per call (see apitemplate_get_account). Do not retry or repeat it unless needed; every call is counted. POST /v2/create-image.

ParameterTypeDescription
overrides *arrayLayer changes: each item has the layer 'name' and the properties to set (text, src, color, textBackgroundColor ...).
template_id *stringThe template id (apitemplate_list_templates, or the web console, Manage Templates).
expirationintegerMinutes until the hosted file expires: 0 = keep permanently (default), or 1-10080.
generation_delayintegerMilliseconds to wait before rendering (0-30000), for pages that load content late.
metastringYour own reference id for this file; it shows up in apitemplate_list_objects.
output_image_typestringWhich formats to render (default all).

apitemplate_create_pdf_from_html Create a PDF from HTML

WRITE: renders one PDF from HTML (Jinja2 placeholders like {{name}} are filled from data), without a saved template, and returns the hosted download_url (never the file bytes). COST: uses 1 generation of your APITemplate.io plan quota per call (see apitemplate_get_account). Do not retry or repeat it unless needed; every call is counted. POST /v2/create-pdf-from-html (export_type=json).

ParameterTypeDescription
body *stringHTML body; may use Jinja2 syntax such as {{name}}.
cssstringCSS including the <style> tag.
dataobjectValues for the placeholders in body, e.g. {"name":"Jo"}.
expirationintegerMinutes until the hosted file expires: 0 = keep permanently (default), or 1-10080.
filenamestringCustom file name ending in .pdf (default: a random UUID).
generation_delayintegerMilliseconds to wait before rendering (0-30000), for pages that load content late.
metastringYour own reference id for this file; it shows up in apitemplate_list_objects.
settingsobjectPDF print settings.

apitemplate_create_pdf_from_markdown Create a PDF from Markdown

WRITE: renders one PDF from Markdown (Jinja2 placeholders like {{lang}} are filled from data) and returns the hosted download_url (never the file bytes). COST: uses 1 generation of your APITemplate.io plan quota per call (see apitemplate_get_account). Do not retry or repeat it unless needed; every call is counted. POST /v2/create-pdf-from-markdown (export_type=json).

ParameterTypeDescription
body *stringMarkdown text; may use Jinja2 syntax such as {{lang}}.
cssstringCSS including the <style> tag.
dataobjectValues for the placeholders in body.
expirationintegerMinutes until the hosted file expires: 0 = keep permanently (default), or 1-10080.
filenamestringCustom file name ending in .pdf (default: a random UUID).
generation_delayintegerMilliseconds to wait before rendering (0-30000), for pages that load content late.
metastringYour own reference id for this file; it shows up in apitemplate_list_objects.
settingsobjectPDF print settings.

apitemplate_create_pdf_from_url Create a PDF from a web page URL

WRITE: APITemplate.io opens one public web page URL and prints it to a PDF, and returns the hosted download_url (never the file bytes). The page is fetched by APITemplate.io, not by this server; pages that need a login cannot be printed. COST: uses 1 generation of your APITemplate.io plan quota per call (see apitemplate_get_account). Do not retry or repeat it unless needed; every call is counted. POST /v2/create-pdf-from-url (export_type=json).

ParameterTypeDescription
url *stringThe public http(s) URL of the page to print.
expirationintegerMinutes until the hosted file expires: 0 = keep permanently (default), or 1-10080.
filenamestringCustom file name ending in .pdf (default: a random UUID).
generation_delayintegerMilliseconds to wait before rendering (0-30000), for pages that load content late.
metastringYour own reference id for this file; it shows up in apitemplate_list_objects.
settingsobjectPDF print settings.

apitemplate_merge_pdfs Merge PDFs

WRITE: joins 2-20 PDFs (public http(s) URLs, in the given order, e.g. earlier download_url values) into one PDF and returns the hosted primary_url (never the file bytes). The source files are not changed or deleted. COST: uses 1 generation of your APITemplate.io plan quota per call (see apitemplate_get_account). Do not retry or repeat it unless needed; every call is counted. POST /v2/merge-pdfs (export_type=json).

ParameterTypeDescription
urls *arrayThe PDF URLs to join, in order.
expirationintegerMinutes until the hosted file expires: 0 = keep permanently (default), or 1-43200.
metastringYour own reference id for this file; it shows up in apitemplate_list_objects.