| Token | Header | Used for |
|---|---|---|
| Session token | token | Normal session API calls for one WhatsApp account. |
| Admin token | admintoken | Creating, listing, deleting, and verifying tokens. |
admintoken:
Session token
A session token maps one API consumer to one WaGo session row. The token is also how WaGo finds the connected WhatsApp client in memory. Send it as a header:?token=..., but production clients should use the header. Headers are easier to protect in logs and reverse proxies.
Admin token
The admin token is for deployment owners. Keep it server-side. Do not put it in browser code. Admin operations include:POST /session/initGET /session/allPOST /session/deletePOST /session/scannedPOST /server/licenseGET /server/update
Browser apps
If you build a web app on top of WaGo, do not expose admin features to regular users. The usual browser flow is:- Your backend authenticates your user.
- Your backend decides which WaGo
tokenbelongs to that user. - Your backend calls WaGo, or your frontend calls WaGo only with a limited session token.
- Admin token stays only on your infrastructure.
Common authentication errors
| Error | Meaning | Fix |
|---|---|---|
invalid token | WaGo cannot find a matching session token. | Check the exact token header. |
No session | Token exists but no WhatsApp client is connected in memory. | Call POST /session/connect. |
not logged in | The session is not scanned or WhatsApp logged out. | Fetch /session/qr and scan again. |
invalid admin token | admintoken does not match the configured admin token. | Use the deployment admin token only from trusted backend code. |

