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

# Send template message

> Sends an approved message template to a phone number. Each template message sent has an associated cost.



## OpenAPI

````yaml POST /messages/template
openapi: 3.0.0
info:
  title: Cogfy Messenger Public API
  version: 1.0.0
  description: API for interacting with the Cogfy Messenger platform
servers:
  - url: https://messenger-public-api.cogfy.com
    description: Production server
  - url: http://localhost:53981
    description: Local server
security:
  - ApiKeyAuth: []
tags: []
paths:
  /messages/template:
    post:
      tags:
        - Messages
      summary: Send message template
      description: >-
        Sends an approved message template to a phone number. Each template
        message sent has an associated cost.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                to:
                  type: string
                template:
                  type: object
                  properties:
                    name:
                      type: string
                    language:
                      type: object
                      properties:
                        code:
                          type: string
                    components:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                          sub_type:
                            type: string
                            nullable: true
                          index:
                            type: integer
                            minimum: 0
                            maximum: 2
                            nullable: true
                          parameters:
                            type: array
                            items:
                              type: string
      responses:
        '200':
          description: Message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-key

````