Messaging
Send and retrieve WhatsApp messages via the API.
POST
/api/v1/messages/text
GET
/api/v1/messages
GET
/api/v1/messages/received
GET
/api/v1/messages/sync
GET
/api/v1/chats/{chatId}/messages
Send Text Message
Use the text message endpoint to send simple text strings. You can use standard formatting.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to |
string | Yes | Recipient phone number with country code (e.g., 260971000000) |
message |
string | Yes | Message text, max 4,096 characters |
Success Response (201)
The response contains the message details after successfully placing it in the queue.
$response = Http::withToken('YOUR_API_KEY')
->post('https://wapi.michotech.me/api/v1/messages/text', [
'to' => '260971000000',
'message' => 'Hello! This is a test message.'
]);
Success Response (201)
{
"data": {
"message_id": "3EB0A0B4F3...",
"status": "sent",
"to": "260971000000",
"created_at": "2026-03-08T10:30:00+00:00"
}
}
Error Responses
{
"message": "The to field is required. (and 1 more error)",
"errors": {
"to": ["The to field is required."],
"message": ["The message field is required."]
}
}
Message History
Returns paginated message history for the session linked to your API key.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
chat_id |
string | null | Filter by a specific chat id |
from_me |
boolean | null | Filter by message direction (true outbound, false inbound) |
type |
string | null | Filter by message type (chat, image, video, audio, document) |
page |
integer | 1 | Page number |
Message Statuses
| Status | Description |
|---|---|
queued |
Message created and queued for delivery |
sent |
Message sent to WhatsApp servers |
delivered |
Message delivered to recipient's device |
read |
Message read by recipient |
failed |
Delivery failed — check error_message field |