canonical: https://jentic.com/apis/craftmypdf.com/craftmypdf

# CraftMyPDF API

CraftMyPDF provides a REST API for generating PDF documents and images from drag-and-drop templates merged with JSON data. The seven-endpoint API covers synchronous and asynchronous PDF generation, template listing and retrieval, multi-file PDF merging, account information, and a hosted editor session for end users to design their own templates. Authentication uses an API key sent in a header, and the production base URL is api.craftmypdf.com/v1.

## For AI agents

Generate PDFs and images from JSON data and templates, merge PDFs, and embed a hosted template editor with CraftMyPDF. Use when an agent needs to produce branded PDF output programmatically.

## Scope

Does not handle e-signatures, PDF text extraction, or CRM-style document storage - use for generating, merging, and templating PDFs only.

## Capabilities

- Generate a PDF or image synchronously from a saved template merged with JSON data
- Generate a PDF asynchronously when the document is large or rendering takes longer
- Merge multiple PDF files into a single combined document
- List saved templates and retrieve a single template's details
- Embed a hosted template editor in another product so end users can design their own layouts
- Check account information including remaining credits and plan tier

## Use cases

### Invoice and Receipt Generation

An accounting workflow renders a branded invoice for each completed sale. POST /create with the invoice template ID and a JSON payload of line items returns the PDF binary, which is emailed to the customer and stored against the order. The drag-and-drop template means design changes do not require code deploys, and finance can update the layout themselves.

Example prompt: Call POST /create with template_id 'tmpl_inv01' and the invoice JSON, then attach the resulting PDF to the customer's order email.

### Bulk Report Rendering

A scheduled job produces hundreds of monthly account reports. For each customer, the job calls POST /create-async with the report template and customer data, then polls for the rendered file. The async endpoint avoids HTTP timeouts on large or slow renders, and the result is uploaded to object storage for the customer's portal.

Example prompt: For each customer in the monthly batch, POST /create-async with the report template ID and customer data, store the returned PDF in S3 under reports/{customerId}/2026-06.pdf.

### Document Bundling

A loan-origination workflow bundles signed disclosures, the application form, and the credit report into a single PDF for archival. POST /merge-pdfs accepts URLs or base64-encoded files and returns one combined PDF. This avoids using a separate PDF library and keeps the bundling step in the same API.

Example prompt: Call POST /merge-pdfs with the URLs of the signed disclosures, application form, and credit report PDFs, then store the combined output as the loan archive document.

### Self-Serve Template Editing

A SaaS product lets each customer design their own quote template. POST /create-editor-session returns a short-lived URL that loads the CraftMyPDF editor inside an iframe scoped to that user. The user saves their template, and the parent product references the template ID when generating quotes. This adds custom branding without building a layout editor in-house.

Example prompt: Call POST /create-editor-session for user 8821, embed the returned URL in an iframe, and on save record the template_id against the user.

### Agent-Driven PDF Generation

An AI assistant in a billing workflow turns user requests like 'send a paid receipt for invoice 4421' into a CraftMyPDF render and an outbound email. Through Jentic, the agent finds the right CraftMyPDF endpoint by intent, attaches the API key from the vault, and returns the resulting PDF without holding the raw key.

Example prompt: Search Jentic for 'generate pdf from template on craftmypdf', execute POST /create with the receipt template and the invoice payload, and return the PDF URL.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /create | Generate a PDF synchronously from a template and JSON data |
| POST | /create-async | Generate a PDF asynchronously |
| POST | /merge-pdfs | Merge multiple PDFs into one document |
| POST | /create-editor-session | Create an embedded editor session |
| GET | /list-templates | List saved templates |
| GET | /get-template | Get details for a single template |
| GET | /account-info | Get account information and credit balance |

## Key resources

- **PDF Creation** — Synchronous and asynchronous PDF and image generation from templates and JSON data
- **Templates** — List, retrieve, and reference saved drag-and-drop templates
- **Editor Sessions** — Create scoped editor sessions for embedding the template designer
- **PDF Operations** — Merge multiple PDFs into a single combined document
- **Account** — Retrieve account information including remaining credits

## Why Jentic

- **Setup:** Wiring CraftMyPDF by hand means managing its API-key header and choosing between the synchronous /create and the /create-async path depending on document size yourself. Through Jentic you install once, import CraftMyPDF from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** CraftMyPDF passes template ids and data in the request body rather than as URL resource ids, so scope the agent to the operations it needs, such as generating a PDF or merging PDFs. Reading templates or account info stays out unless you include those operations.
- **Credential handling:** Your CraftMyPDF API key is stored once, encrypted, by your own Jentic One instance and injected as the request header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate an invoice PDF' or 'merge PDFs', and Jentic returns the matching CraftMyPDF operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **PDFMonkey API** — PDFMonkey is a similar template-based PDF generation API.
- **Docupilot API** — Docupilot generates documents from Word and PDF templates with merge fields.
- **PDF Generator API** — PDF Generator API is another template-merge PDF service with multi-tenant template editors.
- **PDF.co API** — PDF.co provides additional PDF utilities such as parsing, splitting, and OCR.

## FAQ

### What authentication does the CraftMyPDF API use?

CraftMyPDF uses an API key sent in a request header. Through Jentic, the API key is stored encrypted in the vault and added to outgoing requests at execution time, so it never appears in the agent's prompt.

### Can I generate a PDF asynchronously through the CraftMyPDF API?

Yes. POST /create-async submits a render job and returns a transaction reference. This is the right call when the PDF is large or the template is heavy enough that synchronous rendering risks an HTTP timeout.

### How do I merge several PDFs through Jentic?

Search Jentic for 'merge pdfs on craftmypdf', load POST /merge-pdfs, and execute with the array of PDF URLs or base64 strings to combine. The response is the merged PDF, which Jentic streams back to the agent.

### Can I let users design their own templates inside my product?

Yes. POST /create-editor-session returns a scoped URL that loads the CraftMyPDF template editor in an iframe. The session is tied to a specific user and template, so the user's design changes apply only to their tenant.

### What are the rate limits for the CraftMyPDF API?

The OpenAPI spec does not declare numeric rate limits. CraftMyPDF enforces fair-use limits and a per-plan credit balance that GET /account-info returns. Production integrations should check remaining credits and back off on 429 responses.

### Is the CraftMyPDF API free?

CraftMyPDF offers a free tier with limited monthly credits and paid plans for higher volumes. GET /account-info returns the current plan and remaining credits so an agent can decide whether to render or queue.

### Can I limit what my agent is allowed to do with the CraftMyPDF API?

Yes. Because you run Jentic One yourself, your own rules decide which CraftMyPDF operations and credentials the agent may use. CraftMyPDF passes template IDs and data in the request body rather than as URL resource IDs, so you scope the agent to just the operations it needs, such as POST /create to generate a PDF or POST /merge-pdfs to combine files. Read operations like GET /list-templates and GET /account-info stay off unless you explicitly include them.
