> ## 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 Message

> 
## 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
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:
    post:
      tags:
        - default
      summary: Send 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'
                message: Hello John, how are you?
                header: Test header
                footer: Test footer
                buttons:
                  - id: fine_1
                    title: I'm fine
                  - id: bad_2
                    title: I'm not well
      responses:
        '200':
          description: OK
          headers:
            Server:
              schema:
                type: number
                example: nginx/1.25.4
            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.22
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            Date:
              schema:
                type: string
                example: Fri, 12 Apr 2024 09:08:49 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.HBgMMjU0NzIwMDU1ODE5FQIAERgSQjY3NEYwN0RENzM2REVDNkIzAA==
                    chat:
                      id: 78
                      uuid: 43065393-3505-43b7-be89-11e1329e41be
                      organization_id: 7
                      wam_id: >-
                        wamid.HBgMMjU0NzIwMDU1ODE5FQIAERgSQjY3NEYwN0RENzM2REVDNkIzAA==
                      contact_id: 13
                      type: outbound
                      metadata: >-
                        {"text":{"body":"Hello John, how are
                        you?"},"type":"text"}
                      media_id: null
                      status: delivered
                      deleted_by: null
                      deleted_at: null
                      created_at: '2024-04-12 12:08:48'
                      contact:
                        id: 13
                        uuid: b4eaafb6-12d5-457e-9a53-124f30075dfa
                        organization_id: 7
                        first_name: null
                        last_name: null
                        phone: '254720055819'
                        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
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````