listmonk Templates API

The Templates API from listmonk — 5 operation(s) for templates.

Operations 13

GET /templates #
POST /templates #
GET /templates/{id} #
PUT /templates/{id} #
DELETE /templates/{id} #
POST /templates/preview #
GET /templates/{id}/preview #
PUT /templates/{id}/default #
GET /templates/{template_id} Retrieve a template. #
PUT /templates/{template_id} Update an existing template. #
DELETE /templates/{template_id} Delete a template. #
GET /templates/{template_id}/preview Retrieve the rendered HTML preview of a template. #
PUT /templates/{template_id}/default Set a template as the default. #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/listmonk-templates-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

listmonk-templates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Listmonk Templates API
  version: '1.0'
  description: 'Operations tagged Templates across 2 of this provider''s published API definitions: listmonk-collections-openapi.yml, listmonk-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- description: Listmonk Developement Server
  url: http://localhost:9000/api
- url: '{host}/api'
  description: Self-hosted instance
  variables:
    host:
      default: http://localhost:9000
      description: Base URL of your listmonk instance
tags:
- name: Templates
  description: Templates API
  externalDocs:
    url: https://listmonk.app/docs/apis/templates/
paths:
  /templates:
    get:
      description: handles retrieval of templates
      operationId: getTemplates
      tags:
      - Templates
      parameters:
      - in: query
        name: no_body
        description: boolean flag for response with/without body
        required: true
        schema:
          type: boolean
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Template'
    post:
      description: handles template creation
      operationId: createTemplate
      tags:
      - Templates
      requestBody:
        description: new template info
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTemplate'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Template'
    servers:
    - description: Listmonk Developement Server
      url: http://localhost:9000/api
  /templates/{id}:
    get:
      description: handles retrieval of templates
      operationId: getTemplateById
      tags:
      - Templates
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: integer
        description: The id value of the template you want to get.
      - in: query
        name: no_body
        description: boolean flag for response with/without body
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Template'
    put:
      description: handles template modification
      operationId: updateTemplateById
      tags:
      - Templates
      parameters:
      - in: path
        name: id
        required: true
        description: The id value of the template you want to update.
        schema:
          type: integer
      requestBody:
        description: updated template info
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTemplate'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Template'
    delete:
      description: handles deletion of templates
      operationId: deleteTemplateById
      tags:
      - Templates
      parameters:
      - in: path
        name: id
        required: true
        description: The id value of the template you want to delete.
        schema:
          type: integer
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: boolean
    servers:
    - description: Listmonk Developement Server
      url: http://localhost:9000/api
  /templates/preview:
    post:
      description: get the HTML preview of a template.
      operationId: previewTemplate
      tags:
      - Templates
      requestBody:
        required: true
        description: template parameters
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                template_type:
                  description: type of template
                  type: string
                body:
                  description: template body
                  type: string
      responses:
        '200':
          description: response
          content:
            text/html:
              schema:
                type: string
                example: <p>Hi there</p>
    servers:
    - description: Listmonk Developement Server
      url: http://localhost:9000/api
  /templates/{id}/preview:
    get:
      description: renders the HTML preview of a template.
      operationId: previewTemplateById
      tags:
      - Templates
      requestBody:
        description: template parameters
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                template_type:
                  description: type of template
                  type: string
                body:
                  description: template body
                  type: string
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: integer
        description: The id value of the template you want to get.
      responses:
        '200':
          description: response
          content:
            text/html:
              schema:
                type: string
                example: <p>Hi there</p>
    servers:
    - description: Listmonk Developement Server
      url: http://localhost:9000/api
  /templates/{id}/default:
    put:
      description: handles template modification.
      operationId: setDefaultTemplateById
      tags:
      - Templates
      parameters:
      - in: path
        name: id
        required: true
        description: The id value of the template you want to set to the default template.
        schema:
          type: integer
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
    servers:
    - description: Listmonk Developement Server
      url: http://localhost:9000/api
  /templates/{template_id}:
    parameters:
    - name: template_id
      in: path
      required: true
      schema:
        type: integer
    get:
      operationId: getTemplate
      tags:
      - Templates
      summary: Retrieve a template.
      responses:
        '200':
          description: The template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateResponse'
      security:
      - BasicAuth: []
      - TokenAuth: []
    put:
      operationId: updateTemplate
      tags:
      - Templates
      summary: Update an existing template.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateRequest'
      responses:
        '200':
          description: The updated template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateResponse'
      security:
      - BasicAuth: []
      - TokenAuth: []
    delete:
      operationId: deleteTemplate
      tags:
      - Templates
      summary: Delete a template.
      responses:
        '200':
          description: Deletion result.
      security:
      - BasicAuth: []
      - TokenAuth: []
    servers:
    - url: http://localhost:9000/api
      description: Default local self-hosted instance
    - url: '{host}/api'
      description: Self-hosted instance
      variables:
        host:
          default: http://localhost:9000
          description: Base URL of your listmonk instance
  /templates/{template_id}/preview:
    get:
      operationId: previewTemplate
      tags:
      - Templates
      summary: Retrieve the rendered HTML preview of a template.
      parameters:
      - name: template_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Rendered template HTML.
      security:
      - BasicAuth: []
      - TokenAuth: []
    servers:
    - url: http://localhost:9000/api
      description: Default local self-hosted instance
    - url: '{host}/api'
      description: Self-hosted instance
      variables:
        host:
          default: http://localhost:9000
          description: Base URL of your listmonk instance
  /templates/{template_id}/default:
    put:
      operationId: setDefaultTemplate
      tags:
      - Templates
      summary: Set a template as the default.
      parameters:
      - name: template_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Default template set.
      security:
      - BasicAuth: []
      - TokenAuth: []
    servers:
    - url: http://localhost:9000/api
      description: Default local self-hosted instance
    - url: '{host}/api'
      description: Self-hosted instance
      variables:
        host:
          default: http://localhost:9000
          description: Base URL of your listmonk instance
