Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

APITemplate.io integration

APITemplate.io is an API-based service for generating PDFs and images from reusable templates using JSON data. This integration lets your WeWeb backend create documents (invoices, reports) and images (banners, social posts) programmatically.

Use cases

  • Generate invoices, quotes, and reports from template data
  • Create image assets for marketing and social media
  • Automate document workflows and deliver links via email
  • Store generated files on APITemplate’s CDN with optional S3 post-actions

Setup

  1. In APITemplate.io, create an API key.
  2. In WeWeb, add your APITemplate API key to the environment(s) you use (Editor, Staging, and/or Production).
  3. Test with the simplest action (e.g., Create PDF) using a known-good template and minimal JSON data to verify authentication and payload shape.
  4. If the test fails due to provider requirements, check template availability and IDs, verify your plan limits, then retry the same test.

Inserting dynamic content

APITemplate works by taking a template (your PDF or image design) and a JSON object (Template Data). When you generate a PDF or image from WeWeb, you send Template Data with the values you want to show (for example a person’s name, a course title, or a hashtag).

The exact JSON structure depends on the type of template you are using. The safest workflow is always:

  1. Copy the example JSON from APITemplate for the template you are using.
  2. Paste it into Template Data in WeWeb.
  3. Replace the example values with your API inputs or variables.

PDFs

PDF templates usually expect a simple JSON object where each key matches a field in your template (for example name or course_name).

How to get the JSON

  1. In APITemplate.io, open your PDF template.

    Open your template list in APITemplate.io

  2. Open the JSON tab.

    Go to the  tab in the template editor

  3. Copy the example JSON.

    Copy the example JSON

What the JSON means

  • The keys (for example name, course_name) are the fields your template can display.
  • The values are the example data APITemplate uses for previewing the PDF.

How to use it in WeWeb

  1. In WeWeb, paste the JSON into Template Data.
  2. Replace the example values with:
    • API inputs (for example the name and course your interface sends).
    • Variables (for example a value from a table record).

Example certificate JSON:

json
{
  "name": "Willie Smith",
  "course_name": "Leadership and Motivation",
  "text1": "Has successfully completed an APITemplate.io-sponsored education program entitled:",
  "text2": "And has been awarded this certificate in recognition of this effort and accomplishment in increasing professional ability",
  "director": "Adam Johnson",
  "manager": "James Brookes"
}

Images

Image templates often use an overrides array where each item targets a specific layer in the image (for example a text layer).

How to get the JSON

  1. In APITemplate.io, open your image template.

    Open your image template in APITemplate.io

  2. Click Preview/API Console.

    Click

  3. Copy the example JSON.

    Copy the example JSON

What the JSON means

  • Each object inside overrides targets one layer using its name.
  • The text value is what will be displayed for that layer.
  • Optional settings like fontSize and color let you control the appearance.

How to use it in WeWeb

  1. In WeWeb, paste the JSON into Template Data.
  2. Replace the example values with your own:
    • API inputs (for example, a headline, label, or hashtag).
    • Variables (for example, data from a record).

Example image overrides JSON:

json
{
  "overrides": [
    {
      "name": "text_from_now",
      "text": "FROM NOW",
      "fontSize": 50,
      "textBackgroundColor": "rgba(246, 243, 243, 0)"
    },
    {
      "name": "text_next",
      "text": "NEXT",
      "fontSize": 64,
      "textBackgroundColor": "rgba(246, 243, 243, 0)",
      "color": "#FFFFFF"
    },
    {
      "name": "text_tags",
      "text": "#apitemplateio",
      "fontSize": 16,
      "textBackgroundColor": "rgba(252, 252, 252, 0)",
      "color": "#000000"
    }
  ]
}

Common pitfalls (setup & usage)

Invalid or inaccessible Template ID

If Template ID is wrong or inaccessible, the request will fail. Use the built-in template picker or fetch templates to ensure the ID exists in your account.

Missing or mismatched Template Data

The Template Data JSON must match your template variables (often in an overrides array). Start with a single small field, confirm success, then expand.

Async enabled without Webhook URL

If Async is enabled, you must provide a valid Webhook URL. Otherwise, the request will be rejected.

All Actions

This integration provides three actions powered by APITemplate.io’s REST API.

