API
Cancelar envelope
Cancela um envelope, impedindo assinaturas adicionais. Dispara webhook CANCELLED.
POST
/
v1
/
envelopes
/
:uuid
/
cancel
Cancelar envelope
curl --request POST \
--url https://api.valid.com/v1/envelopes/:uuid/cancel \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.valid.com/v1/envelopes/:uuid/cancel"
payload = { "reason": "<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({reason: '<string>'})
};
fetch('https://api.valid.com/v1/envelopes/:uuid/cancel', 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/cancel",
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([
'reason' => '<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/envelopes/:uuid/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\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/envelopes/:uuid/cancel")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/v1/envelopes/:uuid/cancel")
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 \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyHTTP/1.1 200 OK
Content-Type: application/json
{
"envelopeUuid": "550e8400-e29b-41d4-a716-446655440000",
"state": "CANCELLED",
"finishedAt": "2025-07-27T16:00:00.000Z"
}
HTTP/1.1 409 Conflict
Content-Type: application/json
{
"statusCode": 409,
"message": "Cannot cancel envelope in FINISHED state"
}
Cancela um envelope, movendo-o para o estado
CANCELLED. Signatários não conseguirão mais acessar ou assinar. Um webhook CANCELLED é disparado (se configurado).
Parâmetros
string
required
UUID do envelope a cancelar.
string
Motivo do cancelamento (opcional).
Respostas
string
UUID do envelope.
string
Novo estado:
CANCELLED.string
Timestamp do cancelamento (ISO 8601).
Erros
Veja Autenticação e erros.- 401: API key inválido.
- 404: Envelope não encontrado.
- 409: Envelope já está em estado terminal (finalizado, cancelado, expirado, recusado).
HTTP/1.1 200 OK
Content-Type: application/json
{
"envelopeUuid": "550e8400-e29b-41d4-a716-446655440000",
"state": "CANCELLED",
"finishedAt": "2025-07-27T16:00:00.000Z"
}
HTTP/1.1 409 Conflict
Content-Type: application/json
{
"statusCode": 409,
"message": "Cannot cancel envelope in FINISHED state"
}
Exemplo
curl -X POST "https://signer.vcc-service.com/v1/envelopes/550e8400-e29b-41d4-a716-446655440000/cancel" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Documento foi revisado e precisa ser refeito"
}'
Relacionado
GET /v1/envelopes/:uuid— verificar estado do envelope- Notificações via webhook — entender webhooks
CANCELLED
⌘I
Cancelar envelope
curl --request POST \
--url https://api.valid.com/v1/envelopes/:uuid/cancel \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.valid.com/v1/envelopes/:uuid/cancel"
payload = { "reason": "<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({reason: '<string>'})
};
fetch('https://api.valid.com/v1/envelopes/:uuid/cancel', 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/cancel",
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([
'reason' => '<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/envelopes/:uuid/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\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/envelopes/:uuid/cancel")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/v1/envelopes/:uuid/cancel")
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 \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyHTTP/1.1 200 OK
Content-Type: application/json
{
"envelopeUuid": "550e8400-e29b-41d4-a716-446655440000",
"state": "CANCELLED",
"finishedAt": "2025-07-27T16:00:00.000Z"
}
HTTP/1.1 409 Conflict
Content-Type: application/json
{
"statusCode": 409,
"message": "Cannot cancel envelope in FINISHED state"
}