Quick Start

Get started with DocuJSON in 3 simple steps. Generate your first PDF in under 5 minutes.

1. Get your API key

Sign up for a free account and create an API key from your dashboard.

Create Free Account

2. Make your first API call

Use the generate endpoint with your template and data.

bash
curl -X POST https://api.docujson.com/v1/generate \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "templateId": "weekly-report",
    "data": {
      "reportTitle": "Weekly Status",
      "versionAsOf": "11/24/2025",
      "projects": [
        {
          "title": "Project Alpha",
          "status": "Production",
          "progress": 75
        }
      ]
    }
  }'

3. Get your PDF

The API returns a URL to your generated PDF.

json
{
  "success": true,
  "pdfUrl": "https://blob.vercel-storage.com/weekly-report-1234567890.pdf",
  "templateId": "weekly-report",
  "generatedAt": "2025-11-24T12:00:00.000Z"
}

Authentication

All API requests require authentication using an API key. Include your API key in the request header.

bash
# Using x-api-key header (recommended)
curl -H "x-api-key: YOUR_API_KEY" https://api.docujson.com/v1/generate

# Or using Authorization header
curl -H "Authorization: Bearer YOUR_API_KEY" https://api.docujson.com/v1/generate

Generate PDF

Generate a PDF from a template and data.

POST /api/v1/generate

Request Body

ParameterTypeRequiredDescription
templateIdstringYesID of the template to use
dataobjectYesData to populate the template
optionsobjectNoPDF output options
outputFormatstringNo"url" (default), "base64", or "buffer"
webhookobjectNoWebhook URL and headers for async delivery

Example

javascript
const response = await fetch('https://api.docujson.com/v1/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    templateId: 'weekly-report',
    data: {
      reportTitle: 'Weekly Status Report',
      versionAsOf: '11/24/2025',
      projects: [
        {
          title: 'Project Alpha',
          status: 'Production',
          progress: 75,
          releaseDate: '03/15/2026'
        }
      ]
    },
    options: {
      format: 'Letter',
      orientation: 'portrait'
    }
  })
});

const { success, pdfUrl } = await response.json();

Airtable Integration

Use DocuJSON with Airtable automations and scripts. Here's a complete example script you can copy and paste.

Airtable Script Example

javascript
// DocuJSON Airtable Integration Script
// Copy this into an Airtable Script automation or Script app

const DOCUJSON_API_URL = 'https://api.docujson.com/v1/generate';
const DOCUJSON_API_KEY = 'YOUR_API_KEY'; // Replace with your API key

// Get the input record from the automation trigger
const inputConfig = input.config();
const recordId = inputConfig.recordId;

if (!recordId) {
  throw new Error("recordId is required");
}

// Get your table
const table = base.getTable('Your Table Name');
const record = await table.selectRecordAsync(recordId);

if (!record) {
  throw new Error("Record not found");
}

// Build the payload for DocuJSON
const payload = {
  templateId: 'weekly-report', // or your chosen template
  data: {
    reportTitle: 'Generated Report',
    versionAsOf: new Date().toLocaleDateString(),
    projects: [
      {
        title: record.getCellValueAsString('Project Name'),
        status: record.getCellValueAsString('Status'),
        progress: record.getCellValue('Progress') || 0,
        releaseDate: record.getCellValueAsString('Release Date')
      }
    ]
  }
};

// Warmup the service (optional, reduces cold start)
try {
  await fetch(DOCUJSON_API_URL + '?warm=1');
} catch (e) {}

// Generate the PDF
const response = await fetch(DOCUJSON_API_URL, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': DOCUJSON_API_KEY
  },
  body: JSON.stringify(payload)
});

if (!response.ok) {
  const error = await response.text();
  throw new Error('PDF generation failed: ' + error);
}

const { pdfUrl } = await response.json();
console.log('PDF generated:', pdfUrl);

// Attach the PDF to the record
await table.updateRecordAsync(recordId, {
  'PDF Attachment': [{ url: pdfUrl }]
});

console.log('PDF attached to record!');

Setup Instructions

  1. Create a Script automation in Airtable
  2. Set the trigger (e.g., button click, when record matches condition)
  3. Add recordId as an input variable mapping to the Record ID
  4. Replace YOUR_API_KEY with your DocuJSON API key
  5. Update table and field names to match your base

Weekly Report Template

Professional weekly status report with project index, stakeholders, milestones, and status updates.

Template ID

weekly-report

Example Payload

json
{
  "templateId": "weekly-report",
  "data": {
    "reportTitle": "Post-Production Weekly Top Sheet",
    "versionAsOf": "11/24/2025",
    "projects": [
      {
        "title": "Project Alpha",
        "status": "Post Production",
        "releaseDate": "03/15/2026",
        "answerPrint": "02/01/2026",
        "progress": 75,
        "stakeholders": {
          "studio": {
            "creativeExec": "Jane Smith",
            "productionExec": "John Doe"
          },
          "production": {
            "director": "Steven Director",
            "producers": "Producer A, Producer B"
          }
        },
        "milestones": [
          { "name": "Picture Lock", "startDate": "12/15/2025", "status": "Pending" },
          { "name": "Final Mix", "startDate": "01/15/2026", "status": "Pending" }
        ],
        "updates": {
          "thisWeek": { "id": "UPD-001", "text": "Completed color grading" },
          "lastWeek": { "id": "UPD-000", "text": "VFX delivery received" }
        }
      }
    ]
  }
}

Calendar Schedule Template

Multi-month calendar view with events, date ranges (ribbons), and customizable color coding.

Template ID

calendar-schedule

Example Payload

json
{
  "templateId": "calendar-schedule",
  "data": {
    "projectTitle": "Project Alpha",
    "orientation": "Landscape",
    "masthead": ["11.24.25", "PROJECT ALPHA", "POST SCHEDULE", "24 POST WEEKS"],
    "palette": {
      "vfx": "#7c3aed",
      "mix": "#ea580c",
      "milestone": "#b45309"
    },
    "legend": {
      "vfx": "VFX Turnover",
      "mix": "Mix Sessions",
      "milestone": "Milestone"
    },
    "months": [
      { "y": 2025, "m": 12 },
      { "y": 2026, "m": 1 },
      { "y": 2026, "m": 2 }
    ],
    "events": [
      { "date": "2025-12-25", "kind": "milestone", "text": "Christmas" },
      { "date": "2026-01-01", "kind": "milestone", "text": "New Year" }
    ],
    "ranges": [
      { "start": "2026-01-15", "end": "2026-01-26", "kind": "mix", "label": "Final Mix" },
      { "start": "2025-12-01", "end": "2025-12-20", "kind": "vfx", "label": "VFX Delivery" }
    ]
  }
}