components:
  schemas:
    NewTemplate:
      type: object
      required:
      - name
      - type
      - body
      properties:
        name:
          type: string
          description: Name of the template
        type:
          type: string
          enum:
          - campaign
          - campaign_visual
          - tx
          description: Type of the template
        subject:
          type: string
          description: Subject line for the template (only for tx)
        body_source:
          type: string
          description: JSON source for the email-builder template (only for campaign_visual)
        body:
          type: string
          description: HTML body of the template
    Template:
      type: object
      properties:
        id:
          type: integer
        created_at:
          type: string
        updated_at:
          type: string
        name:
          type: string
        body:
          type: string
        body_source:
          type: string
        subject:
          type: string
        type:
          type: string
        is_default:
          type: boolean
    UpdateTemplate:
      type: object
      properties:
        name:
          type: string
          description: Name of the template
        type:
          type: string
          enum:
          - campaign
          - campaign_visual
          - tx
          description: Type of the template
        subject:
          type: string
          description: Subject line for the template (only for tx)
        body_source:
          type: string
          description: JSON source for the email-builder template (only for campaign_visual)
        body:
          type: string
          description: HTML body of the template
    Template_2:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          type: string
        subject:
          type: string
        body:
          type: string
        is_default:
          type: boolean
        created_at:
          type: string
          format: date-time
    TemplatesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Template_2'
    TemplateRequest:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
          - campaign
          - campaign_visual
          - tx
        subject:
          type: string
        body:
          type: string
      required:
      - name
      - type
      - body
    TemplateResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Template_2'
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: HTTP Basic auth using an API user name and token (api_user:token).
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Authorization header in the form: token api_user:token.'
x-refined-from:
- listmonk-collections-openapi.yml
- listmonk-openapi.yml