API Reference

Comprehensive reference for the WAPI REST API.

Base URL: https://api.wapi.com/v1

Authentication

All API requests require authentication using a Bearer token.

Header
Authorization: Bearer YOUR_API_KEY
POST

/messages

Send a text message to a WhatsApp number.

Body Parameters

device_idstringrequired

The ID of the device sending the message.

tostringrequired

Destination phone number with country code (e.g., 628123456789).

messagestringrequired

The text content of the message.

Request Example

{
  "device_id": "dev_1234567890",
  "to": "628123456789",
  "message": "Hello world!"
}

Response Example

{
  "status": true,
  "data": {
    "id": "msg_1234567890",
    "status": "sent"
  }
}
POST

/messages/media

Send a media message (image, video, document) to a WhatsApp number.

Body Parameters

device_idstringrequired

The ID of the device sending the message.

tostringrequired

Destination phone number with country code.

media_urlstringrequired

Direct URL to the media file.

captionstringoptional

Caption for the media message.

Request Example

{
  "device_id": "dev_1234567890",
  "to": "628123456789",
  "media_url": "https://example.com/image.jpg",
  "caption": "Check this out!"
}

Response Example

{
  "status": true,
  "data": {
    "id": "msg_1234567890",
    "status": "sent"
  }
}
GET

/devices/{id}

Get information about a specific device.

Path Parameters

idstringrequired

The ID of the device to retrieve.

Response Example

{
  "status": true,
  "data": {
    "id": "dev_1234567890",
    "name": "My iPhone",
    "status": "connected",
    "quota": 1000,
    "quota_used": 150
  }
}