ActionDescription
Create PDFGenerate a PDF from a template and JSON data
Create ImageGenerate an image from a template and JSON data
Merge PDFsMerge multiple PDF files into a single PDF

Action details

Create PDF

Generate a PDF from a template and JSON data.

Inputs

Display KeyExample InputDescriptionRestrictions
Template ID"79667b2b1876e347"Template identifier from APITemplate consoleMust be a valid template ID you own
Template Data{"overrides":[{"name":"text_1","text":"Hello World"}]}JSON payload to populate the templateValid JSON, matches template structure
Expiration (minutes)
Optional
0Expiration for generated fileValid: 0 (permanent) or 110080
Export Type
Optional
"json"Return format of the responseValid: json, file
Output HTML
Optional
falseReturn HTML content URL along with PDFBoolean
Filename
Optional
"invoice-2024.pdf"Custom filename for the generated PDFValid filename string
Cloud Storage
Optional
trueUpload the generated file to APITemplate’s storage CDN. When off, the S3 Storage (Post Action) section becomes available.Boolean
Async
Optional
OnEnable asynchronous generation with webhook callback.On / Off
Webhook URL
Optional
"https://example.com/callback"Callback URL when Async is enabled.Required if Async is On
S3 File Key
Optional
"invoices/invoice-123"Custom S3 filename (Post Action). Only available when Cloud Storage is off.String
S3 Bucket
Optional
"my-bucket"Override AWS bucket (Post Action). Only available when Cloud Storage is off.String
Meta Reference
Optional
"order-12345"External reference for trackingString identifier

Example output

json
{
  "status": "success",
  "download_url": "https://cdn.apitemplate.io/pdf/abc123.pdf",
  "meta": "order-12345"
}

Documentation of API endpoint that powers action: APITemplate API – Create PDF (POST /v2/create-pdf)

Create Image

Generate an image from a template and JSON data.

Inputs

Display KeyExample InputDescriptionRestrictions
Template ID"79667b2b1876e347"Template identifier from APITemplate consoleMust be a valid template ID you own
Template Data{"overrides":[{"name":"text_1","text":"hello world"}]}JSON payload to populate the templateValid JSON with expected overrides array
Output Image Type
Optional
"all"Output image formatValid: all, jpegOnly, pngOnly
Expiration (minutes)
Optional
0Expiration for generated fileValid: 0 (permanent) or 110080
Cloud Storage
Optional
trueUpload the generated file to APITemplate’s storage CDN. When off, the S3 Storage (Post Action) section becomes available.Boolean
S3 File Key
Optional
"images/banner-123"Custom S3 filename (Post Action). Only available when Cloud Storage is off.String
S3 Bucket
Optional
"my-bucket"Override AWS bucket (Post Action). Only available when Cloud Storage is off.String
Meta Reference
Optional
"campaign-456"External reference for trackingString identifier

Example output

json
{
  "download_url": "https://pub-cdn.apitemplate.io/2026/01/3a7e4efb-174d-4d06-9a2e-b45594241d93.jpeg",
  "download_url_png": "https://pub-cdn.apitemplate.io/2026/01/3a7e4efb-174d-4d06-9a2e-b45594241d93.png",
  "template_id": "0d577b23524bfd9a",
  "transaction_ref": "3a7e4efb-174d-4d06-9a2e-b45594241d93",
  "status": "success",
  "post_actions": []
}

Documentation of API endpoint that powers action: APITemplate API – Create Image (POST /v2/create-image)

Merge PDFs

Merge multiple PDF files into a single PDF.

Inputs

Display KeyExample InputDescriptionRestrictions
PDF URLs["https://example.com/file1.pdf","https://example.com/file2.pdf"]Array of publicly accessible PDF URLsValid HTTPS URLs or data:application/pdf;base64,...
Expiration (minutes)
Optional
0Expiration for merged fileValid: 0 (permanent) or 110080
Export Type
Optional
"json"Return format of the responseValid: json, file
Cloud Storage
Optional
OnUpload the merged file to APITemplate’s storage CDN. When On, the S3 Storage (Post Action) section is disabled.On / Off
Enable Post Action
Optional
OnEnable Post Actions (upload to your own S3/Cloudflare R2/Azure Storage). Only available when Cloud Storage is Off.On / Off
S3 File Key
Optional
"merged/merged-123"Custom S3 filename (Post Action). Only shown when Enable Post Action is on.String
S3 Bucket
Optional
"my-bucket"Override AWS bucket (Post Action). Only shown when Enable Post Action is on.String
Meta Reference
Optional
"order-12345"External reference for trackingString identifier

