API Documentation
Send WhatsApp messages programmatically — text & images — with our simple REST API.
Join our Developer Program
Full API access, cashback on every sale you bring, and exclusive developer resources.
Authentication
The API uses two different API keys depending on the operation, both sent as a Bearer token.
Required for reading account data (credits, message history).
Get from your Account Settings.
Authorization: Bearer <USER_API_KEY>
Base URL
https://api-messaging.pollenbyte.com/v1
All requests must use HTTPS. POST requests must include
Content-Type: application/json.
/v1/send-message
Message API Key
Send a single WhatsApp message to a phone number. Supports text, image and document messages.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
phone |
string | Required | Recipient phone with country code. No leading + or 0. E.g.
201012345678
|
message |
string | Optional* | Text message content. Max 1000 chars. When sending an image or document, this becomes the caption. |
file_url |
string | Optional* | Publicly accessible URL for the file (image or document). Max 2048 chars. |
file_name |
string | Optional | The name of the file as it will appear in WhatsApp (mandatory for documents). E.g.
invoice.pdf
|
mimetype |
string | Optional | The MIME type of the file. E.g. application/pdf. Auto-detected for
common types. |
message_type |
string | Optional | One of: text, image, or document.
Auto-detected if omitted. |
message or
file_url is required.
Provide file_url with a public direct URL. Set message_type to
image or document. For documents, providing file_name
is highly recommended.
Text Message Example
curl -X POST "https://api-messaging.pollenbyte.com/v1/send-message" \
-H "Authorization: Bearer YOUR_MESSAGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone":"201012345678","message":"Hello from API!"}'
Image Message Example
curl -X POST "https://api-messaging.pollenbyte.com/v1/send-message" \
-H "Authorization: Bearer YOUR_MESSAGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "201012345678",
"file_url": "https://example.com/photo.jpg",
"message": "Check this out!"
}'
Document Message Example
curl -X POST "https://api-messaging.pollenbyte.com/v1/send-message" \
-H "Authorization: Bearer YOUR_MESSAGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "201012345678",
"message_type": "document",
"file_url": "https://example.com/invoice.pdf",
"file_name": "Invoice-123.pdf",
"message": "Here is your invoice"
}'
Responses
{
"success": true,
"message": "Message scheduled successfully",
"data": {
"message_id": 42,
"phone": "201012345678"
}
}
{"message": "The message or file_url field is required."}
{"success": false, "error": {"code": "INVALID_API_KEY", "message": "Invalid API Key provided"}}
/v1/credits
User API Key
Returns your current credit balance, along with monthly statistics for credits gained and spent.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
all |
boolean | 0 |
Set to 1 to get all-time historical statistics instead of the current
month. |
Examples
curl -X GET "https://api-messaging.pollenbyte.com/v1/credits" \
-H "Authorization: Bearer YOUR_USER_API_KEY"
Response
{
"success": true,
"data": {
"free_credits": 50,
"charged_credits": 900,
"total_credits": 950,
"credits_gained": 1200.0,
"credits_spent": 250.0,
"period": "current_month"
}
}
/v1/messages
User API Key
Returns a paginated list of messages sent from your account. By default, it only shows messages from the current month.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer | 10 |
Number of messages per page. |
all |
boolean | 0 |
Set to 1 to see messages and statistics from all time. |
Examples
curl -X GET "https://api-messaging.pollenbyte.com/v1/messages?limit=20" \
-H "Authorization: Bearer YOUR_USER_API_KEY"
Response
{
"success": true,
"report_period": "current_month",
"total_send_messages": 142,
"total_sent_messages": 138,
"total_failed_messages": 3,
"total_pending_messages": 1,
"data": {
"current_page": 1,
"data": [
{
"id": 42,
"recipient_phone": "201012345678",
"body": "Hello!",
"message_type": "text",
"file_url": null,
"status": "sent",
"send_type": "single",
"created_at": "2026-03-01T10:00:00.000000Z"
}
],
"next_page_url": "https://api-messaging.pollenbyte.com/v1/messages?cursor=xxx",
"prev_page_url": null
}
}
/v1/messages/{id}
User API Key
Returns the full details of a specific message by its ID.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | Required | The message ID returned when the message was sent. |
Examples
curl -X GET "https://api-messaging.pollenbyte.com/v1/messages/42" \
-H "Authorization: Bearer YOUR_USER_API_KEY"
Responses
{
"success": true,
"data": {
"id": 42,
"recipient_phone": "201012345678",
"body": "Hello!",
"message_type": "text",
"file_url": null,
"status": "sent",
"send_type": "single",
"created_at": "2026-03-01T10:00:00.000000Z",
"updated_at": "2026-03-01T10:00:05.000000Z"
}
}
{"message": "No query results for model [App\\Models\\Message] 42"}
Error Codes
All errors return a consistent JSON structure. Use the HTTP status code and
error.code to handle them programmatically.
MISSING_API_KEYNo Authorization header provided.
INVALID_API_KEYAPI key doesn't match any active instance or user account.
VALIDATION_ERROROne or more request fields failed validation.
INSUFFICIENT_CREDITSAccount doesn't have enough credits to send the message.
TOO_MANY_REQUESTSRate limit exceeded (40 req/min). Wait before retrying.
INTERNAL_SERVER_ERRORUnexpected server error. Retry or contact support.
Error Response Shape
{
"success": false,
"error": {
"code": "ERROR_CODE_HERE",
"message": "Human-readable description"
}
}
Rate Limiting
| Endpoint | Limit | Window |
|---|---|---|
POST /send-message |
40 requests | per minute |
GET /credits, GET /messages,
GET /messages/{id}
|
No hard limit | — |
When exceeded: 429 Too Many Requests. Retry after 1 minute.
201 and a
message_id. Actual WhatsApp delivery happens within seconds.
Credit Refund Policy
We value your credits. Our system includes an automated mechanism to ensure you only pay for messages that have a fair chance of delivery.
Stuck Messages
Any message that remains in pending or processing status for more
than 2 hours is considered "stuck". These messages are automatically
cancelled and their credits are fully refunded to your balance.
Failed Deliveries
Messages that immediately reach a failed status due to system errors or carrier
issues are eligible for automatic refunds. Our background process verifies these daily.