canonical: https://jentic.com/apis/api.docupilot.app/docupilot

# Docupilot App Docupilot API

Jentic publishes the only available OpenAPI specification for Docupilot API, keeping it validated and agent-ready. Docupilot is a document automation service that generates PDF, DOCX, and HTML documents from reusable templates and structured JSON merge data. The V2 API exposes endpoints for listing templates, fetching template metadata, generating documents on demand, and retrieving generated document records. Authentication uses a Bearer token built from a Base64-encoded key:secret pair, or an apikey header for legacy integrations.

## For AI agents

Generate PDF, DOCX, and HTML documents from Docupilot templates by merging JSON data, then retrieve the rendered files for download or distribution.

## Scope

Does not handle e-signature collection, recipient tracking, or template authoring - use for rendering finished documents from existing templates only.

## Capabilities

- Render contracts, invoices, and reports by merging JSON data into Docupilot templates
- List every template in a workspace with its template_id and merge-field schema
- Retrieve a specific template definition by template_id before generating output
- Generate a finished document via POST `/documents/v2/generate`/ and capture the document_id
- Fetch a previously generated document by document_id to download the file or check status
- Inspect the authenticated user profile via `/accounts/v2/users/me`/ to verify token scope

## Use cases

### On-demand contract generation

Sales and operations teams can render personalised contracts on demand by posting customer data to `/documents/v2/generate`/ along with the contract template_id. Docupilot merges the JSON payload into the template and returns a document_id that the caller fetches via `/documents/v2/{document_id}/.` The flow replaces manual Word editing for legal, sales, and procurement teams.

Example prompt: Call POST `/documents/v2/generate`/ with template_id and a JSON payload of merge fields, then poll GET `/documents/v2/{document_id}`/ until the document is ready and return the download URL

### Bulk invoice rendering

Finance teams can render hundreds of branded PDF invoices from a single Docupilot template by iterating customer records and calling the generate endpoint per record. Each generation returns a unique document_id, allowing parallel retrieval and archival in object storage. Throughput is bounded by the workspace plan's concurrent generation limit rather than template complexity.

Example prompt: Iterate over a list of 50 invoice records, calling POST `/documents/v2/generate`/ for each with the same invoice template_id, collecting document_id values for batch retrieval

### Template discovery for low-code builders

Internal tools and workflow builders can list every Docupilot template available to a workspace by calling GET `/templates/v2`/, then drill into a chosen template via GET `/templates/v2/{template_id}`/ to expose its merge fields in a UI. This lets non-developers pick templates and fill required fields without ever touching the Docupilot console.

Example prompt: Call GET `/templates/v2`/ to enumerate workspace templates, render them as a picker, then on selection call GET `/templates/v2/{template_id}`/ to surface the merge fields

### AI agent document drafting via Jentic

An AI agent can draft a finished document end to end by searching Jentic for the Docupilot generate operation, loading its input schema, and executing the call with merge data assembled from a CRM or chat transcript. Jentic stores the Bearer token in the vault so the agent never sees the raw key:secret pair while still producing a downloadable document_id.

Example prompt: Search Jentic for 'generate a document from a template', load the Docupilot generate schema, execute with template_id and merge JSON, then return the document_id and final URL

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/documents/v2/generate/` | Generate a document from a template and merge data |
| GET | `/documents/v2/{document_id}/` | Retrieve a generated document by ID |
| GET | `/templates/v2/` | List all available templates |
| GET | `/templates/v2/{template_id}/` | Get a template definition by ID |
| GET | `/accounts/v2/users/me/` | Get current authenticated user profile |

## Key resources

- **Templates** — List and inspect document templates available to the authenticated workspace
- **Documents** — Generate new documents from a template_id and merge payload, then retrieve generated files by document_id
- **Users** — Retrieve the profile and scope of the authenticated Docupilot user

## Why Jentic

- **Setup:** Wiring Docupilot by hand means picking between its bearer token and its apikey header scheme and coding your own calls to the generate and template endpoints. Through Jentic you install once, import the Docupilot API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Docupilot puts the document and template id in the URL path (`/documents/v2/{document_id}`/ and `/templates/v2/{template_id}`/), so a rule can pin your agent to reading one document or template. You choose the operations it may call, so document generation is not included unless you add it.
- **Credential handling:** Your Docupilot credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate a document from a template' or 'fetch a rendered document', and Jentic returns the matching Docupilot operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **PandaDoc** — PandaDoc covers document generation plus e-signature and tracking, while Docupilot focuses on template-driven file rendering
- **PDFMonkey** — PDFMonkey also renders PDFs from templates and JSON, but uses Liquid + HTML templates instead of Docupilot's Word/Google Docs templates
- **Doppio Render API** — Doppio renders arbitrary HTML or URLs to PDF, complementing Docupilot when the document source is a web page rather than a template
- **Jotform** — Jotform collects the form input that feeds Docupilot's merge payload

## FAQ

### Why is there no official OpenAPI spec for Docupilot API?

Docupilot does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Docupilot API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Docupilot API use?

Docupilot V2 uses Bearer token authentication where the token is the Base64 encoding of your key:secret pair, sent as the Authorization header. A legacy apikey header (`apikey: <key>`) is also accepted on certain endpoints. Through Jentic, the Bearer token is stored encrypted in your Jentic One instance, so an agent never sees the raw key:secret value.

### Can I generate a document from a template with the Docupilot API?

Yes. POST `/documents/v2/generate`/ takes a template_id and a JSON merge payload and returns a document_id. You then call GET `/documents/v2/{document_id}`/ to retrieve the rendered file. The two-step flow lets you decouple generation from delivery and store the resulting file in your own object storage.

### How do I list every template in my workspace?

Call GET `/templates/v2`/ with a valid Bearer token. The response enumerates each template with its identifier and metadata. To inspect a single template's merge fields before generating, call GET `/templates/v2/{template_id}/.`

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

The OpenAPI spec does not declare explicit rate limits for the V2 endpoints. Limits are governed by the Docupilot plan attached to your workspace, in particular the concurrent-generation cap. If you receive a 429 response, back off and retry; large batches should be paced to stay under the plan's concurrency limit.

### How do I generate a document with the Docupilot API through Jentic?

Install the SDK with `pip install jentic`, then search Jentic for `generate a document from a template`. Load the schema for the Docupilot generate operation, populate template_id and merge data, and execute. Jentic returns the document_id; a follow-up load+execute on the retrieve operation downloads the rendered file.

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

Yes. Because you run Jentic One yourself, you decide which Docupilot operations your agent may call, so document generation via POST `/documents/v2/generate`/ is excluded unless you explicitly add it. Docupilot puts the document and template id in the URL path (`/documents/v2/{document_id}`/ and `/templates/v2/{template_id}`/), so your own rules can pin the agent to reading a single document or template. Your Bearer credential stays with your Jentic One instance and is injected only for the calls you have allowed.
