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

# Send Template

> 
## API POST /api/send

This endpoint allows you to send a message to a specified phone number.

### Request Body
- `phone` (string, required): The phone number to which the message will be sent.
- `message` (string, required): The content of the message to be sent.

### Response
- Status: 404
- Content-Type: text/html

The response will be a 404 Not Found error if the requested resource is not available.

#### Example Response
```json
{
    "statusCode": 0,
    "data": {
        "success": true,
        "data": {
            "messaging_product": "",
            "contacts": [
                {
                    "input": "",
                    "wa_id": ""
                }
            ],
            "messages": [
                {
                    "id": ""
                }
            ],
            "chat": {
                "id": 0,
                "uuid": "",
                "organization_id": 0,
                "wam_id": "",
                "contact_id": 0,
                "type": "",
                "metadata": "",
                "media_id": null,
                "status": "",
                "deleted_by": null,
                "deleted_at": null,
                "created_at": "",
                "contact": {
                    "id": 0,
                    "uuid": "",
                    "organization_id": 0,
                    "first_name": null,
                    "last_name": null,
                    "phone": "",
                    "email": null,
                    "avatar": null,
                    "address": null,
                    "contact_group_id": null,
                    "is_favorite": 0,
                    "created_by": 0,
                    "created_at": null,
                    "updated_at": null,
                    "deleted_at": null,
                    "full_name": ""
                },
                "media": null
            }
        }
    }
}
```




## OpenAPI

````yaml POST /api/send/template
openapi: 3.0.0
info:
  title: Swiftchats
  version: 1.0.0
servers:
  - url: https://swiftchats.axis96.xyz
security: []
tags:
  - name: Contacts
  - name: Contact Groups
  - name: Canned Replies
paths:
  /api/send/template:
    post:
      tags:
        - default
      summary: Send Template Message
      description: >

        ## API POST /api/send


        This endpoint allows you to send a message to a specified phone number.


        ### Request Body

        - `phone` (string, required): The phone number to which the message will
        be sent.

        - `message` (string, required): The content of the message to be sent.


        ### Response

        - Status: 404

        - Content-Type: text/html


        The response will be a 404 Not Found error if the requested resource is
        not available.


        #### Example Response

        ```json

        {
            "statusCode": 0,
            "data": {
                "success": true,
                "data": {
                    "messaging_product": "",
                    "contacts": [
                        {
                            "input": "",
                            "wa_id": ""
                        }
                    ],
                    "messages": [
                        {
                            "id": ""
                        }
                    ],
                    "chat": {
                        "id": 0,
                        "uuid": "",
                        "organization_id": 0,
                        "wam_id": "",
                        "contact_id": 0,
                        "type": "",
                        "metadata": "",
                        "media_id": null,
                        "status": "",
                        "deleted_by": null,
                        "deleted_at": null,
                        "created_at": "",
                        "contact": {
                            "id": 0,
                            "uuid": "",
                            "organization_id": 0,
                            "first_name": null,
                            "last_name": null,
                            "phone": "",
                            "email": null,
                            "avatar": null,
                            "address": null,
                            "contact_group_id": null,
                            "is_favorite": 0,
                            "created_by": 0,
                            "created_at": null,
                            "updated_at": null,
                            "deleted_at": null,
                            "full_name": ""
                        },
                        "media": null
                    }
                }
            }
        }

        ```
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                phone: '+254720055819'
                template:
                  name: hello_world
                  language:
                    code: en_US
                  components:
                    - type: body
                      parameters:
                        - type: text
                          text: Daniel
                        - type: text
                          text: '14'
      responses:
        '200':
          description: OK
          headers:
            Server:
              schema:
                type: number
                example: nginx/1.25.5
            Content-Type:
              schema:
                type: string
                example: application/json
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Connection:
              schema:
                type: string
                example: keep-alive
            Vary:
              schema:
                type: string
                example: Accept-Encoding
            X-Powered-By:
              schema:
                type: number
                example: PHP/8.1.28
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            Date:
              schema:
                type: string
                example: Mon, 01 Jul 2024 10:27:38 GMT
            X-RateLimit-Limit:
              schema:
                type: integer
                example: '60'
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: '58'
            Access-Control-Allow-Origin:
              schema:
                type: string
                example: '*'
            Content-Encoding:
              schema:
                type: string
                example: gzip
          content:
            application/json:
              schema:
                type: object
              example:
                statusCode: 200
                data:
                  success: true
                  data:
                    messaging_product: whatsapp
                    contacts:
                      - input: '+254720055819'
                        wa_id: '254720055819'
                    messages:
                      - id: >-
                          wamid.HBgMMjU0NzIwMDU1ODE5FQIAERgSOTBCNUMxNUY2MzVGQjIyMUU1AA==
                        message_status: accepted
                    chat:
                      organization_id: 3
                      wam_id: >-
                        wamid.HBgMMjU0NzIwMDU1ODE5FQIAERgSOTBCNUMxNUY2MzVGQjIyMUU1AA==
                      contact_id: 1
                      type: outbound
                      metadata: >-
                        {"type":"text","text":{"body":"Are you interested in
                        quoting. Please send more details
                        here.","footer":"carplans a div of
                        Socovered"},"buttons":[{"type":"QUICK_REPLY","text":"Car
                        insurance","value":"Car
                        insurance"},{"type":"QUICK_REPLY","text":"Home
                        Insurance","value":"Home
                        Insurance"},{"type":"QUICK_REPLY","text":"Building
                        insurance","value":"Building insurance"}]}
                      media_id: null
                      status: accepted
                      created_at: '2024-07-01 10:27:37'
                      uuid: 9196ab05-813f-4037-a323-c890b997ee0b
                      id: 14
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````