Skip to content

Premade Templates

Topol offers a collection of ready-made email templates you can easily access and use through our API. This saves you time by letting you start from professionally designed templates instead of building from scratch.

What Can You Do with the API?

  • List templates
    You can request a list of available premade templates. You can customize the list by paging through results, filtering by template type (FREE or PRO), searching by keywords or categories, and sorting by date or other properties.

  • Get template details
    Request a specific template’s full details, including its HTML and JSON content, by providing its ID.

  • List categories and keywords
    You can also get lists of categories (like Business, E-commerce) and keywords (like Sale/Discount, Autumn) to help filter and find templates.

How Does It Work?

1. Get an API key

You need an API key to call these token management APIs. You can get it either from your account settings or from your existing Plugin API Token settings.

When using an API key from your account settings, you can set various permissions. Go to Settings, then navigate to API Tokens. From there, select "Create API Token" and specify the permissions you wish to grant to this token.

If you prefer to use the same existing Plugin API token that was used to initialize your Plugin, simply copy it from the Plugin Settings under "Show API key".

2. Set API Request Headers

When making requests, include these headers:

json
{
  "accept": "application/json",
  "Authorization": "Bearer <api-key>"
}

Available Endpoints

List Templates

To get a list of available premade templates, send a GET request to this endpoint:

  • URL: https://app.topol.io/api/premade-templates
  • Method: GET

Request:

You can use following parameters:

  • per_page (integer) - number of templates per page (default: 25, min: 1)
  • current_page (integer) - page number (default: 1, min: 1)
  • type (string) - possible values: FREE, PRO
  • categories (array) - keywords IDs to search for
  • keywords (array) - keywords IDs to search for
  • sort_by (string) - possible values: id, order, created_at, updated_at
  • sort_by_direction (string) - possible values: asc, desc
  • search (string) - search for templates by name
  • api_token (integer) - your API token ID (nullable)

If you want to get only templates that are available for your API token, you need to pass your API token ID. You can change available templates in your API token settings in Topol.io app.

Response:

Successful response will look like this:

json
{
  "success": true,
  "data": {
    "data": [
      {
        "id": 1,
        "name": "Example template",
        "type": "FREE",
        "img_thumb_url": "example.com/img-thumb-url",
        "category_id": 1,
        "description": "Example description",
        "keywords": [
          {
            "id": 1,
            "keyword": "marketing",
            "slug": "marketing",
            "created_at": "2023-01-01T00:00:00.000000Z",
            "updated_at": "2023-01-01T00:00:00.000000Z",
            "pivot": {
              "premade_template_id": 1,
              "premade_template_keyword_id": 1
            }
          }
        ],
        "created_at": "2023-01-01T00:00:00.000000Z",
        "updated_at": "2023-01-01T00:00:00.000000Z"
      }
    ],
    "total_records": 150,
    "current_page": 1,
    "per_page": 25,
    "next_page": 2,
    "prev_page": null,
    "last_page": 6
  }
}

Get Template Details

Request a specific template’s full details, including its HTML and JSON content, by providing its ID.

  • URL: https://app.topol.io/api/premade-templates/{premadeTemplateId}
  • Method: GET

Response:

Successful response will look like this:

json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Example template",
    "type": "FREE",
    "html": "<b>example html </b>",
    "json": "{\"example\": \"json\"}",
    "category_id": null,
    "order": 1,
    "description": null,
    "visible": 1,
    "created_at": "2023-01-01T00:00:00.000000Z",
    "updated_at": "2023-01-01T00:00:00.000000Z",
    "image_path": "/img/templates/1.jpg",
    "image_thumb_path": "/img/templates/1_thumb.jpg",
    "category": null,
    "keywords": []
  }
}

List Categories

You will get a list of categories (like Business, E-commerce) to help filter and find templates.

  • URL: https://app.topol.io/api/premade-template-categories
  • Method: GET

Response:

Successful response will look like this:

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Business",
      "value": "business"
    },
    {
      "id": 2,
      "name": "E-commerce",
      "value": "e-commerce"
    }
  ]
}

List Keywords

You will get a list of keywords (like Sale/Discount, Autumn) to help filter and find templates.

  • URL: https://app.topol.io/api/premade-template-keywords
  • Method: GET

Response:

Successful response will look like this:

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "sale/discount",
      "value": "salediscount"
    },
    {
      "id": 2,
      "name": "autumn",
      "value": "autumn"
    }
  ]
}