curl --request PATCH \
--url https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"question": "<string>",
"section": "<string>",
"required": true,
"options": [
"<string>"
]
}
'import requests
url = "https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition"
payload = {
"label": "<string>",
"question": "<string>",
"section": "<string>",
"required": True,
"options": ["<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({
label: '<string>',
question: '<string>',
section: '<string>',
required: true,
options: ['<string>']
})
};
fetch('https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition', 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.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition",
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([
'label' => '<string>',
'question' => '<string>',
'section' => '<string>',
'required' => true,
'options' => [
'<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.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"question\": \"<string>\",\n \"section\": \"<string>\",\n \"required\": true,\n \"options\": [\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.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"question\": \"<string>\",\n \"section\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition")
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 \"label\": \"<string>\",\n \"question\": \"<string>\",\n \"section\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"field": {
"id": "<string>",
"key": "<string>",
"section": "<string>",
"position": 123,
"label": "<string>",
"question": "<string>",
"type": "freeText",
"type_config": {},
"bindings": [
"context"
],
"required": true,
"locked": true,
"fill_mode": "interview",
"value": "<string>",
"default_value": "<string>",
"status": "default",
"provenance": {
"filled_via": "<string>",
"filled_by_user_id": "<string>",
"filled_by_name": "<string>",
"filled_at": "<string>",
"filled_by_email": null,
"source_capture_id": "<string>",
"source_file_name": null
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Update Config Field Definition
Edit a Policy question: its label, question, section, whether it is required, and the options of a select field. A reworded question gets a new version, and a new section moves the field to that section’s end. The type of a field added through the API can change while it has no answer; a field from the module template keeps its type. The answer is never changed, and a module template reinstall keeps the edit.
curl --request PATCH \
--url https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"question": "<string>",
"section": "<string>",
"required": true,
"options": [
"<string>"
]
}
'import requests
url = "https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition"
payload = {
"label": "<string>",
"question": "<string>",
"section": "<string>",
"required": True,
"options": ["<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({
label: '<string>',
question: '<string>',
section: '<string>',
required: true,
options: ['<string>']
})
};
fetch('https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition', 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.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition",
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([
'label' => '<string>',
'question' => '<string>',
'section' => '<string>',
'required' => true,
'options' => [
'<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.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"question\": \"<string>\",\n \"section\": \"<string>\",\n \"required\": true,\n \"options\": [\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.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"question\": \"<string>\",\n \"section\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duvo.ai/v2/automations/{automation_id}/config-fields/{field_id}/definition")
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 \"label\": \"<string>\",\n \"question\": \"<string>\",\n \"section\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"field": {
"id": "<string>",
"key": "<string>",
"section": "<string>",
"position": 123,
"label": "<string>",
"question": "<string>",
"type": "freeText",
"type_config": {},
"bindings": [
"context"
],
"required": true,
"locked": true,
"fill_mode": "interview",
"value": "<string>",
"default_value": "<string>",
"status": "default",
"provenance": {
"filled_via": "<string>",
"filled_by_user_id": "<string>",
"filled_by_name": "<string>",
"filled_at": "<string>",
"filled_by_email": null,
"source_capture_id": "<string>",
"source_file_name": null
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
API key authentication. Get your API key from the Duvo dashboard.
Path Parameters
The automation's unique identifier
The config field's unique identifier
Body
Short name for the field, shown as its row heading
1 - 200New question; a reworded question gets a new version
1 - 2000Section to move the field to the end of, or null for none
1 - 200Whether the field must be filled
Select and multiSelect fields only; replaces the whole list
1 - 100 elements1 - 200New value type, only for a field added through the API that has no answer yet
freeText, identifier, number, select, multiSelect, list, orderedList, personList Response
Default Response
Show child attributes
Show child attributes
Was this page helpful?