Skip to main content
GET
/
user
/
get
/
direct-login-url
Get Direct Login URL
curl --request GET \
  --url https://platform.chatsyncs.com/api/v1/user/get/direct-login-url
import requests

url = "https://platform.chatsyncs.com/api/v1/user/get/direct-login-url"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://platform.chatsyncs.com/api/v1/user/get/direct-login-url', 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/user/get/direct-login-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

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

curl_close($curl);

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

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

func main() {

url := "https://platform.chatsyncs.com/api/v1/user/get/direct-login-url"

req, _ := http.NewRequest("GET", url, nil)

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://platform.chatsyncs.com/api/v1/user/get/direct-login-url")
.asString();
require 'uri'
require 'net/http'

url = URI("https://platform.chatsyncs.com/api/v1/user/get/direct-login-url")

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

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "status": "1",
  "message": {
    "email": "user@domain.com",
    "password": "xxxxxxxxxx",
    "login_url": "https://platform.chatsyncs.com/login",
    "direct_login_url": "https://platform.chatsyncs.com/direct-login/xxxxxxxxxx"
  }
}
Generates a unique, secure one-time login URL for a ChatSyncs end-user account — useful for single sign-on from your own platform into ChatSyncs. This is “get-or-create”: if the email already exists under your agent, it just returns a login link for that account; if it doesn’t exist yet, it creates it first (when you pass create_on_fail=1, package_id, and expired_date).
Where to find package_id (only needed when creating a new user): open Control Panel → User Permission — it’s the Package ID column. See Finding Your IDs & API Token for a screenshot.

What happens for each kind of email

SituationResult
Email doesn’t exist anywhere yetCreates it (needs create_on_fail=1 + package_id + expired_date), returns a login link
Email already exists, under your own agentReturns a login link for that existing account — no error
Email already exists, under a different agent{"status":"0","message":"User is already registered under another agent."}
Your own agent/owner emailSame error as above — your account isn’t a sub-user created via this API, so this endpoint can never generate a link for it
This endpoint is only for end-user accounts your agent manages — never for your own agent login. Confirmed by testing: a brand-new email works cleanly and returns a real login link. Your own ChatSyncs login email will always fail with "User is already registered under another agent." — that’s expected, not a bug. To log into your own account, just use your normal password at platform.chatsyncs.com; this API has no use for that.

Get Direct Login URL vs. New Users Only

Get Direct Login URLGet Direct Login URL (New Users Only)
Email is newCreates the account, returns a login linkCreates the account, returns a login link
Email already exists (under your agent)Returns a login link — no errorFails — "User already existed"
Use it forAny normal “log in” button — works for new and returning customersSign-up forms only — guarantees you never log into an existing account by mistake

Query Parameters

apiToken
string
required

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

Example:

"API-KEY"

email
string
required

The user's email.

Example:

"user@example.com"

name
string

The user's name.

mobile
string

The user's phone number.

package_id
integer

The package ID to assign. Required when creating a new user. Where to find it.

expired_date
string

Package expiry date, e.g. 2026-05-05. Required when creating a new user.

status
string

User status — active (1) or inactive (0).

create_on_fail
string

Set to 1 to create a new user if none is found, or 0 to return a 'User not found' error.

Response

200 - application/json

On success, message is an object with email, password, login_url, and direct_login_url — not a plain string.

status
string

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

message
any

On success: an object with email, password, login_url, direct_login_url. On failure: a plain error string.