Atualizar número (privacidade + settings)
Atualização PARCIAL do número: só o que vier no corpo muda. Não existe POST /v1/numbers/{id}/settings — configuração de número é este PATCH, e o syncFullHistory da Evolution API não tem equivalente aqui (use settings.historyImportEnabled).
piiMode controla a retenção das conversas e é obrigatório acompanhar piiRetentionDays (1–3650) quando for STORE_X_DAYS.
O bloco settings tem dois grupos. historyImportEnabled, webhookHistoricalMessages e ignoreNewsletters valem para qualquer provider — o último descarta publicação de Canal (@newsletter) na entrada, antes da conversa, da mensagem guardada e do webhook. Os outros seis são os advancedSettings do Evolution GO e só se aplicam a número não-oficial (conectado por QR) — em número Meta eles são aceitos e guardados, mas nunca aplicados, e a resposta avisa isso em settings.appliesTo.advanced: "none". Mandar null num campo do GO volta ao default do provider; não é false.
Os campos do GO também são empurrados para as instâncias conectadas do número; o resultado vem em settingsSync. O push é best-effort: instância fora do ar não faz o PATCH falhar, e o valor persistido é reaplicado no próximo provisionamento.
Corpo sem nenhum campo reconhecido é 400 EMPTY_PATCH — não é no-op silencioso.
curl --request PATCH \
--url https://pilotstatus.com.br/v1/numbers/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"piiMode": "STORE_X_DAYS",
"piiRetentionDays": 30,
"settings": {
"historyImportEnabled": false,
"webhookHistoricalMessages": false,
"ignoreNewsletters": false,
"alwaysOnline": false,
"rejectCall": true,
"msgRejectCall": "I don't take calls here",
"readMessages": false,
"ignoreGroups": false,
"ignoreStatus": false
}
}
EOFimport requests
url = "https://pilotstatus.com.br/v1/numbers/{id}"
payload = {
"piiMode": "STORE_X_DAYS",
"piiRetentionDays": 30,
"settings": {
"historyImportEnabled": False,
"webhookHistoricalMessages": False,
"ignoreNewsletters": False,
"alwaysOnline": False,
"rejectCall": True,
"msgRejectCall": "I don't take calls here",
"readMessages": False,
"ignoreGroups": False,
"ignoreStatus": False
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
piiMode: 'STORE_X_DAYS',
piiRetentionDays: 30,
settings: {
historyImportEnabled: false,
webhookHistoricalMessages: false,
ignoreNewsletters: false,
alwaysOnline: false,
rejectCall: true,
msgRejectCall: 'I don\'t take calls here',
readMessages: false,
ignoreGroups: false,
ignoreStatus: false
}
})
};
fetch('https://pilotstatus.com.br/v1/numbers/{id}', 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://pilotstatus.com.br/v1/numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'piiMode' => 'STORE_X_DAYS',
'piiRetentionDays' => 30,
'settings' => [
'historyImportEnabled' => false,
'webhookHistoricalMessages' => false,
'ignoreNewsletters' => false,
'alwaysOnline' => false,
'rejectCall' => true,
'msgRejectCall' => 'I don\'t take calls here',
'readMessages' => false,
'ignoreGroups' => false,
'ignoreStatus' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://pilotstatus.com.br/v1/numbers/{id}"
payload := strings.NewReader("{\n \"piiMode\": \"STORE_X_DAYS\",\n \"piiRetentionDays\": 30,\n \"settings\": {\n \"historyImportEnabled\": false,\n \"webhookHistoricalMessages\": false,\n \"ignoreNewsletters\": false,\n \"alwaysOnline\": false,\n \"rejectCall\": true,\n \"msgRejectCall\": \"I don't take calls here\",\n \"readMessages\": false,\n \"ignoreGroups\": false,\n \"ignoreStatus\": false\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<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.patch("https://pilotstatus.com.br/v1/numbers/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"piiMode\": \"STORE_X_DAYS\",\n \"piiRetentionDays\": 30,\n \"settings\": {\n \"historyImportEnabled\": false,\n \"webhookHistoricalMessages\": false,\n \"ignoreNewsletters\": false,\n \"alwaysOnline\": false,\n \"rejectCall\": true,\n \"msgRejectCall\": \"I don't take calls here\",\n \"readMessages\": false,\n \"ignoreGroups\": false,\n \"ignoreStatus\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"piiMode\": \"STORE_X_DAYS\",\n \"piiRetentionDays\": 30,\n \"settings\": {\n \"historyImportEnabled\": false,\n \"webhookHistoricalMessages\": false,\n \"ignoreNewsletters\": false,\n \"alwaysOnline\": false,\n \"rejectCall\": true,\n \"msgRejectCall\": \"I don't take calls here\",\n \"readMessages\": false,\n \"ignoreGroups\": false,\n \"ignoreStatus\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "num_01HZX...",
"number": "+5511999999999",
"name": "Atendimento",
"provider": "WEB",
"state": "OPEN",
"isFullyConnected": true,
"piiMode": "STORE_X_DAYS",
"piiRetentionDays": 30,
"settings": {
"historyImportEnabled": false,
"webhookHistoricalMessages": false,
"ignoreNewsletters": false,
"alwaysOnline": null,
"rejectCall": true,
"msgRejectCall": "I don't take calls here",
"readMessages": null,
"ignoreGroups": null,
"ignoreStatus": null,
"appliesTo": {
"history": "all",
"advanced": "evolution-go"
}
},
"settingsSync": {
"applied": 1,
"failed": 0,
"skipped": 0
},
"health": {
"qualityRating": null,
"messagingLimitTier": null,
"metaStatus": null,
"code": null,
"reason": null,
"sendable": true
},
"meta": null
}Autorizações
Sua chave de API ps_
Parâmetros de caminho
WhatsApp number id.
Corpo
Conversation retention policy. Optional — omit it to change only settings.
STORE_INDEFINITE, STORE_X_DAYS, RELAY_ONLY "STORE_X_DAYS"
Required (1–3650) when piiMode is STORE_X_DAYS; forced to null otherwise.
1 <= x <= 365030
Per-number settings. Partial: only the keys you send change.
Show child attributes
Show child attributes
Resposta
Updated number
Esta página foi útil?
curl --request PATCH \
--url https://pilotstatus.com.br/v1/numbers/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"piiMode": "STORE_X_DAYS",
"piiRetentionDays": 30,
"settings": {
"historyImportEnabled": false,
"webhookHistoricalMessages": false,
"ignoreNewsletters": false,
"alwaysOnline": false,
"rejectCall": true,
"msgRejectCall": "I don't take calls here",
"readMessages": false,
"ignoreGroups": false,
"ignoreStatus": false
}
}
EOFimport requests
url = "https://pilotstatus.com.br/v1/numbers/{id}"
payload = {
"piiMode": "STORE_X_DAYS",
"piiRetentionDays": 30,
"settings": {
"historyImportEnabled": False,
"webhookHistoricalMessages": False,
"ignoreNewsletters": False,
"alwaysOnline": False,
"rejectCall": True,
"msgRejectCall": "I don't take calls here",
"readMessages": False,
"ignoreGroups": False,
"ignoreStatus": False
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
piiMode: 'STORE_X_DAYS',
piiRetentionDays: 30,
settings: {
historyImportEnabled: false,
webhookHistoricalMessages: false,
ignoreNewsletters: false,
alwaysOnline: false,
rejectCall: true,
msgRejectCall: 'I don\'t take calls here',
readMessages: false,
ignoreGroups: false,
ignoreStatus: false
}
})
};
fetch('https://pilotstatus.com.br/v1/numbers/{id}', 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://pilotstatus.com.br/v1/numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'piiMode' => 'STORE_X_DAYS',
'piiRetentionDays' => 30,
'settings' => [
'historyImportEnabled' => false,
'webhookHistoricalMessages' => false,
'ignoreNewsletters' => false,
'alwaysOnline' => false,
'rejectCall' => true,
'msgRejectCall' => 'I don\'t take calls here',
'readMessages' => false,
'ignoreGroups' => false,
'ignoreStatus' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://pilotstatus.com.br/v1/numbers/{id}"
payload := strings.NewReader("{\n \"piiMode\": \"STORE_X_DAYS\",\n \"piiRetentionDays\": 30,\n \"settings\": {\n \"historyImportEnabled\": false,\n \"webhookHistoricalMessages\": false,\n \"ignoreNewsletters\": false,\n \"alwaysOnline\": false,\n \"rejectCall\": true,\n \"msgRejectCall\": \"I don't take calls here\",\n \"readMessages\": false,\n \"ignoreGroups\": false,\n \"ignoreStatus\": false\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<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.patch("https://pilotstatus.com.br/v1/numbers/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"piiMode\": \"STORE_X_DAYS\",\n \"piiRetentionDays\": 30,\n \"settings\": {\n \"historyImportEnabled\": false,\n \"webhookHistoricalMessages\": false,\n \"ignoreNewsletters\": false,\n \"alwaysOnline\": false,\n \"rejectCall\": true,\n \"msgRejectCall\": \"I don't take calls here\",\n \"readMessages\": false,\n \"ignoreGroups\": false,\n \"ignoreStatus\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"piiMode\": \"STORE_X_DAYS\",\n \"piiRetentionDays\": 30,\n \"settings\": {\n \"historyImportEnabled\": false,\n \"webhookHistoricalMessages\": false,\n \"ignoreNewsletters\": false,\n \"alwaysOnline\": false,\n \"rejectCall\": true,\n \"msgRejectCall\": \"I don't take calls here\",\n \"readMessages\": false,\n \"ignoreGroups\": false,\n \"ignoreStatus\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "num_01HZX...",
"number": "+5511999999999",
"name": "Atendimento",
"provider": "WEB",
"state": "OPEN",
"isFullyConnected": true,
"piiMode": "STORE_X_DAYS",
"piiRetentionDays": 30,
"settings": {
"historyImportEnabled": false,
"webhookHistoricalMessages": false,
"ignoreNewsletters": false,
"alwaysOnline": null,
"rejectCall": true,
"msgRejectCall": "I don't take calls here",
"readMessages": null,
"ignoreGroups": null,
"ignoreStatus": null,
"appliesTo": {
"history": "all",
"advanced": "evolution-go"
}
},
"settingsSync": {
"applied": 1,
"failed": 0,
"skipped": 0
},
"health": {
"qualityRating": null,
"messagingLimitTier": null,
"metaStatus": null,
"code": null,
"reason": null,
"sendable": true
},
"meta": null
}