# PDFMonkey

PDFMonkey is a service that automates the generation of PDF documents from templates, allowing users to create professional PDFs programmatically.

- **Category:** documents
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 18
- **Triggers:** 0
- **Slug:** `PDFMONKEY`
- **Version:** 20260323_00

## Tools

### Create Document

**Slug:** `PDFMONKEY_CREATE_DOCUMENT`

Tool to create a Document. Use when you need to instantiate a PDF from a template; set status='pending' to queue immediate generation. Ensure valid `document_template_id` is provided.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `document` | object | Yes | Document creation parameters wrapper. Must include `document_template_id` (non-deleted template UUID) and `payload`: a flat JSON object whose keys exactly match the template's field names — nested objects or mismatched keys silently produce blank or misfilled fields. Also accepts `status='pending'` to queue immediate generation. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Document Sync

**Slug:** `PDFMONKEY_CREATE_DOCUMENT_SYNC`

Tool to create a document and wait for generation to finish. Use when immediate PDF is needed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `document` | object | Yes | Container for document attributes Required sub-fields: `document_template_id` (must reference a valid, non-deleted template) and `payload` (flat JSON object whose keys exactly match template field names — nested objects or key typos silently produce blank or misfilled fields). Some nominally optional sub-fields like `pdf_engine_draft_id` may be required at runtime; check API error messages to identify missing inputs. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Template

**Slug:** `PDFMONKEY_CREATE_TEMPLATE`

Creates a new PDF document template in PDFMonkey. Use this to define reusable templates with HTML/Liquid content and CSS styles for generating PDF documents. Typical workflow: Create template → Preview with draft content → Publish → Generate documents. The template supports Liquid templating syntax (e.g., {{variable_name}}) for dynamic content injection. Only 'identifier' is required; all other fields have sensible defaults.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `ttl` | integer ("300" | "1200" | "3600" | "86400" | "604800" | "2592000" | "31536000" | "0") | No | Document auto-deletion time-to-live in seconds. Options: 300 (5min), 1200 (20min), 3600 (1hr), 86400 (1 day), 604800 (1 week), 2592000 (30 days), 31536000 (1 year), 0 (never). Defaults based on plan. |
| `body` | string | No | Published HTML + Liquid template body used when generating documents. Leave empty and use body_draft for testing first. |
| `app_id` | string | No | Workspace (application) UUID. If omitted, the default workspace is used. |
| `settings` | object | No | Document printing settings for PDF generation or preview. |
| `body_draft` | string | No | Draft HTML + Liquid template body for previewing changes before publishing. |
| `identifier` | string | Yes | Human-readable name for the template (e.g., 'Invoice Template', 'Contract PDF') |
| `scss_style` | string | No | Published CSS/SCSS stylesheet for document styling. |
| `sample_data` | string | No | JSON string of sample data for the published template. |
| `edition_mode` | string ("code" | "visual") | No | Template editing mode: 'code' for HTML/Liquid editing, 'visual' for drag-and-drop editor. Defaults to 'code'. |
| `pdf_engine_id` | string | No | UUID of the PDF engine to use for document generation. Get available engines via List PDF Engines action. |
| `settings_draft` | object | No | Document printing settings for PDF generation or preview. |
| `scss_style_draft` | string | No | Draft CSS/SCSS stylesheet for previewing style changes. |
| `sample_data_draft` | string | No | JSON string of sample data for testing/previewing the draft template. |
| `pdf_engine_draft_id` | string | No | UUID of the PDF engine to use for previewing. If omitted, uses pdf_engine_id or default engine. Omitting may cause a 422 validation error ('Pdf engine draft must exist'); provide a valid UUID if creation fails. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Document

**Slug:** `PDFMONKEY_DELETE_DOCUMENT`

Tool to delete a Document by its ID. Use when you need to permanently remove a document after confirming its ID. Returns 204 No Content on success.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | UUID of the document to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete PDFMonkey Document Template

**Slug:** `PDFMONKEY_DELETE_TEMPLATE`

Tool to delete a document template by ID. Use when you need to remove obsolete templates after validation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The UUID of the document template to delete. Can be obtained from LIST_TEMPLATES or CREATE_TEMPLATE actions. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Download Document File

**Slug:** `PDFMONKEY_DOWNLOAD_DOCUMENT_FILE`

Tool to download a generated PDF file via a presigned URL. Use after obtaining a valid download_url from the Document details endpoint. Verify document status is 'success' (not 'draft' or 'pending') via PDFMONKEY_GET_DOCUMENT before downloading to avoid incomplete files. The URL expires after 1 hour; fetch a new URL upon expiry (403 Forbidden).

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `download_url` | string | Yes | Time-limited presigned URL returned by the Documents API. Valid for 1 hour; if expired, retrieve a new URL via the Document details endpoint. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Current User

**Slug:** `PDFMONKEY_GET_CURRENT_USER`

Tool to retrieve details about the currently authenticated user. Use when you need account info (quota, plan, email, locale) after authentication.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Document

**Slug:** `PDFMONKEY_GET_DOCUMENT`

Tool to fetch a Document by its ID. Returns the full document record including payload, meta, logs, and download URL. Note: download_url is time-limited; if a download attempt fails, call GetDocument again to obtain a fresh URL. Check the status field for a finalized (non-draft) state before passing the record to downstream processing tools.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | UUID of the document to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get DocumentCard

**Slug:** `PDFMONKEY_GET_DOCUMENT_CARD`

