curl --request POST \
--url https://api.wppfy.com/labels/refresh \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '{
"force": false
}'import requests
url = "https://api.wppfy.com/labels/refresh"
payload = { "force": False }
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({force: false})
};
fetch('https://api.wppfy.com/labels/refresh', 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://api.wppfy.com/labels/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'force' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$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://api.wppfy.com/labels/refresh"
payload := strings.NewReader("{\n \"force\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
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.post("https://api.wppfy.com/labels/refresh")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/labels/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"request_id": "3f1c9b52-8d4e-4a7b-9c61-2f0e5d7a1b84",
"status": "started",
"message": "Label refresh started. Use GET /labels to fetch the refreshed list.",
"force": false,
"fullSync": false
}{
"error": "history sync still in progress, try again in a moment"
}{
"error": "failed to reload labels from WhatsApp"
}Start WhatsApp label refresh
Starts a new read of the labels on WhatsApp without blocking the request.
The response only confirms that the refresh was started or that a refresh is already in progress.
To get the updated list, query GET /labels afterwards.
The refresh also updates the associations between labels and chats. When
there are changes, the chat_labels webhook may report the updated data.
The response includes a request_id, repeated in the history webhooks (labels and chat_labels) of that refresh. If a refresh is already in progress, the request_id is that one’s.
Recommended usage:
- try first with
force=false - if that does not bring the labels correctly, try
force=true - use
force=trueonly as a correction attempt, because it performs a heavier refresh
curl --request POST \
--url https://api.wppfy.com/labels/refresh \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '{
"force": false
}'import requests
url = "https://api.wppfy.com/labels/refresh"
payload = { "force": False }
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({force: false})
};
fetch('https://api.wppfy.com/labels/refresh', 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://api.wppfy.com/labels/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'force' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$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://api.wppfy.com/labels/refresh"
payload := strings.NewReader("{\n \"force\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
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.post("https://api.wppfy.com/labels/refresh")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/labels/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"request_id": "3f1c9b52-8d4e-4a7b-9c61-2f0e5d7a1b84",
"status": "started",
"message": "Label refresh started. Use GET /labels to fetch the refreshed list.",
"force": false,
"fullSync": false
}{
"error": "history sync still in progress, try again in a moment"
}{
"error": "failed to reload labels from WhatsApp"
}Authorizations
Body
Try false first.
Use true only when the default reload does not work well,
as this mode performs a new, more complete read of the labels.
false
Response
Label reload accepted for background processing
true
Identifies this reload in the labels and chat_labels webhooks. Uses the X-Request-ID header when sent.
"3f1c9b52-8d4e-4a7b-9c61-2f0e5d7a1b84"
started, in_progress "started"
"Label refresh started. Use GET /labels to fetch the refreshed list."
false
false
