API
Pré-visualizar template preenchido
Renderiza o template com valores preenchidos e retorna um PDF sem criar um envelope.
POST
/
v1
/
templates
/
:uuid
/
fill
Pré-visualizar template preenchido
curl --request POST \
--url https://api.valid.com/v1/templates/:uuid/fill \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"values": {},
"fieldValues": [
{
"key": "<string>",
"value": [
"<string>"
]
}
]
}
'import requests
url = "https://api.valid.com/v1/templates/:uuid/fill"
payload = {
"values": {},
"fieldValues": [
{
"key": "<string>",
"value": ["<string>"]
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({values: {}, fieldValues: [{key: '<string>', value: ['<string>']}]})
};
fetch('https://api.valid.com/v1/templates/:uuid/fill', 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/templates/:uuid/fill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'values' => [
],
'fieldValues' => [
[
'key' => '<string>',
'value' => [
'<string>'
]
]
]
]),
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/templates/:uuid/fill"
payload := strings.NewReader("{\n \"values\": {},\n \"fieldValues\": [\n {\n \"key\": \"<string>\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.valid.com/v1/templates/:uuid/fill")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"values\": {},\n \"fieldValues\": [\n {\n \"key\": \"<string>\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/v1/templates/:uuid/fill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"values\": {},\n \"fieldValues\": [\n {\n \"key\": \"<string>\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyHTTP/1.1 200 OK
Content-Type: application/json
{
"fileUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"filename": "contrato-preenchido.pdf",
"downloadUrl": "https://storage.googleapis.com/bucket/fill-550e8400.pdf?X-Goog-Algorithm=...",
"downloadUrlExpiresAt": "2025-07-27T11:00:00.000Z"
}
Preenche um template com valores e retorna uma URL para download do PDF resultante sem criar um envelope. Útil para pré-visualizar ou para exportar um documento preenchido como standalone.
Parâmetros
string
required
UUID do template.
object
Atalho para pré-preencher campos:
{ key: value }.array
Respostas
string
UUID do arquivo gerado.
string
Nome do arquivo.
string
URL assinada para download do PDF preenchido. Válida por 15 minutos.
string
Timestamp de expiração.
Erros
Veja Autenticação e erros.- 400: Campo desconhecido ou valor inválido.
- 401: API key inválido.
- 404: Template não encontrado.
HTTP/1.1 200 OK
Content-Type: application/json
{
"fileUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"filename": "contrato-preenchido.pdf",
"downloadUrl": "https://storage.googleapis.com/bucket/fill-550e8400.pdf?X-Goog-Algorithm=...",
"downloadUrlExpiresAt": "2025-07-27T11:00:00.000Z"
}
Exemplo
curl -X POST "https://signer.vcc-service.com/v1/templates/550e8400-e29b-41d4-a716-446655440000/fill" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": {
"nome_cliente": "ACME Inc.",
"data_criacao": "2025-07-27"
}
}'
Casos de uso
- Pré-visualizar antes de criar envelope: veja como ficará o PDF antes de enviar para assinatura.
- Exportar documento preenchido: gere um PDF com valores preenchidos mas sem assinatura (para arquivos ou impressão).
- Testes/validação: verifique que os campos foram posicionados e preenchidos corretamente.
Relacionado
POST /v1/templates/:uuid/envelopes— criar envelope (versão que permite assinatura)GET /v1/templates/:uuid— obter template
⌘I
Pré-visualizar template preenchido
curl --request POST \
--url https://api.valid.com/v1/templates/:uuid/fill \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"values": {},
"fieldValues": [
{
"key": "<string>",
"value": [
"<string>"
]
}
]
}
'import requests
url = "https://api.valid.com/v1/templates/:uuid/fill"
payload = {
"values": {},
"fieldValues": [
{
"key": "<string>",
"value": ["<string>"]
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({values: {}, fieldValues: [{key: '<string>', value: ['<string>']}]})
};
fetch('https://api.valid.com/v1/templates/:uuid/fill', 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/templates/:uuid/fill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'values' => [
],
'fieldValues' => [
[
'key' => '<string>',
'value' => [
'<string>'
]
]
]
]),
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/templates/:uuid/fill"
payload := strings.NewReader("{\n \"values\": {},\n \"fieldValues\": [\n {\n \"key\": \"<string>\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.valid.com/v1/templates/:uuid/fill")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"values\": {},\n \"fieldValues\": [\n {\n \"key\": \"<string>\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/v1/templates/:uuid/fill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"values\": {},\n \"fieldValues\": [\n {\n \"key\": \"<string>\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyHTTP/1.1 200 OK
Content-Type: application/json
{
"fileUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"filename": "contrato-preenchido.pdf",
"downloadUrl": "https://storage.googleapis.com/bucket/fill-550e8400.pdf?X-Goog-Algorithm=...",
"downloadUrlExpiresAt": "2025-07-27T11:00:00.000Z"
}