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

# Mengirim Pesan WhatsApp

> Anda bisa menggunakan route API ini untuk mengirim pesan whatsapp programmatically atau secara terprogram menggunakan API. Anda bisa memanfaatkannya untuk integrasi otomasi sistem anda. Contohnya seperti sistem OTP, WA Broadcast, Bot dan masih banyak lagi



## OpenAPI

````yaml /openapi.yaml post /api/v1/messages/send
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Dokumentasi REST API untuk berinteraksi dengan layanan WABeres
    programmatically atau programmatically
  title: WABeres (Unofficial WhatsApp API Gateway)
  version: 0.0.1
servers:
  - url: https://waberes.fredoronan.web.id
security: []
paths:
  /api/v1/messages/send:
    post:
      tags:
        - Messages
      summary: Mengirim Pesan WhatsApp
      description: >-
        Anda bisa menggunakan route API ini untuk mengirim pesan whatsapp
        programmatically atau secara terprogram menggunakan API. Anda bisa
        memanfaatkannya untuk integrasi otomasi sistem anda. Contohnya seperti
        sistem OTP, WA Broadcast, Bot dan masih banyak lagi
      parameters:
        - description: API Key anda
          in: header
          name: X-API-Key
          required: true
          schema:
            type: string
        - description: >-
            Timestamp generate otomatis secara terprogram/programmatically,
            jangan manual
          in: header
          name: X-Timestamp
          required: true
          schema:
            type: string
        - description: Signature(METHOD + Path + timestamp + hashed(body))
          in: header
          name: X-Signature
          required: true
          schema:
            type: string
        - description: Device ID yang sudah connected
          in: header
          name: X-Device-Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1.SendMessageRequest'
        description: Data Pesan yang ingin dikirim beserta nomor tujuan
        required: true
      responses:
        '202':
          description: >-
            Jika berhasil, request mengirim pesan akan di masukkan ke dalam
            antrian yang bisa di track menggunakan job id
          content:
            '*/*':
              schema:
                $ref: >-
                  #/components/schemas/v1.ApiSuccessResponse-v1_SendMessageResponse
        '400':
          description: terkait dengan data yang di kirim tidak lengkap
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/v1.ApiErrResponse'
        '403':
          description: terkait dengan device yang belum connected atau kuota yang habis
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/v1.ApiErrResponse'
        '404':
          description: terkait dengan data yang di kirim tidak ada dalam database
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/v1.ApiErrResponse'
        '500':
          description: internal server error, bukan anda
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/v1.ApiErrResponse'
components:
  schemas:
    v1.SendMessageRequest:
      properties:
        message:
          example: Test Send Message from API
          type: string
        phone_destination:
          example: '6281234567890'
          type: string
      required:
        - message
        - phone_destination
      type: object
    v1.ApiSuccessResponse-v1_SendMessageResponse:
      properties:
        data:
          $ref: '#/components/schemas/v1.SendMessageResponse'
        message:
          example: berhasil melakukan sesuatu
          type: string
        success:
          example: true
          type: boolean
      type: object
    v1.ApiErrResponse:
      properties:
        code:
          example: error code (sebatas kode error saja)
          type: string
        error:
          example: verbosed error message (keterangan error yang lebih detail)
          type: string
        success:
          example: false
          type: boolean
      type: object
    v1.SendMessageResponse:
      properties:
        job_id:
          example: abcde12345
          type: string
      type: object

````