English
Send Status
POST/statusPost a WhatsApp status straight from your code. Great for daily promos, announcements, or just showing off a successful deploy. Only three types are supported: text, image, and video.
Endpoint Details
- Base URL:
https://api-zawa.azickri.com - Headers:
id,session-id, andContent-Type: application/json - Requires: a connected session (
isConnected: true)
Headers
| Header | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The id from Create Session. |
session-id | string | Yes | The sessionId from Create Session. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Status type: text, image, or video. |
text | string | For text | The status text. For image and video it becomes the caption (optional). |
image | object | For image | url and mimetype are required, thumbnail is optional. Same as in Send Message. |
video | object | For video | url, mimetype, and duration are required, thumbnail is optional. Same as in Send Message. |
A few things Zawa does for you automatically:
- Text statuses use a dark green background.
- Images are compressed to suit statuses.
- If a video has no
thumbnail, one is generated from the video itself.
Who Can See It?
Recipients follow the status privacy setting on your phone (WhatsApp → Updates → ⋮ → Status privacy):
| Status privacy | Recipients |
|---|---|
| My contacts | Everyone in your synced address book. |
| My contacts except… | Everyone in your synced address book, minus the excluded ones. |
| Only share with… | Only the contacts on that list. |
The first two options need your phone's address book synced to Zawa. That normally happens automatically after you scan the QR code. If you get a contacts not synced error, reset the session and scan again, or switch to Only share with….
WhatsApp's rules still apply
Statuses are only visible to people who have also saved your number in their contacts.
Example Request
bash
curl -X POST "https://api-zawa.azickri.com/status" \
-H "id: YOUR_ID" \
-H "session-id: YOUR_SESSION_ID" \
-H "Content-Type: application/json" \
-d '{"type":"text","text":"Deployed today without a hitch 🚀"}'javascript
import axios from 'axios';
const response = await axios.post(
'https://api-zawa.azickri.com/status',
{
type: 'text',
text: 'Deployed today without a hitch 🚀',
},
{
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
},
},
);
console.log(response.data);javascript
const response = await fetch('https://api-zawa.azickri.com/status', {
method: 'POST',
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'text',
text: 'Deployed today without a hitch 🚀',
}),
});
const data = await response.json();
console.log(data);Body Examples by Type
json
{
"type": "text",
"text": "Deployed today without a hitch 🚀"
}json
{
"type": "image",
"text": "Today's special",
"image": {
"url": "https://example.com/image.jpg",
"mimetype": "image/jpeg"
}
}json
{
"type": "video",
"text": "Behind the scenes",
"video": {
"url": "https://example.com/video.mp4",
"mimetype": "video/mp4",
"duration": 15
}
}Response
json
{
"statusId": "3EB0C4A8F1D2B3E4A5F6"
}json
// A required field for that type is missing
{
"statusCode": 400,
"message": "text should not be empty"
}
// Missing headers
{
"statusCode": 400,
"message": "invalid header"
}json
{
"statusCode": 404,
"message": "session not found"
}json
// Address book not synced yet
{
"statusCode": 500,
"message": "contacts not synced, reconnect the session or set status privacy to \"only share with\""
}
// "Only share with…" privacy, but the list is empty
{
"statusCode": 500,
"message": "status privacy \"only share with\" has no contacts"
}| Field | Type | Description |
|---|---|---|
statusId | string | The status ID from WhatsApp. |