> ## Documentation Index
> Fetch the complete documentation index at: https://docs-platform.services-valid.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancelar envelope

> Cancela um envelope, impedindo assinaturas adicionais. Dispara webhook CANCELLED.

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

<ParamField path="uuid" type="string" required>
  UUID do envelope a cancelar.
</ParamField>

<ParamField body="reason" type="string">
  Motivo do cancelamento (opcional).
</ParamField>

## Respostas

<ResponseField name="envelopeUuid" type="string">
  UUID do envelope.
</ResponseField>

<ResponseField name="state" type="string">
  Novo estado: `CANCELLED`.
</ResponseField>

<ResponseField name="finishedAt" type="string">
  Timestamp do cancelamento (ISO 8601).
</ResponseField>

## Erros

Veja [Autenticação e erros](/plataforma/assinatura-digital/api/erros-e-autenticacao).

* **401**: API key inválido.
* **404**: Envelope não encontrado.
* **409**: Envelope já está em estado terminal (finalizado, cancelado, expirado, recusado).

<ResponseExample>
  ```json theme={"theme":"catppuccin-latte"}
  HTTP/1.1 200 OK
  Content-Type: application/json

  {
    "envelopeUuid": "550e8400-e29b-41d4-a716-446655440000",
    "state": "CANCELLED",
    "finishedAt": "2025-07-27T16:00:00.000Z"
  }
  ```

  ```json theme={"theme":"catppuccin-latte"}
  HTTP/1.1 409 Conflict
  Content-Type: application/json

  {
    "statusCode": 409,
    "message": "Cannot cancel envelope in FINISHED state"
  }
  ```
</ResponseExample>

## Exemplo

```bash theme={"theme":"catppuccin-latte"}
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`](/plataforma/assinatura-digital/api/get-envelope-by-id) — verificar estado do envelope
* [Notificações via webhook](/plataforma/assinatura-digital/api/notificacoes-webhook) — entender webhooks `CANCELLED`
