Leave a group
Removes the session's **own** account from the group. **Capability:** requires `send`. **Precondition (live action):** the session must be **connected**. If it is not the gateway responds **501 `not_implemented`**. **Success:** **204 No Content**. After leaving, this session can no longer act on the group; reading still works only on whatever stored data remains. **Errors:** - **404 `not_found`** — the session or group does not exist (or is not yours). - **501 `not_implemented`** — the session is not connected.
Send Authorization: Bearer <token>. The router accepts two kinds of token and tries each in turn: a frontend-minted login JWT (verified against the frontend JWKS; the person's org + role are read from it), or an api-key for a script/service (carrying a fixed set of gateway permissions). The bearerFormat: JWT label describes the person-login case.
In: header
Path Parameters
The WhatsApp session id whose account will leave the group; must be connected for this live action.
The group's JID, ending in @g.us. Percent-encode the @ as %40 in the URL path.
Response Body
application/json
curl -X POST "https://example.com/api/v1/sessions/01HZ0SESSION0000000000000/groups/120363041234567890@g.us:leave"{ "error": { "code": "not_found", "details": { "property1": null, "property2": null }, "message": "session not found" }}Approve pending join requests (not implemented in v2) POST
**Not implemented in v2.** Approving people waiting to join a group is not part of v2's live WhatsApp surface, so this endpoint **always responds 501 `not_implemented`** regardless of the request body. The route and `participants` body shape are reserved for a future release. **Capability:** requires `send` (checked before the 501 is returned).
Join a group by invite POST
Joins the group named by the **invite** code (the code from a WhatsApp group invite link) and returns the joined group's JID in the shape `{ "groupJid": "...@g.us" }`. **Capability:** requires `send`. **Precondition (live action):** the session must be **connected**. If it is not the gateway responds **501 `not_implemented`**. **Success:** **200 OK** with the group's JID. Use that JID with the other group endpoints (e.g. `getGroup`, `listGroupMembers`). Joining a group the account already belongs to still returns the group's JID. **Errors:** - **400 `validation_error`** — missing or unparseable invite code/link, or the invite is invalid/expired. - **404 `not_found`** — no session with this id is owned by your organization. - **501 `not_implemented`** — the session is not connected.