> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/apitemplate.io.md).

# APITemplate.io

Generate PDF and image documents from APITemplate.io templates, HTML, Markdown, or a web page, and list, check, or delete the files you generate.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector      | Authentication |
| -------------- | -------------- |
| APITemplate.io | API Key        |

#### APITemplate.io

Connect to APITemplate.io to generate PDF and image documents from templates.

**Set up in APITemplate.io**

1. Prepare the APITemplate.io account or service that the workflow will access. Grant access to the required resources and operations.
2. **API Key:** Your APITemplate.io API key, from API Integration in the web console. It carries the same privileges as your account and has no narrower scope.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **APITemplate.io**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required                 | What to enter                                                                                                                                                                                                    |
| ------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Key       | Yes                      | Your APITemplate.io API key, from API Integration in the web console. It carries the same privileges as your account and has no narrower scope. [Provider instructions](https://app.apitemplate.io/manage-api/). |
| Region        | Optional / as applicable | Where APITemplate.io processes and stores your files: default (Singapore), eu (Frankfurt), us (US East), or au (Sydney). Keep default if unsure.                                                                 |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **APITemplate.io** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Create PDF from Template

Fill one of your APITemplate.io PDF templates with data and get a link to the finished PDF. The link is public and never expires unless you set an expiry under advanced options.

**Inputs**

| Field                        | Type            | Required | Description                                                                                              |
| ---------------------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| Template                     | select (string) | Yes      | The PDF template to fill in. Options load from the selected connection.                                  |
| Data                         | textarea        | No       | The values to put into the template, as JSON. The keys must match the fields your template uses.         |
| Show advanced options        | boolean         | No       | Reveal file name, link expiry, and reference fields. Default: false.                                     |
| File Name                    | string          | No       | Name for the generated PDF. Leave empty for a random name.                                               |
| Link Expires After (minutes) | integer         | No       | How long the public download link works. Leave empty to keep it permanently. Minimum: 1. Maximum: 10080. |
| Reference                    | string          | No       | Your own label for this file, shown when you list generated files.                                       |

**Outputs**

| Field                 | Type    | Description                |
| --------------------- | ------- | -------------------------- |
| Download URL          | string  | Link to the generated PDF. |
| Transaction Reference | string  | ID of the generated file.  |
| Total Pages           | integer | Page count of the PDF.     |
| Template ID           | string  | Template used.             |

#### Create Image from Template

Fill one of your APITemplate.io image templates with text and pictures and get links to the finished JPEG and PNG. The link is public and never expires unless you set an expiry under advanced options.

**Inputs**

| Field                        | Type            | Required | Description                                                                                                |
| ---------------------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| Template                     | select (string) | Yes      | The image template to fill in. Options load from the selected connection.                                  |
| Layer Changes                | textarea        | Yes      | Which layers of the image to change and their new values, as JSON.                                         |
| Show advanced options        | boolean         | No       | Reveal image format, link expiry, and reference fields. Default: false.                                    |
| Image Format                 | select (string) | No       | Which image files to produce. Available values: JPEG and PNG, JPEG only, PNG only. Default: all.           |
| Link Expires After (minutes) | integer         | No       | How long the public download links work. Leave empty to keep them permanently. Minimum: 1. Maximum: 10080. |
| Reference                    | string          | No       | Your own label for this file, shown when you list generated files.                                         |

**Outputs**

| Field                 | Type   | Description               |
| --------------------- | ------ | ------------------------- |
| JPEG URL              | string | Link to the JPEG image.   |
| PNG URL               | string | Link to the PNG image.    |
| Transaction Reference | string | ID of the generated file. |

#### Create PDF from HTML

Turn HTML (and optional CSS) into a PDF without making a template first. The link is public and never expires unless you set an expiry under advanced options.

**Inputs**

| Field                        | Type            | Required | Description                                                                                              |
| ---------------------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| HTML                         | textarea        | Yes      | The page content as HTML.                                                                                |
| Show advanced options        | boolean         | No       | Reveal CSS, data, file name, and link expiry fields. Default: false.                                     |
| CSS                          | textarea        | No       | Styles for the page.                                                                                     |
| Data                         | textarea        | No       | Values for placeholders in the HTML, as JSON.                                                            |
| Paper Size                   | select (string) | No       | Page size of the PDF. Available values: Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6.      |
| Orientation                  | select (string) | No       | Portrait or landscape. Available values: Portrait, Landscape.                                            |
| File Name                    | string          | No       | Name for the generated PDF.                                                                              |
| Link Expires After (minutes) | integer         | No       | How long the public download link works. Leave empty to keep it permanently. Minimum: 1. Maximum: 10080. |

**Outputs**

| Field                 | Type    | Description                |
| --------------------- | ------- | -------------------------- |
| Download URL          | string  | Link to the generated PDF. |
| Transaction Reference | string  | ID of the generated file.  |
| Total Pages           | integer | Page count.                |

#### Create PDF from Markdown

Turn Markdown text, such as an AI-written report, into a PDF. The link is public and never expires unless you set an expiry under advanced options.

**Inputs**

| Field                        | Type            | Required | Description                                                                                              |
| ---------------------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| Markdown                     | textarea        | Yes      | The document content in Markdown.                                                                        |
| Paper Size                   | select (string) | No       | Page size of the PDF. Available values: Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6.      |
| Orientation                  | select (string) | No       | Portrait or landscape. Available values: Portrait, Landscape.                                            |
| Show advanced options        | boolean         | No       | Reveal CSS, placeholder data, file name, and link expiry fields. Default: false.                         |
| CSS                          | textarea        | No       | Styles for the page.                                                                                     |
| Data                         | textarea        | No       | Values for placeholders in the Markdown, as JSON.                                                        |
| File Name                    | string          | No       | Name for the generated PDF.                                                                              |
| Link Expires After (minutes) | integer         | No       | How long the public download link works. Leave empty to keep it permanently. Minimum: 1. Maximum: 10080. |

**Outputs**

| Field                 | Type    | Description                |
| --------------------- | ------- | -------------------------- |
| Download URL          | string  | Link to the generated PDF. |
| Transaction Reference | string  | ID of the generated file.  |
| Total Pages           | integer | Page count.                |

#### Create PDF from Web Page

Save any public web page as a PDF. The link is public and never expires unless you set an expiry under advanced options.

**Inputs**

| Field                        | Type            | Required | Description                                                                                              |
| ---------------------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| Page URL                     | string          | Yes      | Address of the web page to capture.                                                                      |
| Paper Size                   | select (string) | No       | Page size of the PDF. Available values: Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6.      |
| Orientation                  | select (string) | No       | Portrait or landscape. Available values: Portrait, Landscape.                                            |
| Show advanced options        | boolean         | No       | Reveal file name and link expiration fields. Default: false.                                             |
| File Name                    | string          | No       | Name for the generated PDF.                                                                              |
| Link Expires After (minutes) | integer         | No       | How long the public download link works. Leave empty to keep it permanently. Minimum: 1. Maximum: 10080. |

**Outputs**

| Field                 | Type    | Description                |
| --------------------- | ------- | -------------------------- |
| Download URL          | string  | Link to the generated PDF. |
| Transaction Reference | string  | ID of the generated file.  |
| Total Pages           | integer | Page count.                |

#### Merge PDFs

Combine several PDFs into one file, in the order you list them. The link is public and never expires unless you set an expiry under advanced options.

**Inputs**

| Field                        | Type     | Required | Description                                                                                              |
| ---------------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------- |
| PDF URLs                     | textarea | Yes      | Links to the PDFs to combine, one per line or separated by commas.                                       |
| Show advanced options        | boolean  | No       | Reveal link expiry and reference fields. Default: false.                                                 |
| Link Expires After (minutes) | integer  | No       | How long the public download link works. Leave empty to keep it permanently. Minimum: 1. Maximum: 43200. |
| Reference                    | string   | No       | Your own label for this file, shown when you list generated files.                                       |

**Outputs**

| Field                 | Type    | Description             |
| --------------------- | ------- | ----------------------- |
| Download URL          | string  | Link to the merged PDF. |
| Transaction Reference | string  | ID of the merged file.  |
| Total Pages           | integer | Page count.             |

#### List Templates

See the PDF and image templates in your account.

**Inputs**

| Field                 | Type            | Required | Description                                                                                        |
| --------------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------- |
| Template Type         | select (string) | No       | Only show PDF templates or only image templates. Available values: PDF templates, Image templates. |
| Show advanced options | boolean         | No       | Reveal the group filter, result cap, and start offset. Default: false.                             |
| Group                 | string          | No       | Only show templates in this group.                                                                 |
| Max Results           | integer         | No       | Most templates to return. Minimum: 1. Maximum: 300.                                                |
| Start At              | integer         | No       | Skip this many templates, to continue a previous list. Minimum: 0.                                 |

**Outputs**

| Field       | Type          | Description                          |
| ----------- | ------------- | ------------------------------------ |
| Templates   | object\_array | Your templates.                      |
| Next Offset | integer       | Where to continue if there are more. |

#### List Generated Files

See the PDFs and images you've generated, with their links.

**Inputs**

| Field                 | Type            | Required | Description                                                                         |
| --------------------- | --------------- | -------- | ----------------------------------------------------------------------------------- |
| Template              | select (string) | No       | Only show files made from this template. Options load from the selected connection. |
| File Type             | select (string) | No       | Only show one kind of file. Available values: PDF, Image, Merged PDF.               |
| Show advanced options | boolean         | No       | Reveal max results and start offset fields. Default: false.                         |
| Max Results           | integer         | No       | Most files to return. Minimum: 1. Maximum: 300.                                     |
| Start At              | integer         | No       | Skip this many files, to continue a previous list. Minimum: 0.                      |

**Outputs**

| Field       | Type          | Description                          |
| ----------- | ------------- | ------------------------------------ |
| Files       | object\_array | Generated files.                     |
| Next Offset | integer       | Where to continue if there are more. |

#### Delete Generated File

Permanently delete a generated PDF or image so its link stops working.

**Inputs**

| Field                 | Type   | Required | Description                                                 |
| --------------------- | ------ | -------- | ----------------------------------------------------------- |
| Transaction Reference | string | Yes      | The ID of the file to delete, returned when it was created. |

**Outputs**

| Field                 | Type    | Description                   |
| --------------------- | ------- | ----------------------------- |
| Transaction Reference | string  | The deleted file's ID.        |
| Deleted               | boolean | Whether the file was deleted. |

#### Get Account Usage

Check your plan and how many generations and templates you have left.

**Inputs**

No input fields are required in this catalog entry.

**Outputs**

| Field                 | Type    | Description                        |
| --------------------- | ------- | ---------------------------------- |
| Plan                  | string  | Your plan.                         |
| Plan Status           | string  | Plan status.                       |
| Generation Quota      | integer | Generations included in your plan. |
| Generations Remaining | integer | Generations you have left.         |
| Template Quota        | integer | Templates allowed.                 |
| Templates Remaining   | integer | Templates you can still add.       |
| Period Ends           | string  | When your usage resets.            |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/apitemplate.io.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
