curl --request POST \
--url https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect \
--header 'Authorization: Bearer <token>' \
--header 'X-TL-Partner-Id: <x-tl-partner-id>'import requests
url = "https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect"
headers = {
"X-TL-Partner-Id": "<x-tl-partner-id>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-TL-Partner-Id': '<x-tl-partner-id>', Authorization: 'Bearer <token>'}
};
fetch('https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect', 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://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-TL-Partner-Id: <x-tl-partner-id>"
],
]);
$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://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-TL-Partner-Id", "<x-tl-partner-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect")
.header("X-TL-Partner-Id", "<x-tl-partner-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TL-Partner-Id"] = '<x-tl-partner-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"workspace_id": "<string>",
"user_id": 123,
"disconnected": true,
"disconnected_at": "2024-01-01T12:00:00Z",
"whatsapp_account_id": 123,
"phone_number": "<string>",
"description": "<string>"
}{
"error": "<string>",
"status": 123,
"description": "<string>"
}Disconnect WhatsApp account
Forcibly disconnects the WhatsApp account currently linked to a specific user. If the user has an active WhatsApp connection, the session is terminated, sync is stopped and credentials are revoked. The response includes identifiers of the disconnected WhatsApp account and phone number together with a disconnected=true flag and the disconnection timestamp. If the user has no active WhatsApp account, the operation is treated as an idempotent no-op and returns disconnected=false. The call is still subject to standard partner authentication and workspace ownership checks.
curl --request POST \
--url https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect \
--header 'Authorization: Bearer <token>' \
--header 'X-TL-Partner-Id: <x-tl-partner-id>'import requests
url = "https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect"
headers = {
"X-TL-Partner-Id": "<x-tl-partner-id>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-TL-Partner-Id': '<x-tl-partner-id>', Authorization: 'Bearer <token>'}
};
fetch('https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect', 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://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-TL-Partner-Id: <x-tl-partner-id>"
],
]);
$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://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-TL-Partner-Id", "<x-tl-partner-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect")
.header("X-TL-Partner-Id", "<x-tl-partner-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TL-Partner-Id"] = '<x-tl-partner-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"workspace_id": "<string>",
"user_id": 123,
"disconnected": true,
"disconnected_at": "2024-01-01T12:00:00Z",
"whatsapp_account_id": 123,
"phone_number": "<string>",
"description": "<string>"
}{
"error": "<string>",
"status": 123,
"description": "<string>"
}Authorizations
Path Parameters
Response
WhatsApp disconnected
Response payload for a WhatsApp disconnect operation. Indicates whether a WhatsApp account was actually disconnected for the given user, provides the disconnection timestamp, and, when applicable, echoes the workspace_id, user_id, whatsapp_account_id and phone_number involved in the operation.