Example output

json
{
  "status": "success",
  "download_url": "https://cdn.apitemplate.io/pdf/merged-123.pdf"
}

Documentation of API endpoint that powers action: APITemplate API – Merge PDF (POST /v2/merge-pdf)

Error handling

Error code and typeReason
401 UnauthorizedInvalid or missing API key (X-API-KEY).
400 Bad RequestInvalid parameters or payload (e.g., missing template_id, malformed JSON, invalid urls).
404 Not FoundInvalid template or endpoint.
413 Payload Too LargeRequest body too large. Reduce payload size.
429 Too Many RequestsRate limit reached; retry with backoff.
500 Internal Server ErrorProvider-side error; retry with backoff.

FAQs

Why can’t I see my templates in the Template picker?

Common causes:

  • Your API key is missing or added to a different environment than the one you are running (Editor, Staging, or Production).
  • You’re using Create PDF but trying to select an image template (or the other way around).
  • Your APITemplate account doesn’t have any templates yet.

Try clicking the refresh icon next to Template ID, then run the action again.

My output is missing text (or shows the wrong values). What should I check?

This usually means your Template Data doesn’t match what the template expects.

  • Copy the example JSON from the template’s JSON tab.
  • Change one value only, run again, then expand step by step.
  • For image templates using overrides, make sure each name matches the layer name in your template.
How do I keep generated files permanently?

Set Expiration (minutes) to 0.

Any value from 1 to 10080 expires the file after that many minutes.

What’s the difference between Cloud Storage and S3 Storage (Post Action)?
  • Cloud Storage Uploads the generated file to APITemplate’s storage CDN and returns a download link.
  • S3 Storage (Post Action) Is used when you want APITemplate to upload the file to your own storage (for example S3, Cloudflare R2, or Azure Storage).

In WeWeb:

  • For Create PDF and Create Image, the S3 Storage (Post Action) section is available when Cloud Storage is off.
  • For Merge PDFs, S3 Storage (Post Action) is available when Cloud Storage is Off.
I turned on S3 Storage (Post Action) but I don’t see S3 File Key / S3 Bucket

In Merge PDFs, those fields only appear when:

  • Cloud Storage Is Off, and
  • Enable Post Action Is On.

If Cloud Storage is on, the whole S3 Storage (Post Action) section is disabled.

Should I use Export Type = json or file?

Most of the time, use json so you get a download link in the response.

Use file only when you specifically need the raw file data returned by the action.

Why am I not receiving webhook calls?

Check these points:

  • Async Must be enabled.
  • Webhook URL Must be set and publicly reachable.
  • Your webhook endpoint must respond successfully (check your workflow logs).

If you changed settings, run the action again to trigger a new callback.

Why does “Merge PDFs” fail even though my URLs work in my browser?

PDF URLs must point to files APITemplate can retrieve directly.

If the PDFs are behind sign-in, private permissions, or IP restrictions, APITemplate won’t be able to access them. In that case, upload the PDFs to a public location (or use a different approach) and try again.

What is Meta Reference used for?

Meta Reference is a simple way to attach your own identifier (for example order-12345) to a run.

Use it to:

  • Match the result back to a record in your app.
  • Recognize which run a webhook callback belongs to.
How do I find my Template ID?

Use the APITemplate web console to copy the template’s ID, or use the template picker in WeWeb which fetches templates from your account.

What should my Template Data look like?

It must match the fields your template expects. The simplest way is to open your template in APITemplate.io, click Preview/API Console, then copy the example from the JSON tab.

Depending on your template, the structure can look like:

  • A JSON object with keys like name and course_name.
  • An overrides array (often used for image text layers).
When should I enable webhooks?

Enable Async when you want APITemplate to call you back at your Webhook URL after the file is generated.

Keep Async disabled if you want the action to wait and return the result right away.