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

# List message templates

> Lists templates for the connected phone number on Meta, with their named variables and header requirements. Returns APPROVED templates by default; pass status=all for every status. Filter with name and language query params (name + language uniquely identifies a template).



## OpenAPI

````yaml /openapi.json get /templates
openapi: 3.1.0
info:
  title: GreenTick Developer API
  version: 1.0.0
  summary: WhatsApp messaging, contacts, workflows, and webhooks
  description: >-
    Use GreenTick's REST API to send WhatsApp messages, synchronize contacts,
    trigger workflows, and receive signed event webhooks. Each API key belongs
    to one connected phone number.
  contact:
    name: GreenTick Support
    url: https://greentick.ai
servers:
  - url: https://api.greentick.ai/v1
    description: GreenTick API v1
security: []
tags:
  - name: System
    description: Health and API metadata
  - name: Messages
    description: Send WhatsApp messages
  - name: Conversations
    description: List inbox threads and fetch message history
  - name: Templates
    description: Discover approved templates and their variables
  - name: Contacts
    description: Synchronize customer contacts
  - name: Labels
    description: Contact label catalog for the connected phone number
  - name: Attributes
    description: Contact custom attribute definitions for the connected phone number
  - name: Phone numbers
    description: WhatsApp sending line for this phone number
  - name: Automations
    description: List enrollable automations and start one for a contact
  - name: Workflow hooks
    description: Trigger GreenTick automations from external systems
  - name: Webhooks
    description: Subscribe Zapier, Make.com, or your own server to GreenTick events
  - name: API key
    description: Check the Bearer API key and account timezone
  - name: MCP platform
    description: Limits, usage, and shared connector behavior
  - name: Media
    description: Host customer-supplied files
  - name: Workflows
    description: Create, publish, and export automations
  - name: Flows
    description: WhatsApp Flows
  - name: AI bots
    description: AI bots and knowledge
  - name: Broadcasts
    description: Template broadcasts
  - name: Catalogs
    description: Commerce catalogs, products, and orders
  - name: Ads
    description: Click-to-WhatsApp ads and conversions
paths:
  /templates:
    get:
      tags:
        - Templates
      summary: List message templates
      description: >-
        Lists templates for the connected phone number on Meta, with their named
        variables and header requirements. Returns APPROVED templates by
        default; pass status=all for every status. Filter with name and language
        query params (name + language uniquely identifies a template).
      operationId: listTemplates
      parameters:
        - name: status
          in: query
          schema:
            type: string
            enum:
              - APPROVED
              - PENDING
              - REJECTED
              - all
            default: APPROVED
        - name: name
          in: query
          schema:
            type: string
          description: Case-insensitive substring filter on template name
        - name: language
          in: query
          schema:
            type: string
            example: en_US
          description: >-
            Exact language filter. Template name + language is the unique
            combination.
      responses:
        '200':
          description: Templates
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Template'
                  total:
                    type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - apiKey: []
components:
  schemas:
    Template:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          example: order_update
        language:
          type: string
          example: en_US
        status:
          type: string
          enum:
            - APPROVED
            - PENDING
            - REJECTED
            - PAUSED
            - DISABLED
          example: APPROVED
        category:
          type: string
          enum:
            - MARKETING
            - UTILITY
            - AUTHENTICATION
          example: UTILITY
        parameterFormat:
          type: string
          const: NAMED
          description: GreenTick templates always use named variables.
        header:
          type: object
          nullable: true
          properties:
            format:
              type: string
              enum:
                - TEXT
                - IMAGE
                - VIDEO
                - DOCUMENT
            text:
              type: string
              nullable: true
            requiresMediaUrl:
              type: boolean
              description: >-
                When true, sending requires template.headerMediaUrl because no
                approved sample media is available. When false for a media
                header, headerMediaUrl is optional and the approved sample is
                used. Limits: IMAGE JPEG/PNG 5 MB, VIDEO MP4 16 MB, DOCUMENT PDF
                100 MB.
            example:
              type: string
              description: >-
                Sample media URL from template approval when available (empty
                string if Meta only stored a media handle). Sent automatically
                when template.headerMediaUrl is omitted.
              example: https://example.com/banner.jpg
        body:
          type: object
          properties:
            text:
              type: string
              description: >-
                Body text. For AUTHENTICATION templates Meta uses fixed OTP
                copy; text may be empty or the resolved preset string.
              example: Hi {{customer_name}}, your order {{order_id}} has shipped.
            addSecurityRecommendation:
              type: boolean
              description: >-
                AUTHENTICATION only. When true, the template includes “For your
                security, do not share this code.”
        footer:
          type: object
          nullable: true
          description: >-
            Footer text and/or AUTHENTICATION code expiration. Null when the
            template has no footer.
          properties:
            text:
              type: string
              nullable: true
              description: Footer text for marketing/utility templates.
            codeExpirationMinutes:
              type: integer
              minimum: 1
              maximum: 90
              description: >-
                AUTHENTICATION only. Minutes until the OTP expires (shown as
                “This code expires in N minutes.”).
              example: 10
        buttons:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              type:
                type: string
                enum:
                  - URL
                  - PHONE_NUMBER
                  - QUICK_REPLY
                  - COPY_CODE
                  - OTP
                example: URL
              text:
                type: string
              url:
                type: string
              phoneNumber:
                type: string
              otpType:
                type: string
                enum:
                  - COPY_CODE
                  - ONE_TAP
                  - ZERO_TAP
                description: >-
                  Present for AUTHENTICATION OTP buttons when Meta returns
                  otp_type.
              variable:
                type: string
                description: >-
                  Placeholder key in the URL for dynamic URL buttons (always
                  {{1}}).
                example: '1'
              example:
                type: string
                description: >-
                  Sample value from template approval (dynamic URL suffix or
                  COPY_CODE).
              requiresVariable:
                type: boolean
                description: When true, pass template.copyCodeVariable when sending.
        variables:
          type: array
          items:
            $ref: '#/components/schemas/TemplateVariable'
          description: >-
            Named variables to supply in template.variables when sending (header
            and body). Each entry includes the Meta approval sample.
          example:
            - name: customer_name
              example: Akshay
            - name: order_id
              example: ord_123
        requiresDynamicURLVariable:
          type: boolean
          description: >-
            When true, POST /messages must include template.dynamicURLVariable.
            Use buttons[].example for the sample suffix.
        requiresCopyCodeVariable:
          type: boolean
          description: When true, POST /messages must include template.copyCodeVariable.
        lastUpdated:
          type: string
          nullable: true
    TemplateVariable:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Named placeholder key (without braces).
          example: customer_name
        example:
          type: string
          description: >-
            Sample value from Meta template approval. Empty string when none was
            provided.
          example: Akshay
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key
      content:
        application/json:
          schema:
            type: object
            required:
              - success
              - code
              - message
            properties:
              success:
                type: boolean
                example: false
              code:
                type: string
                example: INVALID_TO
              message:
                type: string
                example: to (E.164 phone) is required
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: gt_live_…
      description: >-
        Create an API key in GreenTick Developer settings. Send it as
        Authorization: Bearer gt_live_… (Bearer prefix required).

````

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