Skip to main content
POST
/
whatsapp
/
account
/
connect
Account Connect
curl --request POST \
  --url https://platform.chatsyncs.com/api/v1/whatsapp/account/connect \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data apiToken=API-KEY \
  --data user_id=123 \
  --data whatsapp_business_account_id=WHATSAPP-BUSINESS-ACCOUNT-ID \
  --data access_token=ACCESS-TOKEN
import requests

url = "https://platform.chatsyncs.com/api/v1/whatsapp/account/connect"

payload = {
    "apiToken": "API-KEY",
    "user_id": "123",
    "whatsapp_business_account_id": "WHATSAPP-BUSINESS-ACCOUNT-ID",
    "access_token": "ACCESS-TOKEN"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams({
    apiToken: 'API-KEY',
    user_id: '123',
    whatsapp_business_account_id: 'WHATSAPP-BUSINESS-ACCOUNT-ID',
    access_token: 'ACCESS-TOKEN'
  })
};

fetch('https://platform.chatsyncs.com/api/v1/whatsapp/account/connect', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://platform.chatsyncs.com/api/v1/whatsapp/account/connect",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "apiToken=API-KEY&user_id=123&whatsapp_business_account_id=WHATSAPP-BUSINESS-ACCOUNT-ID&access_token=ACCESS-TOKEN",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://platform.chatsyncs.com/api/v1/whatsapp/account/connect"

	payload := strings.NewReader("apiToken=API-KEY&user_id=123&whatsapp_business_account_id=WHATSAPP-BUSINESS-ACCOUNT-ID&access_token=ACCESS-TOKEN")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://platform.chatsyncs.com/api/v1/whatsapp/account/connect")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .body("apiToken=API-KEY&user_id=123&whatsapp_business_account_id=WHATSAPP-BUSINESS-ACCOUNT-ID&access_token=ACCESS-TOKEN")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://platform.chatsyncs.com/api/v1/whatsapp/account/connect")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "apiToken=API-KEY&user_id=123&whatsapp_business_account_id=WHATSAPP-BUSINESS-ACCOUNT-ID&access_token=ACCESS-TOKEN"

response = http.request(request)
puts response.read_body
{ "status": "1", "message": "Success." }
Connects a WhatsApp Business Account (WABA) to ChatSyncs programmatically — a POST request since it creates/updates a connection, and because access_token is sensitive and shouldn’t be sent as a GET query parameter.
Where to find user_id: call Get My Info first — copy the user_id value from its response and use that here.
Where to find whatsapp_business_account_id and access_token: for a first-time connection, both come from Meta, not ChatSyncs — see Meta Developer Account Setup. If the WABA is already connected, whatsapp_business_account_id is also shown right on the same WhatsApp → Connect Account card as phone_number_id — see Finding Your IDs & API Token for a screenshot.

Body

application/x-www-form-urlencoded
apiToken
string
required

Your ChatSyncs API key (not a WhatsApp/Meta access token). Where to find it.

Example:

"API-KEY"

user_id
integer
required

The ChatSyncs user ID of the account owner. Get this from Get My Info.

Example:

123

whatsapp_business_account_id
string
required

The WhatsApp Business Account ID from Meta. Where to find it.

Example:

"WHATSAPP-BUSINESS-ACCOUNT-ID"

access_token
string
required

A Meta access token for the WhatsApp Business Account. See Meta Developer Account Setup.

Example:

"ACCESS-TOKEN"

Response

200 - application/json

Standard ChatSyncs response. status is "1" on success and "0" on failure.

status
string

"1" = success, "0" = failure.

message
string

Human-readable result message.