admintoken in browser code.
When to create a token
Create a token when:- A new customer, workspace, team, or device needs its own WhatsApp connection.
- You are provisioning sessions before showing a QR code in your app.
- You deleted a session with
/session/deleteand need to recreate it.
POST /session/connect to restore the session.
Request
Fields
| Field | Required | Meaning |
|---|---|---|
Name | Yes | A human-readable name for the local WaGo user/session row. Keep it unique. |
Token | Yes | The session token your app will use in the token header. Spaces are removed before storage. |
Os | Yes | A label for the client environment, such as linux, chrome, server, or your product name. |
Response
Successful creation returns a normal WaGo success envelope. Thedata value contains the created user details:
Duplicate tokens
If theName or Token already exists, WaGo returns an error similar to:
GET /session/all from a trusted admin backend.
Next step
After creating the token, connect it:/session/qr and show the QR code to the user. See Connect and scan for the full flow.
