Update Meta agent settings
Change any of the settings; omitted fields keep their value. Answering everyone needs a payment method in Meta Billing Hub; test mode (ALLOWLISTED_ONLY) does not.
curl --request PATCH \
--url https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"handoff": {
"enabled": true,
"message": "<string>"
},
"followup": {
"enabled": true,
"followup_interval_in_seconds": 0,
"message": "<string>"
},
"never_say_phrases": [
"<string>"
]
}
'import requests
url = "https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings"
payload = {
"handoff": {
"enabled": True,
"message": "<string>"
},
"followup": {
"enabled": True,
"followup_interval_in_seconds": 0,
"message": "<string>"
},
"never_say_phrases": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
handoff: {enabled: true, message: '<string>'},
followup: {enabled: true, followup_interval_in_seconds: 0, message: '<string>'},
never_say_phrases: ['<string>']
})
};
fetch('https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings', 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.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings",
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([
'handoff' => [
'enabled' => true,
'message' => '<string>'
],
'followup' => [
'enabled' => true,
'followup_interval_in_seconds' => 0,
'message' => '<string>'
],
'never_say_phrases' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings"
payload := strings.NewReader("{\n \"handoff\": {\n \"enabled\": true,\n \"message\": \"<string>\"\n },\n \"followup\": {\n \"enabled\": true,\n \"followup_interval_in_seconds\": 0,\n \"message\": \"<string>\"\n },\n \"never_say_phrases\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"handoff\": {\n \"enabled\": true,\n \"message\": \"<string>\"\n },\n \"followup\": {\n \"enabled\": true,\n \"followup_interval_in_seconds\": 0,\n \"message\": \"<string>\"\n },\n \"never_say_phrases\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"handoff\": {\n \"enabled\": true,\n \"message\": \"<string>\"\n },\n \"followup\": {\n \"enabled\": true,\n \"followup_interval_in_seconds\": 0,\n \"message\": \"<string>\"\n },\n \"never_say_phrases\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"channel": "<string>",
"rollout": {
"enabled": true
},
"handoff": {
"enabled": true,
"message": "<string>",
"message_selection": "DEFAULT"
},
"followup": {
"enabled": true,
"followup_interval_in_seconds": 0,
"message": "<string>"
},
"ai_audience": "EVERYONE",
"never_say_phrases": [
"<string>"
]
}Authorizations
Bearer token authentication using your API key
Path Parameters
The ID of the org
The ID of the connection
The ID of the WhatsApp phone number the Meta agent runs on
Query Parameters
The agent settings to read or change. Defaults to the most recent ones.
128Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Who the agent answers. ALLOWLISTED_ONLY is test mode: only the allowlisted numbers get replies.
EVERYONE, ALLOWLISTED_ONLY Replaces the whole list: an answer containing one of these phrases is withheld. An empty list clears it.
200256Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Who the agent answers. ALLOWLISTED_ONLY is test mode: only the allowlisted numbers get replies.
EVERYONE, ALLOWLISTED_ONLY Was this page helpful?
curl --request PATCH \
--url https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"handoff": {
"enabled": true,
"message": "<string>"
},
"followup": {
"enabled": true,
"followup_interval_in_seconds": 0,
"message": "<string>"
},
"never_say_phrases": [
"<string>"
]
}
'import requests
url = "https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings"
payload = {
"handoff": {
"enabled": True,
"message": "<string>"
},
"followup": {
"enabled": True,
"followup_interval_in_seconds": 0,
"message": "<string>"
},
"never_say_phrases": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
handoff: {enabled: true, message: '<string>'},
followup: {enabled: true, followup_interval_in_seconds: 0, message: '<string>'},
never_say_phrases: ['<string>']
})
};
fetch('https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings', 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.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings",
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([
'handoff' => [
'enabled' => true,
'message' => '<string>'
],
'followup' => [
'enabled' => true,
'followup_interval_in_seconds' => 0,
'message' => '<string>'
],
'never_say_phrases' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings"
payload := strings.NewReader("{\n \"handoff\": {\n \"enabled\": true,\n \"message\": \"<string>\"\n },\n \"followup\": {\n \"enabled\": true,\n \"followup_interval_in_seconds\": 0,\n \"message\": \"<string>\"\n },\n \"never_say_phrases\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"handoff\": {\n \"enabled\": true,\n \"message\": \"<string>\"\n },\n \"followup\": {\n \"enabled\": true,\n \"followup_interval_in_seconds\": 0,\n \"message\": \"<string>\"\n },\n \"never_say_phrases\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/orgs/{org_id}/connections/{connection_id}/whatsapp/phone-numbers/{phone_number_id}/meta-agent/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"handoff\": {\n \"enabled\": true,\n \"message\": \"<string>\"\n },\n \"followup\": {\n \"enabled\": true,\n \"followup_interval_in_seconds\": 0,\n \"message\": \"<string>\"\n },\n \"never_say_phrases\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"channel": "<string>",
"rollout": {
"enabled": true
},
"handoff": {
"enabled": true,
"message": "<string>",
"message_selection": "DEFAULT"
},
"followup": {
"enabled": true,
"followup_interval_in_seconds": 0,
"message": "<string>"
},
"ai_audience": "EVERYONE",
"never_say_phrases": [
"<string>"
]
}