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

# List email templates

> Returns message templates for the org.

List message templates

**The first item is always a synthetic entry.** ConveYour prepends `{"id": "default", "name": "Default Template"}` to every response. Its `id` is the literal string `default`, not an ObjectId, and it carries no other fields — code that assumes every item is a stored template with a full field set will break on it.

How much of each *real* template is returned depends on `summary` (default `2`); lower detail levels omit fields such as the message body.

**Response shape:** `data` is a **flat array** of records. This endpoint ignores `page` — the full matching set comes back in one response.



## OpenAPI

````yaml /api-reference/specs/messages.json get /api/messages/templates
openapi: 3.1.0
info:
  title: ConveYour API — Messages
  description: >-
    Send SMS and email messages to contacts, and manage conversation thread
    assignments.
  version: 1.0.0
servers:
  - url: https://{subdomain}.conveyour.com
    description: Your organization's ConveYour instance
    variables:
      subdomain:
        default: acme
        description: >-
          Your organization's slug — the subdomain you sign in on. Replace
          `acme` with yours: if you sign in at `bigco.conveyour.com`, enter
          `bigco`.
security:
  - conveyourToken: []
tags:
  - name: Messages
    description: >-
      Send SMS and email messages to contacts, and manage conversation thread
      assignments.
paths:
  /api/messages/templates:
    get:
      tags:
        - Messages
      summary: List email templates
      description: >-
        Returns message templates for the org.


        List message templates


        **The first item is always a synthetic entry.** ConveYour prepends
        `{"id": "default", "name": "Default Template"}` to every response. Its
        `id` is the literal string `default`, not an ObjectId, and it carries no
        other fields — code that assumes every item is a stored template with a
        full field set will break on it.


        How much of each *real* template is returned depends on `summary`
        (default `2`); lower detail levels omit fields such as the message body.


        **Response shape:** `data` is a **flat array** of records. This endpoint
        ignores `page` — the full matching set comes back in one response.
      operationId: listMessageTemplates
      parameters:
        - $ref: '#/components/parameters/teams'
        - name: summary
          in: query
          required: false
          description: Level of summary detail to include. Defaults to 2.
          schema:
            type: integer
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          oneOf:
                            - $ref: '#/components/schemas/DefaultTemplateStub'
                            - $ref: '#/components/schemas/MessageTemplate'
                        description: >-
                          The FIRST element is always the synthetic {id:
                          'default'} stub; the stored templates follow. The
                          summary query parameter (default 2) controls how much
                          of each stored template is returned.
              example:
                status: ok
                message: success
                data:
                  - id: 64a1b2c3d4e5f6a7b8c9d0e1
                    name: Welcome SMS
                    type: sms
                    body: Hi {{ contact.first_name }}, welcome!
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    teams:
      name: teams[]
      in: query
      description: >-
        Team scope for the request, as one or more team ObjectIds. The brackets
        are required: PHP keeps only the last value for a repeated plain key, so
        `teams=A&teams=B` silently resolves to B alone. On requests with a JSON
        body you may send `teams` (no brackets) in the body instead.


        **Values that are not valid ObjectIds are silently ignored** — a
        mistyped team ID behaves as if no team was sent. See the [teams section
        of the API conventions guide](/guides/api-conventions#team-scoping).
      style: form
      explode: true
      schema:
        type: array
        items:
          type: string
      example:
        - 64a1b2c3d4e5f6a7b8c9d0ff
  schemas:
    Envelope:
      type: object
      description: The common response envelope shared by all ConveYour endpoints.
      properties:
        status:
          type: string
          enum:
            - ok
            - failed
          description: '`ok` on success, `failed` on error.'
        message:
          type: string
          description: Human-readable description of the result.
        data:
          description: >-
            The response payload — an object or an array depending on the
            endpoint.
    DefaultTemplateStub:
      type: object
      description: >-
        A synthetic entry the list endpoint PREPENDS before the real templates.
        It is not a stored record and carries only these two keys.
      properties:
        id:
          type: string
          enum:
            - default
          description: Always the literal 'default'.
        name:
          type: string
          enum:
            - Default Template
          description: Always 'Default Template'.
      required:
        - id
        - name
    MessageTemplate:
      type: object
      description: >-
        A message template. Note that GET /api/messages/templates always
        prepends a synthetic entry {"id":"default","name":"Default Template"}
        that carries no other fields.
      properties:
        id:
          type: string
          description: >-
            Template ID, or the literal string `default` for the synthetic first
            entry.
        name:
          type: string
          description: Template name.
        body:
          type: string
          description: Template body. Returned depending on the `summary` level.
        default:
          type: boolean
          description: Whether this is the org default template.
      required:
        - id
        - name
  responses:
    Forbidden:
      description: >-
        The token is missing or invalid, or the service account behind it lacks
        the permission this endpoint requires.
      content:
        application/json:
          example:
            status: failed
            message: Lacking necessary permission add_contacts
            data:
              permission: add_contacts
  securitySchemes:
    conveyourToken:
      type: apiKey
      in: header
      name: x-conveyour-token
      description: >-
        Your API key token. Contacts endpoints require a **Server-only — Full
        API** key — see [Authentication](/quickstart).

````

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