# Generate PDFs through the API

> Create a PDF from a PDF Page for one record, or fill a PDF Form with your own values, and get it back as a file, a temporary link or base64.

Source: https://tadabase.com/docs/developers/pdf-generation-api  
Status: Verified Nov 17, 2026. Checked against the current product

Make the same PDFs your app makes, from your own code. A PDF Page turns one record into a PDF using the design you built in the builder. A PDF Form fills an uploaded PDF with the values you send.

## Before you start

- Your plan must include API access and PDF Pages or PDF Forms.
- On the API key in **Settings** > **API Keys**, turn on **Allow PDF Page**, **Allow PDF Form** or both. Without the switch, calls answer `412` with "The method being used is disabled for this API key."
- Build the PDF Page or upload the PDF Form in the builder first. See [PDF Pages](https://tadabase.com/docs/pages/pdf-pages) and [PDF Forms](https://tadabase.com/docs/pages/pdf-forms).
- These endpoints are only on version 1.1 of the API: every URL starts with `https://api.tadabase.io/api/v1.1/{appId}/`.

![The API key form in Settings with the Allow PDF Form and Allow PDF Page switches highlighted](https://tadabase.com/docs-shots/developers-api-key-allow-pdf.webp)

## Endpoints

| Method and path | What it does |
| --- | --- |
| `GET pdf-pages` | Lists PDF Pages with their `id`, `name`, table and settings |
| `GET pdf-pages/{pdfPageId}` | One PDF Page |
| `POST pdf-pages/{pdfPageId}/create/{recordId}` | Creates a PDF from a PDF Page. `{recordId}` is required when the PDF Page is tied to a table |
| `GET pdf-forms` | Lists PDF Forms |
| `GET pdf-forms/{pdfFormId}` | One PDF Form, with its `placeholders` (the fields you can fill) |
| `POST pdf-forms/{pdfFormId}/create` | Fills a PDF Form |

## Choose what you get back

Add `format` to the query string of a `create` call:

| `format` | You get | Works for |
| --- | --- | --- |
| (none) | JSON with `status`, `name` and `fileData`, the PDF as base64 | PDF Pages and PDF Forms |
| `file` | The PDF itself, as a download (`Content-Type: application/pdf`) | PDF Pages and PDF Forms |
| `link` | JSON with `name`, `url` (a private link to the stored PDF) and `expires_at`. The link works for one day | PDF Pages only |

## Example: create an invoice from a PDF Page

```bash
curl -X POST "https://api.tadabase.io/api/v1.1/YOUR_APP_ID/pdf-pages/PDF_PAGE_ID/create/RECORD_ID?format=link" \
  -H "X-Tadabase-App-Id: YOUR_APP_ID" \
  -H "X-Tadabase-App-Key: YOUR_API_KEY" \
  -H "X-Tadabase-App-Secret: YOUR_API_SECRET"
```

```json
{
  "status": "success",
  "name": "INV-00123",
  "url": "https://...",
  "expires_at": "2026-11-18T09:15:02.000000Z"
}
```

The file name comes from the PDF Page's **Custom File Name** setting: **Text** uses the name you typed, **Field** uses a field of the record, and **Default** uses the PDF Page's name. A PDF Page tied to a table answers `400` when you leave out the record ID.

> **Warning:** You can send `designMetas` in the body to change the page design for one request. It replaces the PDF Page's whole design for that request rather than changing single settings, so leave it out unless you send a complete design.

## Example: fill a PDF Form

1. **Find the placeholders** Call `GET pdf-forms/{pdfFormId}`. `placeholders` lists each fillable field with its `id`, `type` and `name`.
2. **Send the values** Call `POST pdf-forms/{pdfFormId}/create` with `mapping`: an object whose keys are the placeholder `id`s and whose values are what to write. Add `fileName` to name the file (default `pdf-form`).

```bash
curl -X POST "https://api.tadabase.io/api/v1.1/YOUR_APP_ID/pdf-forms/PDF_FORM_ID/create?format=file" \
  -H "X-Tadabase-App-Id: YOUR_APP_ID" \
  -H "X-Tadabase-App-Key: YOUR_API_KEY" \
  -H "X-Tadabase-App-Secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"fileName": "service-agreement", "mapping": {"PLACEHOLDER_ID": "Dana Lee"}}' \
  -o service-agreement.pdf
```

A placeholder you leave out uses its default value, if it has one.

## Common problems

| Response | Cause |
| --- | --- |
| `412` with a plan message | Your plan does not include PDF Pages or PDF Forms, or the PDF is over your plan's count |
| `412` "The method being used is disabled for this API key." | **Allow PDF Page** or **Allow PDF Form** is off on the key |
| `400` on a PDF Page | The PDF Page is tied to a table and the record ID is missing |
| `404` "PDF Form not found" | The PDF Form ID is wrong |
| `404` on a PDF Page with a record ID | The PDF Page or the record does not exist, or the key cannot read the record |
