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

# Return All Templates

> Create PDF’s from HTML template input.

<Note>
  **Try it live:** [Return All Templates → API Tester](/api-tester/pdf-from-html/templates) — send a real request from your browser.
</Note>

## `GET /v1/templates/html`

Once you have obtained a template then use the [PDF from HTML](/api/pdf-from-html) API with the required templateId & templateData parameters defined.

Use the dashboard to manage your [HTML to PDF Templates](https://app.pdf.co/html-templates-tool).

<Note>*No query parameters accepted.*</Note>

## Responses

The JSON below is a simplified example, not a complete account dump. It shows one **system** template and one **user** template. A live response includes all system templates plus any user templates on the account. List items do not include `body`; fetch HTML with [Return HTML Template by ID](/api/pdf-from-html/template-id).

```json Synchronous response theme={null}
{
  "credits": 2,
  "remainingCredits": 88470,
  "templates": [
    {
      "description": "Simple invoice template using Mustache macros.",
      "id": 1,
      "test_json": "{ \"paid\": true }",
      "title": "Simple Invoice",
      "type": "system",
      "updated_at": "2022-10-12T12:15:29.075Z"
    },
    {
      "description": "",
      "id": 15,
      "test_json": "{ \"paid\": true }",
      "title": "User Template 1",
      "type": "user",
      "updated_at": "2024-03-01T10:00:00.000Z"
    }
  ]
}
```

| Field | Type | Description |
| - | - | - |
| `credits` | integer | Number of credits consumed by the request |
| `remainingCredits` | integer | Number of credits remaining in the account |
| `templates` | array\[object] | HTML templates available to the account. List items do not include `body`. |
|     `id` | integer | Template ID. |
|     `title` | string | Template title. |
|     `description` | string | Template description. |
|     `type` | string | Template type (system or user). |
|     `test_json` | string | Sample JSON data used to fill the template. |
|     `updated_at` | string | Timestamp when the template was last updated. |

<Note>
  **Inconsistent URL Encoding in cURL Output:** When using cURL to make API requests, the output JSON may show URL characters encoded as Unicode escape sequences. For example, the ampersand character (`&`) may appear as `\u0026` in the cURL output. This is normal JSON encoding behavior and does not affect the validity of the URL. The URL will function correctly when used, as JSON parsers automatically decode these escape sequences. If you're parsing the response programmatically, your JSON parser will handle this conversion automatically.
</Note>

<div id="code-samples" />

<Panel>
  **Sample request**

  <RequestExample dropdown>
    ```bash cURL theme={null}
    curl --location --request GET 'https://api.pdf.co/v1/templates/html' \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: *******************' \
    --data-raw ''
    ```
  </RequestExample>

  <ResponseExample>
    ```json 200 theme={null}
    {
      "credits": 2,
      "remainingCredits": 88470,
      "templates": [
        {
          "description": "Simple invoice template using Mustache macros.",
          "id": 1,
          "test_json": "{ \"paid\": true }",
          "title": "Simple Invoice",
          "type": "system",
          "updated_at": "2022-10-12T12:15:29.075Z"
        },
        {
          "description": "",
          "id": 15,
          "test_json": "{ \"paid\": true }",
          "title": "User Template 1",
          "type": "user",
          "updated_at": "2024-03-01T10:00:00.000Z"
        }
      ]
    }
    ```

    ```json 400 theme={null}
    {
      "error": true,
      "status": 400,
      "message": "Bad request. Typically due to bad input parameters or unreachable input URLs (e.g., access restrictions like login or password)."
    }
    ```

    ```json 401 theme={null}
    {
      "error": true,
      "status": 401,
      "message": "Unauthorized. Authentication is required and has failed or has not yet been provided."
    }
    ```

    ```json 402 theme={null}
    {
      "error": true,
      "status": 402,
      "message": "Not enough credits."
    }
    ```

    ```json 404 theme={null}
    {
      "error": true,
      "status": 404,
      "message": "The requested resource could not be found."
    }
    ```

    ```json 429 theme={null}
    {
      "error": true,
      "status": 429,
      "message": "Too many requests in a given time period."
    }
    ```

    ```json 500 theme={null}
    {
      "error": true,
      "status": 500,
      "message": "Something went wrong. Please try again or contact support."
    }
    ```
  </ResponseExample>
</Panel>


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