English
English
Appearance
English
English
Appearance
/public/account/whatsapp/connectLink the WhatsApp number that scanned the QR code to your workspace. Call it once Get Session WhatsApp reports isConnected: true.
Authorization: Basic Base64(AccessKey:SecretKey))| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Session token returned by Create Session WhatsApp. |
curl -X POST "https://api.repliz.com/public/account/whatsapp/connect" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{"token":"SESSION_TOKEN"}'import axios from 'axios';
const response = await axios.post(
'https://api.repliz.com/public/account/whatsapp/connect',
{
token: 'SESSION_TOKEN',
},
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.data);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch(
'https://api.repliz.com/public/account/whatsapp/connect',
{
method: 'POST',
headers: {
Authorization: `Basic ${credentials}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: 'SESSION_TOKEN',
}),
},
);
const data = await response.json();
console.log(data);{
"accountId": "69e97477a795504e0786cec6"
}{
"code": 402,
"message": "please upgrade plan to connect more account"
}{
"code": 403,
"message": "invalid status session"
}{
"code": 404,
"message": "session not found"
}{
"code": 401,
"message": "unauthorized"
}One WhatsApp number becomes one account, with the number's WhatsApp ID (for example 6281292713426@s.whatsapp.net) as its generatedId. Connecting a number that is already in your workspace updates that account instead of adding a duplicate.
The WhatsApp Channels the number owns and the groups it has joined are not separate accounts. Schedules for this account go to the number's Status unless you pick a Channel or group per post: list them with Get WhatsApp Channel and pass one as additionalInfo.channel in Create Schedule.
402 means your workspace has reached its plan's account limit.403 invalid status session means the QR code has not been scanned yet. Keep polling Get Session WhatsApp until isConnected is true.404 session not found means the session expired. Create a new session and have the user scan again.