Tool to fetch a DocumentCard by ID. Use when you have a DocumentCard ID and need its download URLs, status, and metadata. Use after generating or updating a DocumentCard.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | UUID of the DocumentCard to fetch |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Template by ID

**Slug:** `PDFMONKEY_GET_TEMPLATE`

Tool to fetch a Document Template by ID. Use when you need the template's content, styles, settings, and preview URL.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | UUID of the document template to retrieve. Get template IDs from the list_templates action. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List DocumentCards

**Slug:** `PDFMONKEY_LIST_DOCUMENT_CARDS`

Tool to list DocumentCards. Use when you need to retrieve multiple DocumentCards with optional pagination and filtering by template, status, workspace, or update time.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `status` | string ("success" | "failure" | "draft") | No | Filter by document status |
| `page_number` | integer | No | Page number to return (default 1) |
| `workspace_id` | string | No | Filter by workspace UUID |
| `updated_since` | integer | No | Return documents updated after given Unix timestamp |
| `document_template_ids` | array | No | Filter by one or more document template UUIDs |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List PDF Engines

**Slug:** `PDFMONKEY_LIST_PDF_ENGINES`

Lists all available PDF rendering engines in PDFMonkey. Returns engine IDs, version names, numeric versions, and deprecation status. Use this to select a PDF engine when creating templates or generating documents. Recommended: Use the latest non-deprecated engine (e.g., v5 or highest version).

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Template Cards

**Slug:** `PDFMONKEY_LIST_TEMPLATES`

List all document template cards for a workspace. Use this action to: - Retrieve all templates available in a workspace - Filter templates by folder (or get only root folder templates with folders='none') - Paginate through large template lists - Sort templates by identifier, creation date, or last update date Returns template cards with metadata including IDs, names, auth tokens, and timestamps.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Page number to return (1-indexed). Defaults to 1 if not specified. |
| `sort` | string ("identifier" | "created_at" | "updated_at") | No | Attribute by which to sort results. Options: 'identifier', 'created_at', 'updated_at'. If not specified, defaults to API default sorting. |
| `folders` | string | No | Comma-separated folder IDs to filter templates; use 'none' to list only those in the root folder. If not provided, returns templates from all folders. |
| `workspace_id` | string | Yes | The workspace ID (UUID) to list templates from. Required to scope the query to a specific workspace. An incorrect UUID returns an empty list rather than an error, so verify the workspace_id before concluding no templates exist. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Workspaces

**Slug:** `PDFMONKEY_LIST_WORKSPACES`

Tool to list workspaces (applications). Use when you need all available workspaces for the authenticated user after login.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Preview Template

**Slug:** `PDFMONKEY_PREVIEW_TEMPLATE`

Fetches the template preview viewer page from PDFMonkey's preview_url. Returns an HTML viewer page that displays the rendered template draft. Use this after obtaining a template's preview_url via Get Template or List Templates.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `preview_url` | string | Yes | The preview_url from a Template object (obtained via Get Template or List Templates). This URL points to PDFMonkey's PDF viewer page that displays the rendered template draft. Example format: https://preview.pdfmonkey.io/pdf/web/viewer.html?file=... |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Document

**Slug:** `PDFMONKEY_UPDATE_DOCUMENT`

Updates an existing PDFMonkey document's payload, metadata, template, or status. Common use cases: - Modify document data (payload) before generation - Change the template used for the document - Add or update custom metadata - Trigger PDF regeneration by setting status to 'pending' Note: To regenerate a document with updated data, update the payload and set status='pending'.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | UUID of the document to update. Must be a valid existing document ID. |
| `document` | object | Yes | Object containing the fields to update. Include only the fields you want to change. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Document Template

**Slug:** `PDFMONKEY_UPDATE_TEMPLATE`

Tool to update a document template’s properties. Use when you need to modify an existing template’s content, styles, settings, engine, folder, or TTL.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | UUID of the document template to update |
| `ttl` | integer | No | Auto-deletion TTL for generated documents (seconds), e.g., 300, 1200, 3600, etc. |
| `body` | string | No | Published HTML+Liquid body used to generate documents |
| `settings` | object | No | Settings input for updating templates - all fields optional. |
| `body_draft` | string | No | Draft HTML+Liquid body used for preview |
| `identifier` | string | No | Human-readable name of the template (optional, only if you want to rename) |
| `scss_style` | string | No | Published (S)CSS used to generate documents |
| `sample_data` | string | No | Sample data for reverting changes |
| `edition_mode` | string ("code" | "visual") | No | Edition mode of the template: 'code' or 'visual' |
| `pdf_engine_id` | string | No | PDF engine UUID used to generate documents |
| `settings_draft` | object | No | Settings input for updating templates - all fields optional. |
| `scss_style_draft` | string | No | Draft (S)CSS used for preview |
| `sample_data_draft` | string | No | Draft sample data for preview |
| `template_folder_id` | string | No | Template folder UUID to organize the template, or null to place in root |
| `pdf_engine_draft_id` | string | No | PDF engine UUID used to preview changes |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### View Public Share Link

**Slug:** `PDFMONKEY_VIEW_PUBLIC_SHARE_LINK`

Tool to download a publicly shared PDF via its permanent share link. Use when the document's public_share_link is enabled to fetch the PDF file directly.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `token` | string | Yes | Public share token from the document's public_share_link property. |
| `filename` | string | Yes | Filename of the PDF to retrieve, including .pdf extension. |
| `public_share_url` | string | No | Optional full URL to download the PDF (e.g., a time-limited download_url from a DocumentCard). When provided, this URL is used directly instead of constructing the /share/:token/:filename path. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
