> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF-API.io API reference

> API reference for the PDF-API.io plugin in Corsair: every `pdfapi.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Templates

### listTemplates

`templates.listTemplates`

Returns the templates in the PDF-API.io account

**Risk:** `read`

```ts theme={null}
await corsair.pdfapi.api.templates.listTemplates({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name: string,
>   team_name?: string | null,
>   team_id?: string | number | null,
>   type?: string | null,
>   created_at?: string | null,
>   meta?: Record<string, any> | any[] | null,
>   variables?: Record<string, any>[]
> }[]
> ```

***

### mergeTemplates

`templates.mergeTemplates`

Renders and merges multiple templates into one PDF document

**Risk:** `destructive`

```ts theme={null}
await corsair.pdfapi.api.templates.mergeTemplates({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templates` | `object[]` | Yes | — |
| `output` | `pdf \| url` | No | — |

> [accordion] templates full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   data: Record<string, any>
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number` | No | — |
| `data` | `string` | No | — |
| `url` | `string` | No | — |

***

### renderTemplate

`templates.renderTemplate`

Renders a template into a PDF document from placeholder values

**Risk:** `destructive`

```ts theme={null}
await corsair.pdfapi.api.templates.renderTemplate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateId` | `string \| number` | Yes | — |
| `data` | `Record<string, any>` | Yes | — |
| `output` | `pdf \| url` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number` | No | — |
| `data` | `string` | No | — |
| `url` | `string` | No | — |

***

### retrieveTemplate

`templates.retrieveTemplate`

Returns one template with its variables by its template id

**Risk:** `read`

```ts theme={null}
await corsair.pdfapi.api.templates.retrieveTemplate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template` | `string \| number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `name` | `string` | Yes | — |
| `team_name` | `string \| null` | No | — |
| `team_id` | `string \| number \| null` | No | — |
| `type` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `meta` | `Record<string, any> \| any[] \| null` | No | — |
| `variables` | `Record<string, any>[]` | No | — |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.