WATZAP API
A clean, predictable REST API to send messages, manage WhatsApp sessions and receive signed webhooks. One header authenticates every call.
Quickstart
Every request carries your API key in the X-Api-Key header and a JSON body.
curl -X POST https://watzap.claritypulse.store/api/sendText \
-H "X-Api-Key: wz_live_..." \
-H "Content-Type: application/json" \
-d '{
"session": "sales-1",
"chatId": "[email protected]",
"text": "Hi! Thanks for reaching out."
}'
chatId is a WhatsApp JID — a phone number in international format followed by @c.us for individuals or @g.us for groups.
Authentication
Create API keys from your dashboard. Each key is shown once and carries scopes that gate what it can do:
Send messages and typing indicators.
Read sessions, leads and message data.
Create, update, connect and delete sessions.
Endpoints
All paths are relative to https://watzap.claritypulse.store.
| Method | Path | Scope | Description |
|---|---|---|---|
| POST | /api/sendText | send | Send a text message. |
| POST | /api/sendImage | send | Send an image (URL or base64). |
| POST | /api/sendFile | send | Send a file/document. |
| POST | /api/sendVideo | send | Send a video. |
| POST | /api/sendVoice | send | Send a voice note. |
| POST | /api/sendSeen | send | Mark messages as read. |
| POST | /api/startTyping | send | Show a typing indicator. |
| POST | /api/stopTyping | send | Clear the typing indicator. |
| GET | /api/contacts | read | List contacts (paged, sortable). |
| GET | /api/contacts/check-exists | read | Check if a number is on WhatsApp. |
| GET | /api/contacts/:contactId | read | Get one contact. |
| PUT | /api/contacts/:contactId | control | Rename a contact on your phone. |
| GET | /api/contacts/:contactId/about | read | Get a contact's about text. |
| GET | /api/contacts/:contactId/profile-picture | read | Get a profile picture URL. |
| POST | /api/contacts/:contactId/block | control | Block a contact. |
| POST | /api/contacts/:contactId/unblock | control | Unblock a contact. |
| GET | /api/lids | read | List known @lid ↔ number mappings. |
| GET | /api/lids/count | read | Count known LID mappings. |
| GET | /api/lids/pn/:phoneNumber | read | Resolve the LID for a number. |
| GET | /api/lids/:lid | read | Resolve the number for a LID. |
| GET | /api/sessions | read | List your sessions. |
| POST | /api/sessions | control | Create and connect a session. |
| GET | /api/sessions/:name | read | Get one session. |
| PUT | /api/sessions/:name | control | Update a session. |
| DELETE | /api/sessions/:name | control | Delete a session. |
| POST | /api/sessions/:name/logout | control | Log the number out. |
| GET | /api/sessions/:name/qr | read | Fetch the pairing QR (image). |
| GET | /api/sessions/:name/screenshot | read | Screenshot the session. |
| POST | /api/sessions/:name/pairing-code | control | Request a pairing code. |
| POST | /api/sessions/:name/automation | control | Toggle automation on a session. |
Sending a message
Messages go out through a humanized pipeline — typing indicators and natural pauses — so conversations feel genuine. Pass the session by its alias; the number is resolved server-side and never trusted from the request.
{
"status": "ok",
"message": { "id": "[email protected]_3EB0..." }
}
Contacts & LIDs
Look up and manage the contacts on a connected number. Every call is scoped to the
caller — pass the target session as session (its id or
upstream name) and only your own numbers resolve.
Contacts
GET /api/contactsList contacts, paginated with limit, offset, sortBy and sortOrder.
GET /api/contacts/:contactIdFetch one contact by phone number or chat id.
GET /api/contacts/check-existsCheck whether a phone number is registered on WhatsApp (?phone=).
PUT /api/contacts/:contactIdUpdate the address-book name (firstName, lastName).
GET /api/contacts/:contactId/aboutRead the contact's about/status text.
GET /api/contacts/:contactId/profile-pictureGet the profile picture URL (?refresh=true to bypass the 24h cache).
POST /api/contacts/:contactId/blockBlock a contact.
POST /api/contacts/:contactId/unblockUnblock a contact.
curl "https://watzap.claritypulse.store/api/contacts/check-exists?session=SESSION_ID&phone=2348012345678" \
-H "X-Api-Key: wz_live_..."
curl "https://watzap.claritypulse.store/api/contacts?session=SESSION_ID&limit=100&sortBy=name&sortOrder=asc" \
-H "X-Api-Key: wz_live_..."
LIDs
WhatsApp masks phone numbers behind a LID (@lid)
in groups and privacy contexts. Use these endpoints to map in both directions.
| Method | Path | Description |
|---|---|---|
| GET | /api/lids | List known @lid ↔ number mappings. |
| GET | /api/lids/count | Count the known mappings. |
| GET | /api/lids/pn/:phoneNumber | Get the LID for a phone number. |
| GET | /api/lids/:lid | Get the phone number for a LID. |
NOWEB engine,
contacts and LIDs require the store to be enabled when the session is created
(config.noweb.store.enabled=true). check-exists
and profile-picture work regardless; about
is not implemented on NOWEB.
Webhooks
Register HTTPS endpoints to receive events. Every delivery is signed so you can verify authenticity, and failures are retried with backoff.
messageInbound and outbound message activity.
session.statusA number connects, fails or changes state.
subscriptionRenewal, past-due and expiry events.
paymentWallet top-ups and confirmations.
X-Watzap-Signature: t=1699999999,v1=hex_hmac_sha256(body)
Errors
Non-2xx responses return a consistent JSON shape with a machine-readable code.
{
"error": {
"code": "missing_text",
"message": "`text` is required",
"statusCode": 400
}
}
| 400 | Malformed request or missing field. |
| 401 | Missing or invalid API key. |
| 403 | The key lacks the required scope. |
| 404 | The resource does not exist. |
| 429 | Rate limit exceeded — back off and retry. |