Developer docs

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.

Send your first message cURL
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

Send messages and typing indicators.

read

Read sessions, leads and message data.

control

Create, update, connect and delete sessions.

Keys are bearer secrets — keep them server-side and rotate if exposed.

Endpoints

All paths are relative to https://watzap.claritypulse.store.

Method Path Scope
POST /api/sendText Send a text message.
POST /api/sendImage Send an image (URL or base64).
POST /api/sendFile Send a file/document.
POST /api/sendVideo Send a video.
POST /api/sendVoice Send a voice note.
POST /api/sendSeen Mark messages as read.
POST /api/startTyping Show a typing indicator.
POST /api/stopTyping Clear the typing indicator.
GET /api/contacts List contacts (paged, sortable).
GET /api/contacts/check-exists Check if a number is on WhatsApp.
GET /api/contacts/:contactId Get one contact.
PUT /api/contacts/:contactId Rename a contact on your phone.
GET /api/contacts/:contactId/about Get a contact's about text.
GET /api/contacts/:contactId/profile-picture Get a profile picture URL.
POST /api/contacts/:contactId/block Block a contact.
POST /api/contacts/:contactId/unblock Unblock a contact.
GET /api/lids List known @lid ↔ number mappings.
GET /api/lids/count Count known LID mappings.
GET /api/lids/pn/:phoneNumber Resolve the LID for a number.
GET /api/lids/:lid Resolve the number for a LID.
GET /api/sessions List your sessions.
POST /api/sessions Create and connect a session.
GET /api/sessions/:name Get one session.
PUT /api/sessions/:name Update a session.
DELETE /api/sessions/:name Delete a session.
POST /api/sessions/:name/logout Log the number out.
GET /api/sessions/:name/qr Fetch the pairing QR (image).
GET /api/sessions/:name/screenshot Screenshot the session.
POST /api/sessions/:name/pairing-code Request a pairing code.
POST /api/sessions/:name/automation 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.

JSON response
{
  "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/contacts

List contacts, paginated with limit, offset, sortBy and sortOrder.

GET /api/contacts/:contactId

Fetch one contact by phone number or chat id.

GET /api/contacts/check-exists

Check whether a phone number is registered on WhatsApp (?phone=).

PUT /api/contacts/:contactId

Update the address-book name (firstName, lastName).

GET /api/contacts/:contactId/about

Read the contact's about/status text.

GET /api/contacts/:contactId/profile-picture

Get the profile picture URL (?refresh=true to bypass the 24h cache).

POST /api/contacts/:contactId/block

Block a contact.

POST /api/contacts/:contactId/unblock

Unblock a contact.

Check a number, then list contacts cURL
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.

MethodPath
GET/api/lids
GET/api/lids/count
GET/api/lids/pn/:phoneNumber
GET/api/lids/:lid
Engine note: on the 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.

message

Inbound and outbound message activity.

session.status

A number connects, fails or changes state.

subscription

Renewal, past-due and expiry events.

payment

Wallet top-ups and confirmations.

Signature header
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
  }
}
400Malformed request or missing field.
401Missing or invalid API key.
403The key lacks the required scope.
404The resource does not exist.
429Rate limit exceeded — back off and retry.