Numbers

The console calls these Numbers. The API calls them instance. Same thing, and the mismatch is deliberate: developers know the word instance, and business owners know they are managing a phone number.

Add one

curl -X POST https://njiwa.upeo.ai/v1/instances \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"label": "Invoices", "msisdn": "254700111222"}'

Link it

Three methods. Start one with POST /v1/instances/{id}/link and a strategy, then poll GET /v1/instances/{id}/link.

qrA QR code to scan. Fastest when the phone is in front of you.
pairing_codeAn 8 character code typed into the phone. Use this when the phone is somewhere else and you are on a call.
assistedFor accounts WhatsApp will not link to a server on their own. A person produces a signed assertion in a real browser and pastes it back.
If QR linking keeps failing. WhatsApp can require a passkey signature when a new device is linked, which a headless server cannot produce. That shows up as the connection closing repeatedly during linking. Use the assisted flow.

Status

createdAdded but never linked.
linkingA link is in progress.
connectedLive and able to send.
disconnectedDropped. Njiwa reconnects on its own with backoff.
logged_outRemoved from WhatsApp on the phone. Link it again.
bannedBlocked by WhatsApp. It cannot be recovered.

When a number drops

Njiwa reconnects automatically with exponential backoff, and sends queued in the meantime go out when it returns. If it stays down, POST /v1/instances/{id}/reconnect. If it is logged_out, someone removed the device on the phone and it has to be linked again.

Check numbers are on WhatsApp

curl -X POST https://njiwa.upeo.ai/v1/instances/{id}/check-numbers \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"numbers": ["254712345678", "254733000111"]}'