curl --request PUT \
--url https://api.nuvia.ai/v1/custom-fields/{id}/value \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"field_data": "<string>",
"conversationId": "<string>"
}
'import requests
url = "https://api.nuvia.ai/v1/custom-fields/{id}/value"
payload = {
"field_data": "<string>",
"conversationId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({field_data: '<string>', conversationId: '<string>'})
};
fetch('https://api.nuvia.ai/v1/custom-fields/{id}/value', 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.nuvia.ai/v1/custom-fields/{id}/value",
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([
'field_data' => '<string>',
'conversationId' => '<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.nuvia.ai/v1/custom-fields/{id}/value"
payload := strings.NewReader("{\n \"field_data\": \"<string>\",\n \"conversationId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.nuvia.ai/v1/custom-fields/{id}/value")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"field_data\": \"<string>\",\n \"conversationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nuvia.ai/v1/custom-fields/{id}/value")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"field_data\": \"<string>\",\n \"conversationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAtualizar valor de um campo customizado
Atualiza o valor de um campo customizado específico em uma conversa. Dependendo do contexto do campo (conversation, contact ou business), atualiza na conversa, no contato ou na empresa do contato — o contato e a empresa são resolvidos a partir da conversa informada, por isso conversationId é obrigatório mesmo para campo de contato. Aceita todos os tipos: text, number e date recebem o valor direto; select/multi_select recebem o option_id (ou a lista deles), que sai de GET /v1/custom-fields/{id}/options. Valor inválido devolve 422 com accepted_values. Campo ou conversa de outra empresa devolve 403/404.
curl --request PUT \
--url https://api.nuvia.ai/v1/custom-fields/{id}/value \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"field_data": "<string>",
"conversationId": "<string>"
}
'import requests
url = "https://api.nuvia.ai/v1/custom-fields/{id}/value"
payload = {
"field_data": "<string>",
"conversationId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({field_data: '<string>', conversationId: '<string>'})
};
fetch('https://api.nuvia.ai/v1/custom-fields/{id}/value', 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.nuvia.ai/v1/custom-fields/{id}/value",
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([
'field_data' => '<string>',
'conversationId' => '<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.nuvia.ai/v1/custom-fields/{id}/value"
payload := strings.NewReader("{\n \"field_data\": \"<string>\",\n \"conversationId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.nuvia.ai/v1/custom-fields/{id}/value")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"field_data\": \"<string>\",\n \"conversationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nuvia.ai/v1/custom-fields/{id}/value")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"field_data\": \"<string>\",\n \"conversationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAutorizações
Token JWT de autenticação
Parâmetros de caminho
ID do campo customizado que será atualizado
Corpo
Valor do campo. text, number e date recebem o valor direto; select recebe o option_id; multi_select recebe a lista de option_id. null limpa o campo.
ID da conversa. Também identifica o contato e a empresa do contato, para campos desses contextos.
1Resposta
Valor do campo customizado atualizado com sucesso