WhatsApp API Documentation

Integrate FlixySMS WhatsApp messaging into your applications

← Back to API Keys

Base URL

https://flixysms.com/api/v1

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

WhatsApp Device Requirements

To use the WhatsApp API, you must have at least one WhatsApp Web Agent connected and active. The agent will automatically handle message delivery through WhatsApp Web.

Rate Limiting

API requests are rate limited to 100 requests per minute by default. Rate limit information is included in response headers:

  • X-RateLimit-Limit: Maximum requests per minute
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-RateLimit-Reset: Unix timestamp when the rate limit resets
POST/api/v1/wtsp/send

Send a single WhatsApp message

Headers

{
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request Body

{
  "to": "+1234567890",
  "message": "Hello from FlixySMS WhatsApp!",
  "device_id": "optional-device-uuid"
}

Response

{
  "success": true,
  "message_id": "123e4567-e89b-12d3-a456-426614174000",
  "device_id": "987e6543-e89b-12d3-a456-426614174000",
  "status": "queued",
  "to": "+1234567890",
  "message": "Hello from FlixySMS WhatsApp!"
}

Code Examples

curl
curl -X POST \
  https://flixysms.com/api/v1/wtsp/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+1234567890",
  "message": "Hello from FlixySMS WhatsApp!",
  "device_id": "optional-device-uuid"
}'
javascript
const response = await fetch('https://flixysms.com/api/v1/wtsp/send', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "to": "+1234567890",
      "message": "Hello from FlixySMS WhatsApp!",
      "device_id": "optional-device-uuid"
    })
});

const data = await response.json();
console.log(data);
python
import requests

response = requests.post(
    'https://flixysms.com/api/v1/wtsp/send',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
      "to": "+1234567890",
      "message": "Hello from FlixySMS WhatsApp!",
      "device_id": "optional-device-uuid"
    }
)

print(response.json())
php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://flixysms.com/api/v1/wtsp/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode({
      "to": "+1234567890",
      "message": "Hello from FlixySMS WhatsApp!",
      "device_id": "optional-device-uuid"
    }));

$response = curl_exec($ch);
curl_close($ch);

echo $response;
POST/api/v1/wtsp/bulk

Send WhatsApp messages to multiple recipients (max 100 per request)

Headers

{
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request Body

{
  "recipients": [
    "+1234567890",
    "+0987654321",
    "+1122334455"
  ],
  "message": "Hello from FlixySMS WhatsApp!",
  "device_id": "optional-device-uuid"
}

Response

{
  "success": true,
  "message_ids": [
    "123e4567-e89b-12d3-a456-426614174000",
    "223e4567-e89b-12d3-a456-426614174001",
    "323e4567-e89b-12d3-a456-426614174002"
  ],
  "device_id": "987e6543-e89b-12d3-a456-426614174000",
  "stats": {
    "total": 3,
    "valid": 3,
    "invalid": 0,
    "queued": 3
  }
}

Code Examples

curl
curl -X POST \
  https://flixysms.com/api/v1/wtsp/bulk \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "recipients": [
    "+1234567890",
    "+0987654321",
    "+1122334455"
  ],
  "message": "Hello from FlixySMS WhatsApp!",
  "device_id": "optional-device-uuid"
}'
javascript
const response = await fetch('https://flixysms.com/api/v1/wtsp/bulk', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "recipients": [
        "+1234567890",
        "+0987654321",
        "+1122334455"
      ],
      "message": "Hello from FlixySMS WhatsApp!",
      "device_id": "optional-device-uuid"
    })
});

const data = await response.json();
console.log(data);
python
import requests

response = requests.post(
    'https://flixysms.com/api/v1/wtsp/bulk',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
      "recipients": [
        "+1234567890",
        "+0987654321",
        "+1122334455"
      ],
      "message": "Hello from FlixySMS WhatsApp!",
      "device_id": "optional-device-uuid"
    }
)

print(response.json())
php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://flixysms.com/api/v1/wtsp/bulk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode({
      "recipients": [
        "+1234567890",
        "+0987654321",
        "+1122334455"
      ],
      "message": "Hello from FlixySMS WhatsApp!",
      "device_id": "optional-device-uuid"
    }));

$response = curl_exec($ch);
curl_close($ch);

echo $response;
GET/api/v1/wtsp/status/:message_id

Check the delivery status of a sent WhatsApp message

Headers

{
  "Authorization": "Bearer YOUR_API_KEY"
}

Response

{
  "success": true,
  "data": {
    "message_id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "delivered",
    "delivered_at": "2024-01-15T10:31:00Z",
    "device_id": "987e6543-e89b-12d3-a456-426614174000"
  }
}

Code Examples

curl
curl -X GET \
  https://flixysms.com/api/v1/wtsp/status/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  
javascript
const response = await fetch('https://flixysms.com/api/v1/wtsp/status/123e4567-e89b-12d3-a456-426614174000', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    
  }
});

const data = await response.json();
console.log(data);
python
import requests

response = requests.get(
    'https://flixysms.com/api/v1/wtsp/status/123e4567-e89b-12d3-a456-426614174000',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        
    }
)

print(response.json())
php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://flixysms.com/api/v1/wtsp/status/123e4567-e89b-12d3-a456-426614174000');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY',
    
]);


$response = curl_exec($ch);
curl_close($ch);

echo $response;

Error Responses

The API returns standard HTTP status codes to indicate success or failure of requests.

400

Bad Request

The request was invalid or missing required parameters

401

Unauthorized

Invalid or missing API key

403

Forbidden

API key doesn't have permission for this endpoint

429

Too Many Requests

Rate limit exceeded

503

Service Unavailable

No WhatsApp devices available to send messages

FlixySMS - Professional SMS Marketing Platform | Bulk SMS campaigns Gateway