Skip to main content
Use this guide to connect an existing WaGo token and scan a WhatsApp device. This is the normal first flow for a customer deployment where the WaGo owner has already created or assigned a token.
This guide assumes the token already exists in WaGo. If you need to provision one first, see Create a token.

Prerequisites

  • A running WaGo server.
  • A valid WaGo session token.
  • A browser or HTTP client that can reach the WaGo API.
  • WhatsApp installed on the phone you want to link.
  • HTTPS if you are testing browser microphone or production webapp flows.

Connect and scan

1

Check the token

curl -H "token: YOUR_TOKEN" \
  http://localhost:1337/session/status
If the server returns No session, connect the token in the next step.
2

Connect the session

curl -X POST http://localhost:1337/session/connect \
  -H "Content-Type: application/json" \
  -H "token: YOUR_TOKEN" \
  -d '{
    "Subscribe": ["All"],
    "Immediate": true,
    "Phone": ""
  }'
3

Fetch the QR code

curl -H "token: YOUR_TOKEN" \
  http://localhost:1337/session/qr
The response contains a QRCode data URL. Render it as an image in your app.
4

Scan with WhatsApp

Open WhatsApp on the phone, go to linked devices, and scan the QR code.
5

Confirm the session

curl -H "token: YOUR_TOKEN" \
  http://localhost:1337/session/status
A scanned and connected session returns:
{
  "Connected": true,
  "LoggedIn": true
}

Next step

After the token is connected and scanned, send a message:
curl -X POST http://localhost:1337/send/text \
  -H "Content-Type: application/json" \
  -H "token: YOUR_TOKEN" \
  -d '{
    "Phone": "15551234567",
    "Body": "Hello from WaGo"
  }'
Then continue with messages, webhooks, or call control.