curl --request PUT \
--url https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"enabled": true,
"start_now": true
}
'import requests
url = "https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync"
payload = {
"enabled": True,
"start_now": True
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true, start_now: true})
};
fetch('https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync', 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.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'start_now' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync"
payload := strings.NewReader("{\n \"enabled\": true,\n \"start_now\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"start_now\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"start_now\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"configured": true,
"settings": {
"enabled": true,
"period_days": 123,
"contact_scope": "<string>",
"new_contact_type": "<string>",
"name_strategy": "<string>"
},
"latest": {
"id": 123,
"channel_id": 123,
"trigger": "initial",
"status": "pending",
"since": "2023-11-07T05:31:56Z",
"pass": 123,
"progress_percent": 123,
"provider_total": 123,
"processed": 123,
"imported": 123,
"skipped": {
"unknown_contact": 123,
"deleted_contact": 123,
"lid_unresolved": 123,
"group": 123,
"failed": 123
},
"settings": {
"enabled": true,
"period_days": 123,
"contact_scope": "<string>",
"new_contact_type": "<string>",
"name_strategy": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Update a WhatsApp channel's history sync settings
With start_now, a connected line starts syncing right away: its first sync when it never
synced, otherwise a fresh copy of the chosen period that skips what is already stored.
curl --request PUT \
--url https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"enabled": true,
"start_now": true
}
'import requests
url = "https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync"
payload = {
"enabled": True,
"start_now": True
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true, start_now: true})
};
fetch('https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync', 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.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'start_now' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync"
payload := strings.NewReader("{\n \"enabled\": true,\n \"start_now\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"start_now\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"start_now\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"configured": true,
"settings": {
"enabled": true,
"period_days": 123,
"contact_scope": "<string>",
"new_contact_type": "<string>",
"name_strategy": "<string>"
},
"latest": {
"id": 123,
"channel_id": 123,
"trigger": "initial",
"status": "pending",
"since": "2023-11-07T05:31:56Z",
"pass": 123,
"progress_percent": 123,
"provider_total": 123,
"processed": 123,
"imported": 123,
"skipped": {
"unknown_contact": 123,
"deleted_contact": 123,
"lid_unresolved": 123,
"group": 123,
"failed": 123
},
"settings": {
"enabled": true,
"period_days": 123,
"contact_scope": "<string>",
"new_contact_type": "<string>",
"name_strategy": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Yetkilendirmeler
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Yol Parametreleri
The channel identifier
Gövde
Whether the line copies its WhatsApp history when it is paired and the gap it missed whenever it comes back.
How many days of history the first sync copies. WhatsApp hands a linked device at most about a year.
30, 90, 365 known copies only numbers the clinic already has (a patient, a lead or an earlier conversation on the line); all copies every chat.
known Only numbers the clinic already knows: a patient, a lead or an earlier conversation on the line. |
all Every chat; numbers the clinic does not know become a new patient or lead. |
known, all What an unknown number becomes when contact_scope is all. A lead falls back to a patient when the clinic has no active pipeline.
patient |
lead A lead at the entry stage of the active pipeline; a patient when the clinic has no active pipeline. |
patient, lead fill_blank fills only blank names of known contacts from their WhatsApp profile; keep leaves existing records untouched.
keep Leave the existing record exactly as it is. |
fill_blank Fill only the name fields that are blank; a name the clinic typed is never overwritten. |
keep, fill_blank Start syncing right away when the line is connected, instead of waiting for its next connection.