Document generation API

Generate personalized documents with one API.

Connect your application to reusable templates and generate PDF or PNG documents from JSON payloads, CSV rows, and structured business data.

01

Design a reusable template

Create the layout once in the visual editor and add placeholders such as client.name, course, invoice.number, or issueDate.

02

Send structured data

Send a saved template ID with JSON payload values from your app, backend, CRM, billing system, or workflow.

03

Receive a ready-to-use file

Docit validates the values, renders a PDF or PNG, stores the generated document, and returns a downloadable file URL.

Built for application workflows

Turn structured data into consistent business documents.

Keep layout and branding in a reusable template while your app supplies the values. Docit handles placeholder validation, rendering, generated-file storage, and downloadable output.

PDF and PNG output
Saved or inline templates
Placeholder validation
Single, merged, and bulk generation
POST /api/documents/generate
const response = await fetch(
  "https://docit.gatekod.com/api/documents/generate",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer " + process.env.DOCIT_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      templateId: "your-template-id",
      output: "pdf",
      payload: {
        "client.name": "Ada Lovelace",
        course: "Analytical Engines",
      },
    }),
  },
);

const result = await response.json();
console.log(result.data.certificate.fileUrl);

What you can build

One document workflow.Reused across your entire product.

Design the template once, send structured data from your app, and generate consistent PDF or PNG documents whenever your workflow needs them.

Reusable generation flow

API driven

Template

Layout + fields

Data

JSON or CSV

Document

PDF or PNG

01

Generate invoices and statements from billing data.

02

Create certificates from course, membership, or training records.

03

Build offer letters, onboarding documents, and employee files.

04

Render proposals, agreements, and approval packets for signing.

05

Create personalized reports from application or analytics data.

06

Generate multiple templates and merge them into one PDF packet.

Start with the guide, then build your integration.

The API reference covers authentication, template discovery, placeholder data, responses, errors, bulk generation, PDF merging, and JavaScript and Python examples.