API
Editar campos do envelope
Operador/admin preenche ou edita valores de campos dinâmicos (apenas antes da primeira assinatura).
PATCH
/
v1
/
envelopes
/
:uuid
/
fields
Editar campos do envelope
curl --request PATCH \
--url https://api.valid.com/v1/envelopes/:uuid/fields \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"values": [
{
"key": "<string>",
"fieldUuid": "<string>",
"value": [
"<string>"
],
"editable": true
}
]
}
'import requests
url = "https://api.valid.com/v1/envelopes/:uuid/fields"
payload = { "values": [
{
"key": "<string>",
"fieldUuid": "<string>",
"value": ["<string>"],
"editable": True
}
] }
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({
values: [{key: '<string>', fieldUuid: '<string>', value: ['<string>'], editable: true}]
})
};
fetch('https://api.valid.com/v1/envelopes/:uuid/fields', 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.valid.com/v1/envelopes/:uuid/fields",
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([
'values' => [
[
'key' => '<string>',
'fieldUuid' => '<string>',
'value' => [
'<string>'
],
'editable' => true
]
]
]),
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://api.valid.com/v1/envelopes/:uuid/fields"
payload := strings.NewReader("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"fieldUuid\": \"<string>\",\n \"value\": [\n \"<string>\"\n ],\n \"editable\": true\n }\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://api.valid.com/v1/envelopes/:uuid/fields")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"fieldUuid\": \"<string>\",\n \"value\": [\n \"<string>\"\n ],\n \"editable\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/v1/envelopes/:uuid/fields")
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 \"values\": [\n {\n \"key\": \"<string>\",\n \"fieldUuid\": \"<string>\",\n \"value\": [\n \"<string>\"\n ],\n \"editable\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyHTTP/1.1 200 OK
Content-Type: application/json
{
"fields": [
{
"key": "nome_cliente",
"fieldUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"type": "text",
"label": "Nome do Cliente",
"value": "Empresa Nova Ltda.",
"origin": "operator",
"status": "filled",
"displayState": "filled_by_operator",
"editableBySigner": false
}
]
}
HTTP/1.1 409 Conflict
Content-Type: application/json
{
"statusCode": 409,
"message": "Cannot edit fields after first signature"
}
Permite que um operador/admin preencha ou edite valores de campos dinâmicos de um envelope, desde que nenhuma assinatura tenha ocorrido ainda. Após o primeiro signatário assinar, os campos congelam.
Parâmetros
string
required
UUID do envelope.
array
required
Lista de campos a atualizar.
Show Propriedades de values[]
Show Propriedades de values[]
string
Identificador do campo (ex:
"nome_cliente"). Use key ou fieldUuid, não ambos.string
UUID interno do campo. Use
key ou fieldUuid, não ambos.string | string[] | boolean
required
Novo valor. Para
checkbox, array de valores selecionados. Para booleanos, true/false. Para date, formato ISO 8601 (YYYY-MM-DD).boolean
Se o signatário pode editar este campo depois (padrão:
false, campo fica bloqueado).Respostas
Retorna a lista atualizada de campos (mesmo shape deGET .../fields).
array
Campos atualizados com novos estados.
Erros
Veja Autenticação e erros.- 400: Campo desconhecido, valor inválido, ou envelope sem template.
- 401: API key inválido.
- 404: Envelope não encontrado.
- 409: Envelope já assinado (congelado) — não pode editar campos.
HTTP/1.1 200 OK
Content-Type: application/json
{
"fields": [
{
"key": "nome_cliente",
"fieldUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"type": "text",
"label": "Nome do Cliente",
"value": "Empresa Nova Ltda.",
"origin": "operator",
"status": "filled",
"displayState": "filled_by_operator",
"editableBySigner": false
}
]
}
HTTP/1.1 409 Conflict
Content-Type: application/json
{
"statusCode": 409,
"message": "Cannot edit fields after first signature"
}
Exemplo
curl -X PATCH "https://signer.vcc-service.com/v1/envelopes/550e8400-e29b-41d4-a716-446655440000/fields" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": [
{
"key": "nome_cliente",
"value": "Empresa XYZ Ltda.",
"editable": false
},
{
"key": "data_assinatura",
"value": "2025-12-31",
"editable": true
}
]
}'
Relacionado
GET /v1/envelopes/:uuid/fields— listar camposPATCH /v1/sign/:sessionToken/fields— signatário preenche campos
⌘I
Editar campos do envelope
curl --request PATCH \
--url https://api.valid.com/v1/envelopes/:uuid/fields \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"values": [
{
"key": "<string>",
"fieldUuid": "<string>",
"value": [
"<string>"
],
"editable": true
}
]
}
'import requests
url = "https://api.valid.com/v1/envelopes/:uuid/fields"
payload = { "values": [
{
"key": "<string>",
"fieldUuid": "<string>",
"value": ["<string>"],
"editable": True
}
] }
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({
values: [{key: '<string>', fieldUuid: '<string>', value: ['<string>'], editable: true}]
})
};
fetch('https://api.valid.com/v1/envelopes/:uuid/fields', 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.valid.com/v1/envelopes/:uuid/fields",
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([
'values' => [
[
'key' => '<string>',
'fieldUuid' => '<string>',
'value' => [
'<string>'
],
'editable' => true
]
]
]),
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://api.valid.com/v1/envelopes/:uuid/fields"
payload := strings.NewReader("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"fieldUuid\": \"<string>\",\n \"value\": [\n \"<string>\"\n ],\n \"editable\": true\n }\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://api.valid.com/v1/envelopes/:uuid/fields")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"fieldUuid\": \"<string>\",\n \"value\": [\n \"<string>\"\n ],\n \"editable\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/v1/envelopes/:uuid/fields")
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 \"values\": [\n {\n \"key\": \"<string>\",\n \"fieldUuid\": \"<string>\",\n \"value\": [\n \"<string>\"\n ],\n \"editable\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyHTTP/1.1 200 OK
Content-Type: application/json
{
"fields": [
{
"key": "nome_cliente",
"fieldUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"type": "text",
"label": "Nome do Cliente",
"value": "Empresa Nova Ltda.",
"origin": "operator",
"status": "filled",
"displayState": "filled_by_operator",
"editableBySigner": false
}
]
}
HTTP/1.1 409 Conflict
Content-Type: application/json
{
"statusCode": 409,
"message": "Cannot edit fields after first signature"
}