Integrations & API

Connect Personalia with your favorite tools and automate your creative workflows with our developer-friendly API.

Connect With Your Tools

Personalia integrates seamlessly with your favorite platforms and automation tools.

Zapier Icon

Zapier

Connect Personalia to 5,000+ apps without coding

Make Icon

Make

Create complex automations with visual workflows

n8n Icon

n8n

Open-source workflow automation with self-hosting options

WordPress Icon

WordPress

Integrate with WordPress and Elementor for dynamic websites

Enfocus Switch Icon

Enfocus Switch

Integrate with Enfocus Switch for dynamic content

1. Request PDF Generation

Start by sending a POST request to generate a PDF document with your template and data.

// 1. Request PDF generation
const response = await fetch(
  'https://api.personalia.io/v1/content',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'ApiKey YOUR_API_KEY'
    },
    body: JSON.stringify({
      TemplateId: 'c790fd3b-10ef-4a58-963b-b688e564eefa',
      Fields: {
        'First Name': 'John',
        'Machine': 'AK-2000',
        'Color': 'Blue'
      },
      Output: {
        Format: 'PDF',
        Quality: 'Display',
        Package: false,
        StrictPolicy: true
      }
    })
  }
);

// 2. Get the request ID for polling
const { RequestId } = await response.json();

2. Poll for Completion

Poll the API to check if your PDF is ready for download. Once it is ready the URL to the asset remains live for 30 minutes.

// 3. Poll for completion
const getResult = async () => {
  const result = await fetch(
    `https://api.personalia.io/v1/content?requestId=${RequestId}`,
    { 
      headers: { 
        'Authorization': 'ApiKey YOUR_API_KEY' 
      } 
    }
  );
  return await result.json();
};

// 4. Check status periodically
let result = await getResult();
while (result.Status === 'InProgress') {
  await new Promise(resolve => setTimeout(resolve, 1000));
  result = await getResult();
}

// 5. Handle the result
if (result.Status === 'Completed') {
  console.log('Download URL:', result.URLs[0]);
  // URL is valid for 15 minutes
} else if (result.Status === 'Failed') {
  console.error('Generation failed:', result.FailureDescription);
}

API Endpoint Comparison

Personalia offers two different approaches to content generation through our API, each suited for different use cases.

Immediate Rendering

Endpoints: POST /v1/content + GET /v1/content

The POST request triggers immediate rendering of your asset, and you poll the GET endpoint until the asset is ready for download. Once complete, the download URL remains valid for 30 minutes.

Best for:
  • Immediate content needs
  • Batch processing
  • Server-side applications
  • When you need the asset right away

This method is best when you need the asset immediately. Credits are charged immediately

On-Demand Rendering

Endpoint: POST /v1/content/url

This endpoint immediately returns a URL that stays valid for 30 days. The asset is only rendered and delivered when someone accesses the URL, and the final document is returned directly to the user.

Best for:
  • Email campaigns with document links
  • Cost optimization (only pay when rendered)
  • User-triggered document generation
  • When immediate rendering isn't needed

This method is best for when you want to generate content on demand and only pay for credits when the asset is rendered.

Quick Start API Guide

Get started quickly with our API. For full documentation, visit developer.personalia.io

Authentication

All API requests must include an Authorization header with your API key in the format:

Authorization: ApiKey YOUR_API_KEY

You can find your API key in the API Keys section of your Personalia dashboard.

// Generate a document using JavaScript
const response = await fetch('https://api.personalia.io/v1/content', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'ApiKey YOUR_API_KEY'
  },
  body: JSON.stringify({
    TemplateId: 'c790fd3b-10ef-4a58-963b-b688e564eefa',
    Fields: {
      'First Name': 'John',
      'Machine': 'AK-2000',
      'Color': 'Blue'
    },
    Output: {
      Format: 'PDF',
      Quality: 'Display'
    }
  })
});
const { RequestId } = await response.json();

API Endpoints

POST/v1/content

Generate a document from a template

Parameters

NameTypeRequiredDescription
TemplateIdstringRequiredID of the Personalia template to use
FieldsobjectRequiredKey-value pairs of template fields
OutputobjectOptionalOutput configuration (format, quality, resolution, etc.)Default: {"Format": "PDF", "Quality": "Display", "Package": false}
GET/v1/content

Get the status and result of a content generation request

Parameters

NameTypeRequiredDescription
requestIdstringRequiredID of the content generation request
POST/v1/content/url

Generate a URL that creates content when accessed

Parameters

NameTypeRequiredDescription
TemplateIdstringRequiredID of the Personalia template to use
FieldsobjectRequiredKey-value pairs of template fields
OutputobjectOptionalOutput configuration (only PDF format is supported for URLs)Default: {"Format": "PDF", "Quality": "Display"}
GET/v1/content/templates/{templateId}/info

Get information about a template including its fields

Parameters

NameTypeRequiredDescription
templateIdstringRequiredID of the template

API Workflow

1

Create Templates

Design your templates in InDesign and upload them to Personalia through the dashboard.

2

Get Your API Key

Create an account and get your API key from the Personalia dashboard.

3

Generate Content

Use the API to generate personalized PDFs or images with data from your app, service or platform.

Error Handling

The API uses standard HTTP status codes to indicate success or failure of an API request.

Error Response Example

{
  "error": {
    "code": "invalid_request_error",
    "message": "The request was invalid. Check the request parameters and try again.",
    "param": "templateId",
    "type": "invalid_request_error"
  }
}

Common Error Codes

Status CodeDescription
400Bad Request - Invalid request format or parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource not found
429Too Many Requests - Rate limit exceeded
5xxServer Error - Something went wrong on our end