Sessions

Sessions

Create, status, linking, and stop.

These paths belong to the account key and to this account's sessions.

Session list

GET /instances
scope: sessions.read

Create a session

POST /instances
scope: sessions.create

{"display_name": "Sales"}

Session status

GET /instances/{instance_id}
scope: sessions.read

With the typing permission the response includes typing_enabled and typing_seconds. With the gap permission it includes send_gap_enabled and send_gap_seconds.

Session control

POST /instances/{instance_id}/start     sessions.start
POST /instances/{instance_id}/stop      sessions.stop
POST /instances/{instance_id}/restart   sessions.restart
POST /instances/{instance_id}/logout    sessions.logout

Stop pauses the session only. Logout unlinks WhatsApp and keeps the session.

Link QR

GET /instances/{instance_id}/qr
scope: sessions.qr

HTTP 200  image
HTTP 409  QR_NOT_READY

The image is returned while the session is waiting for a scan. A linked session returns 409 until logout is called.

Session settings and restrictions

PATCH /instances/{instance_id}/typing
scope: sessions.typing
{"enabled": true, "seconds": 3}

PATCH /instances/{instance_id}/send-gap
scope: sessions.send_gap
{"enabled": true, "seconds": 5}

GET /instances/{instance_id}/restrictions
scope: sessions.restrictions

Delete the session

DELETE /instances/{instance_id}
scope: sessions.delete

Session key

GET  /instances/{instance_id}/api-key
scope: sessions.api_key.read
→ { "api_key": "tp_ins_…" }

POST /instances/{instance_id}/api-key/rotate
scope: sessions.api_key.rotate

Showing the session key returns the full secret. Rotate issues a new tp_ins_… and stops the old one immediately.