Update an Account AI field
curl --request PATCH \
--url https://api.monaco.com/v1/ai-account-fields/{field_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"confirm_option_removal": false,
"overwrite_existing_values": true
}
'import requests
url = "https://api.monaco.com/v1/ai-account-fields/{field_id}"
payload = {
"name": "<string>",
"question": "<string>",
"options": ["<string>"],
"confirm_option_removal": False,
"overwrite_existing_values": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
question: '<string>',
options: ['<string>'],
confirm_option_removal: false,
overwrite_existing_values: true
})
};
fetch('https://api.monaco.com/v1/ai-account-fields/{field_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://api.monaco.com/v1/ai-account-fields/{field_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([
'name' => '<string>',
'question' => '<string>',
'options' => [
'<string>'
],
'confirm_option_removal' => false,
'overwrite_existing_values' => true
]),
CURLOPT_HTTPHEADER => [
"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.monaco.com/v1/ai-account-fields/{field_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"confirm_option_removal\": false,\n \"overwrite_existing_values\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.monaco.com/v1/ai-account-fields/{field_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"confirm_option_removal\": false,\n \"overwrite_existing_values\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/ai-account-fields/{field_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"confirm_option_removal\": false,\n \"overwrite_existing_values\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"question": "<string>",
"field_type": "<string>",
"entity_type": "account",
"data_source": "ai_external_web_search",
"overwrite_existing_values": true,
"options": [
"<string>"
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}AI Account Fields
Update an Account AI field
Change an Account AI field’s name, question, select options or whether research replaces existing answers. The type cannot change. The next research run, such as the next Preview that qualifies on this field, asks the new question; answers already stored are not re-researched by this call. Fields that are not Account web-research fields return 422.
PATCH
/
v1
/
ai-account-fields
/
{field_id}
Update an Account AI field
curl --request PATCH \
--url https://api.monaco.com/v1/ai-account-fields/{field_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"confirm_option_removal": false,
"overwrite_existing_values": true
}
'import requests
url = "https://api.monaco.com/v1/ai-account-fields/{field_id}"
payload = {
"name": "<string>",
"question": "<string>",
"options": ["<string>"],
"confirm_option_removal": False,
"overwrite_existing_values": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
question: '<string>',
options: ['<string>'],
confirm_option_removal: false,
overwrite_existing_values: true
})
};
fetch('https://api.monaco.com/v1/ai-account-fields/{field_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://api.monaco.com/v1/ai-account-fields/{field_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([
'name' => '<string>',
'question' => '<string>',
'options' => [
'<string>'
],
'confirm_option_removal' => false,
'overwrite_existing_values' => true
]),
CURLOPT_HTTPHEADER => [
"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.monaco.com/v1/ai-account-fields/{field_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"confirm_option_removal\": false,\n \"overwrite_existing_values\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.monaco.com/v1/ai-account-fields/{field_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"confirm_option_removal\": false,\n \"overwrite_existing_values\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/ai-account-fields/{field_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"confirm_option_removal\": false,\n \"overwrite_existing_values\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"question": "<string>",
"field_type": "<string>",
"entity_type": "account",
"data_source": "ai_external_web_search",
"overwrite_existing_values": true,
"options": [
"<string>"
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}Path Parameters
Body
application/json
Required string length:
1 - 255The new research question. The next research run uses it.
Required string length:
1 - 12000Select fields only: the complete new option list.
Send true only after the user approved removing options that Accounts already hold; without it such a change returns 409 and changes nothing.