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

# Send WhatsApp Template

> Sends a per-approved template message to WhatsApp



## OpenAPI

````yaml POST /stable/open/whatsapp/send-template-message
openapi: 3.0.3
info:
  title: MyAlice
  description: MyAlice API to communicate with MyAlice dashboard and your internal system
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.myalice.ai
security:
  - ApiKeyAuth: []
paths:
  /stable/open/whatsapp/send-template-message:
    post:
      description: Sends a per-approved template message to WhatsApp
      requestBody:
        description: WhatsApp Template to send
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendTemplate'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessSendTemplate'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauth'
components:
  schemas:
    SendTemplate:
      required:
        - template_id
        - channel_id
        - customer_phone
      type: object
      properties:
        template_id:
          description: The Id of the Template, can be found in MyAlice Dashboard
          type: string
          example: '102323213'
        channel_id:
          description: The Id of the WhatsApp Channel, can be found in MyAlice Dashboard
          type: string
          example: '1022'
        customer_phone:
          description: Customer phone with country code
          type: string
          example: '+628123456789'
        attributes:
          description: Key-pair values of the variables in the template
          type: object
          properties:
            '1':
              description: Atttribute in the Template
              type: string
              example: John Doe
        attachment:
          description: Key-pair values of the variables in the template
          type: object
          properties:
            image:
              description: >-
                URL of the attachment, must be publicly accessible. Only use if
                the header is of type image
              type: string
              format: uri
              example: https://myalice.ai/attachment.jpg
            audio:
              description: >-
                URL of the attachment, must be publicly accessible. Only use if
                the header is of type audio
              type: string
              format: uri
              example: https://myalice.ai/attachment.mp3
            video:
              description: >-
                URL of the attachment, must be publicly accessible. Only use if
                the header is of type video
              type: string
              format: uri
              example: https://myalice.ai/attachment.mp4
            document:
              description: >-
                URL of the attachment, must be publicly accessible. Only use if
                the header is of type document
              type: string
              format: uri
              example: https://myalice.ai/attachment.pdf
    SuccessSendTemplate:
      required:
        - id
        - project_id
        - timestamp
        - function_name
        - message
        - status
        - extra
      type: object
      properties:
        id:
          type: string
        project_id:
          type: integer
        timestamp:
          type: string
        function_name:
          type: string
        message:
          type: string
        status:
          type: string
        extra:
          type: object
          properties:
            timestamp:
              type: string
            project_id:
              type: integer
            platform_id:
              type: integer
            customer_id:
              type: integer
            customer_phone:
              type: string
            template_id:
              type: string
            template_name:
              type: string
            source:
              type: string
            success:
              type: boolean
            report:
              type: object
              properties:
                messaging_product:
                  type: string
                contacts:
                  type: array
                  items:
                    type: object
                    properties:
                      input:
                        type: string
                      wa_id:
                        type: string
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      message_status:
                        type: string
    Error:
      required:
        - error
        - code
        - success
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        success:
          type: boolean
    Unauth:
      required:
        - detail
      type: object
      properties:
        detail:
          type: string
          example: Invalid api key provided.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Myalice-Api-Key

````