WhatsApp Gateway
API referenceSessions

Log out a session (unpair the device)

POST
/api/v1/sessions/{session}:logout

Unlink the device and clear the attached WhatsApp number.

To delete session metadata, call DELETE /sessions/{session}.

Response is refreshed session row; repeated calls are idempotent when already logged out.

Errors: not_found (404), unauthorized (401), forbidden (403).

Authorization

AuthorizationBearer <token>

Send Authorization: Bearer <token>. The token can be a login JWT from the frontend or an api-key for a script. JWT access comes from the person's organization role. Api-key access comes from the permissions saved on the key.

In: header

Path Parameters

session*string

Session ID within your organization. Unknown or cross-organization sessions return not_found (404).

Example"sess_01HZX8K3M9"

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/sessions/sess_01HZX8K3M9:logout"
{  "autoRead": false,  "createdAt": 1719662400000,  "createdByUserId": "user_01J9DEF...",  "gatewayId": "gw-sg-1",  "id": "01J9ZX8K2QHV0M3T6R7P4N5W8C",  "isAdminSession": false,  "label": "Support line",  "lastConnectedAt": 1719662400000,  "organizationId": "org_01J9ABC...",  "phoneNumber": "6281234567890",  "presenceTyping": true,  "ratePerHour": 600,  "ratePerMin": 20,  "status": "working",  "updatedAt": 1719662400000,  "waJid": "6281234567890@s.whatsapp.net",  "waLid": "205227043110953@lid"}
{  "error": {    "code": "not_found",    "details": {      "property1": null,      "property2": null    },    "message": "session not found"  }}