{
  "openapi": "3.1.0",
  "info": {
    "title": "Assinova — API para integradores",
    "version": "1.0.0",
    "description": "Assinatura eletrônica com evidências (Lei 14.063/2020). Autenticação por chave de API criada no painel (Integração > Chaves de API), enviada em `Authorization: Bearer ak_...`. Guia completo em https://assinova.com.br/developers."
  },
  "servers": [
    {
      "url": "https://assinova.com.br/api/v1",
      "description": "Produção (use sandbox: true para testes)"
    }
  ],
  "tags": [
    {
      "name": "Chave"
    },
    {
      "name": "Documentos"
    },
    {
      "name": "Signatários"
    },
    {
      "name": "Campos"
    },
    {
      "name": "Resultado"
    },
    {
      "name": "Templates"
    },
    {
      "name": "Webhooks"
    }
  ],
  "paths": {
    "/auth/me": {
      "get": {
        "tags": [
          "Chave"
        ],
        "summary": "Conferir a chave e ver a conta dona dela",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "responses": {
          "200": {
            "description": "Conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      }
    },
    "/upload/pdf": {
      "post": {
        "tags": [
          "Documentos"
        ],
        "summary": "Enviar um PDF (passo 1 do fluxo em duas etapas)",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Devolve o fileKey para usar em POST /documents. Para criar e enviar numa chamada só, prefira POST /documents/create-and-send.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "PDF recebido",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "fileKey": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      }
    },
    "/documents/create-and-send": {
      "post": {
        "tags": [
          "Documentos"
        ],
        "summary": "Criar e enviar para assinatura numa chamada (recomendado)",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "multipart/form-data. Aceita o cabeçalho Idempotency-Key: repetir a mesma chave em até 24 h devolve a resposta original em vez de criar outro documento (409 se a primeira ainda estiver em andamento).",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "title",
                  "signers"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "title": {
                    "type": "string"
                  },
                  "signers": {
                    "type": "string",
                    "description": "JSON (string) com a lista de SignatarioEntrada."
                  },
                  "sandbox": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "signingMode": {
                    "type": "string",
                    "enum": [
                      "SEQUENCIAL",
                      "PARALELO"
                    ]
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "folderId": {
                    "type": "string"
                  },
                  "projectId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado e enviado; cada signatário vem com signUrl",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Documento"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "409": {
            "$ref": "#/components/responses/Conflito"
          }
        }
      }
    },
    "/documents": {
      "post": {
        "tags": [
          "Documentos"
        ],
        "summary": "Criar documento em rascunho (passo 2 do fluxo em duas etapas)",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Depois de posicionar campos (opcional), envie com POST /documents/{id}/send.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CriarDocumento"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Rascunho criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Documento"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      },
      "get": {
        "tags": [
          "Documentos"
        ],
        "summary": "Listar documentos da organização",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DRAFT",
                "SENT",
                "PARTIALLY_SIGNED",
                "COMPLETED",
                "CANCELLED",
                "EXPIRED"
              ]
            },
            "description": "Filtrar por status"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Busca no título"
          },
          {
            "name": "folderId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Seu identificador de pasta"
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Projeto"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Página"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "Itens por página"
          }
        ],
        "responses": {
          "200": {
            "description": "Página de documentos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Documento"
                          }
                        },
                        "pagination": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      }
    },
    "/documents/{id}": {
      "get": {
        "tags": [
          "Documentos"
        ],
        "summary": "Consultar documento e signatários (com signUrl)",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Documento",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Documento"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "put": {
        "tags": [
          "Documentos"
        ],
        "summary": "Alterar título, descrição ou prazo",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "delete": {
        "tags": [
          "Documentos"
        ],
        "summary": "Cancelar documento",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Não apaga: marca CANCELLED, encerra os links de assinatura e dispara document.cancelled. Documento concluído não pode ser cancelado.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/send": {
      "post": {
        "tags": [
          "Documentos"
        ],
        "summary": "Enviar rascunho para assinatura",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "201": {
            "description": "Enviado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/resend": {
      "post": {
        "tags": [
          "Documentos"
        ],
        "summary": "Reenviar convite a quem ainda não assinou",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "201": {
            "description": "Reenviado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/signers": {
      "post": {
        "tags": [
          "Signatários"
        ],
        "summary": "Adicionar signatário (também em documento já enviado)",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignatarioEntrada"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Adicionado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Signatario"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/signers/{signerId}": {
      "patch": {
        "tags": [
          "Signatários"
        ],
        "summary": "Corrigir nome, e-mail ou telefone",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Trocar o e-mail invalida o link antigo (novo signUrl) e reenvia o convite.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          },
          {
            "name": "signerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do signatário (UUID)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nome": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "telefone": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "delete": {
        "tags": [
          "Signatários"
        ],
        "summary": "Remover signatário que ainda não assinou",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          },
          {
            "name": "signerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do signatário (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Removido"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/signers/{signerId}/resend": {
      "post": {
        "tags": [
          "Signatários"
        ],
        "summary": "Reenviar convite a um signatário",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          },
          {
            "name": "signerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do signatário (UUID)"
          }
        ],
        "responses": {
          "201": {
            "description": "Reenviado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/signers/{signerId}/identidade": {
      "get": {
        "tags": [
          "Signatários"
        ],
        "summary": "Situação da validação por documento + selfie",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Status (null, ENVIADA, APROVADA, RECUSADA), documento escolhido e metadados das fotos. As imagens e a aprovação/recusa ficam só no painel (dado pessoal sensível).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          },
          {
            "name": "signerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do signatário (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Situação da identidade",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/fields": {
      "get": {
        "tags": [
          "Campos"
        ],
        "summary": "Listar campos posicionados",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Campos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CampoEntrada"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "post": {
        "tags": [
          "Campos"
        ],
        "summary": "Posicionar campo (assinatura, rubrica, CPF, data, texto...)",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Só em rascunho, antes de POST /documents/{id}/send.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampoEntrada"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Campo criado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "delete": {
        "tags": [
          "Campos"
        ],
        "summary": "Remover todos os campos",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Removidos"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/fields/{fieldId}": {
      "put": {
        "tags": [
          "Campos"
        ],
        "summary": "Mover/redimensionar campo",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          },
          {
            "name": "fieldId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do campo"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampoEntrada"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "delete": {
        "tags": [
          "Campos"
        ],
        "summary": "Remover campo",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          },
          {
            "name": "fieldId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do campo"
          }
        ],
        "responses": {
          "200": {
            "description": "Removido"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/download": {
      "get": {
        "tags": [
          "Resultado"
        ],
        "summary": "Baixar o PDF (assinado, com a página de trilha de auditoria)",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Enquanto não houver assinatura, devolve o original.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/audit": {
      "get": {
        "tags": [
          "Resultado"
        ],
        "summary": "Trilha de auditoria (eventos com hash encadeado)",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Eventos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/certificates/{documentId}/evidence": {
      "get": {
        "tags": [
          "Resultado"
        ],
        "summary": "Evidências em JSON (hashes, signatários, integridade da cadeia)",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento"
          }
        ],
        "responses": {
          "200": {
            "description": "Evidências",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/documents/{id}/verify": {
      "get": {
        "tags": [
          "Resultado"
        ],
        "summary": "Verificação pública de integridade",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do documento (UUID)"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado da verificação"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      }
    },
    "/templates": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Listar templates (PDF + campos já posicionados)",
        "x-escopo": "leitura",
        "security": [
          {
            "chave": []
          }
        ],
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      }
    },
    "/documents/create-from-template/{templateId}": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Criar rascunho a partir de um template",
        "x-escopo": "escrita",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Cria o documento com o PDF do template. Depois adicione signatários (POST /documents/{id}/signers), recrie os campos devolvidos em templateFields com o signerId de cada um e envie.",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do template"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Rascunho criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/webhooks/eventos": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Eventos disponíveis",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de eventos"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      }
    },
    "/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Cadastrar URL de webhook",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "description": "Se segredo não for enviado, um é gerado e devolvido uma única vez.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "eventos"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "eventos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "segredo": {
                    "type": "string",
                    "minLength": 16
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Cadastrado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Listar webhooks",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhooks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Consultar webhook",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do webhook"
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Alterar URL, eventos ou ativar/desativar",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do webhook"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "eventos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ativo": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Excluir webhook",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do webhook"
          }
        ],
        "responses": {
          "200": {
            "description": "Excluído"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/webhooks/{id}/testar": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Disparar entrega de teste",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do webhook"
          }
        ],
        "responses": {
          "201": {
            "description": "Entrega enfileirada"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    },
    "/webhooks/{id}/entregas": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Últimas 20 entregas (status, tentativas, resposta)",
        "x-escopo": "webhooks",
        "security": [
          {
            "chave": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id do webhook"
          }
        ],
        "responses": {
          "200": {
            "description": "Entregas"
          },
          "400": {
            "$ref": "#/components/responses/Invalido"
          },
          "401": {
            "$ref": "#/components/responses/NaoAutenticado"
          },
          "403": {
            "$ref": "#/components/responses/SemPermissao"
          },
          "429": {
            "$ref": "#/components/responses/Limite"
          },
          "404": {
            "$ref": "#/components/responses/NaoEncontrado"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "chave": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ak_<prefixo>_<segredo>",
        "description": "Escopos: leitura, escrita, webhooks. Cada operação indica o escopo exigido em x-escopo. Operações de conta, cobrança e administração não aceitam chave."
      }
    },
    "schemas": {
      "Erro": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Mensagem em português, pensada para ser mostrada/registrada pelo integrador"
              },
              "statusCode": {
                "type": "integer"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              },
              "path": {
                "type": "string"
              }
            }
          }
        }
      },
      "SignatarioEntrada": {
        "type": "object",
        "required": [
          "name",
          "email",
          "order"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "description": "Com DDI, ex.: +5548999990000. Opcional na criação; o signatário informa ao assinar se faltar."
          },
          "cpf": {
            "type": "string",
            "description": "11 dígitos. Opcional; pedido ao assinar se faltar."
          },
          "order": {
            "type": "integer",
            "minimum": 1,
            "description": "Ordem de assinatura (relevante em signingMode SEQUENCIAL)."
          },
          "signatureType": {
            "type": "string",
            "enum": [
              "sign",
              "witness",
              "acknowledge",
              "approve",
              "receipt"
            ],
            "description": "Papel do signatário. Padrão: sign."
          },
          "deliveryMethod": {
            "type": "string",
            "enum": [
              "EMAIL",
              "WHATSAPP",
              "LINK"
            ],
            "default": "EMAIL",
            "description": "EMAIL/WHATSAPP: a Assinova envia o convite. LINK: nada é enviado; use o signUrl devolvido para levar o signatário à assinatura dentro do seu fluxo. Também define o canal do código de confirmação (OTP): WHATSAPP = WhatsApp e e-mail ao mesmo tempo (o e-mail garante a entrega se o WhatsApp falhar); EMAIL e LINK = e-mail."
          },
          "metodoValidacao": {
            "type": "string",
            "enum": [
              "OTP",
              "DOCUMENTO",
              "OTP_DOCUMENTO"
            ],
            "default": "OTP",
            "description": "Como o signatário prova a identidade: OTP (código), DOCUMENTO (fotos do RG/CNH frente e verso + selfie; conferência manual do remetente é sempre exigida) ou OTP_DOCUMENTO (os dois). O canal do código segue o deliveryMethod."
          },
          "documentosAceitos": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "RG",
                "CNH"
              ]
            },
            "default": [
              "RG",
              "CNH"
            ]
          },
          "permitirAnexo": {
            "type": "boolean",
            "default": true,
            "description": "false = só câmera na hora (desestímulo de interface, registrado na trilha)."
          },
          "conferenciaManual": {
            "type": "boolean",
            "default": false,
            "description": "Remetente aprova as fotos no painel antes de a assinatura entrar no documento. Sempre true com DOCUMENTO."
          }
        }
      },
      "Signatario": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "order": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "VIEWED",
              "SIGNED",
              "REFUSED",
              "REMOVED",
              "CANCELLED"
            ]
          },
          "signedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "signatureType": {
            "type": "string"
          },
          "deliveryMethod": {
            "type": "string"
          },
          "signUrl": {
            "type": "string",
            "format": "uri",
            "description": "Link de assinatura deste signatário. É a credencial dele: não exponha a terceiros."
          },
          "metodoValidacao": {
            "type": "string"
          },
          "documentosAceitos": {
            "type": "string",
            "description": "Lista separada por vírgula, ex.: RG,CNH"
          },
          "permitirAnexo": {
            "type": "boolean"
          },
          "conferenciaManual": {
            "type": "boolean"
          },
          "identidadeStatus": {
            "type": "string",
            "nullable": true,
            "enum": [
              "ENVIADA",
              "APROVADA",
              "RECUSADA",
              null
            ]
          }
        }
      },
      "Documento": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "SENT",
              "PARTIALLY_SIGNED",
              "COMPLETED",
              "CANCELLED",
              "EXPIRED"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sandbox": {
            "type": "boolean"
          },
          "folderId": {
            "type": "string",
            "nullable": true
          },
          "hashOriginal": {
            "type": "string"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Signatario"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CriarDocumento": {
        "type": "object",
        "required": [
          "title",
          "fileKey"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": "string"
          },
          "fileKey": {
            "type": "string",
            "description": "Valor devolvido por POST /upload/pdf."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "signingMode": {
            "type": "string",
            "enum": [
              "SEQUENCIAL",
              "PARALELO"
            ],
            "default": "SEQUENCIAL"
          },
          "sandbox": {
            "type": "boolean",
            "default": false,
            "description": "Documento de teste: marca d'água, não conta na cota, não envia convite. Webhooks disparam normalmente."
          },
          "folderId": {
            "type": "string",
            "description": "Seu identificador livre para agrupar documentos."
          },
          "projectId": {
            "type": "string",
            "description": "Projeto da sua organização."
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignatarioEntrada"
            }
          }
        }
      },
      "CampoEntrada": {
        "type": "object",
        "required": [
          "signerId"
        ],
        "properties": {
          "signerId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "SIGNATURE",
              "INITIALS",
              "FULL_NAME",
              "EMAIL",
              "PHONE",
              "BIRTH_DATE",
              "ADDRESS",
              "COMPANY",
              "CPF",
              "CNPJ",
              "DATE",
              "TEXT",
              "CHECKBOX"
            ]
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "width": {
            "type": "number"
          },
          "height": {
            "type": "number"
          },
          "required": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          }
        },
        "description": "Posição em pontos PDF, origem no canto superior esquerdo da página."
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "eventos": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ativo": {
            "type": "boolean"
          },
          "segredo": {
            "type": "string",
            "description": "Só na resposta de criação. Guarde: é a chave do HMAC."
          }
        }
      },
      "EventoWebhook": {
        "type": "object",
        "description": "Corpo de cada entrega (POST para a sua URL).",
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "document.sent",
              "document.completed",
              "document.cancelled",
              "document.expired",
              "signer.viewed",
              "signer.signed",
              "signer.refused",
              "signer.identity_submitted",
              "signer.identity_approved",
              "signer.identity_rejected"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "properties": {
              "document": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  }
                }
              },
              "signer": {
                "type": "object"
              },
              "identity": {
                "type": "object"
              },
              "reason": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "responses": {
      "Invalido": {
        "description": "Dados inválidos; a mensagem diz o que corrigir",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Erro"
            }
          }
        }
      },
      "NaoAutenticado": {
        "description": "Chave ausente, inválida, expirada ou revogada",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Erro"
            }
          }
        }
      },
      "SemPermissao": {
        "description": "A chave não tem o escopo necessário ou a operação não aceita chave",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Erro"
            }
          }
        }
      },
      "Limite": {
        "description": "Mais de 600 requisições/min com esta chave; aguarde Retry-After (s)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Erro"
            }
          }
        }
      },
      "NaoEncontrado": {
        "description": "Recurso não existe ou não pertence à sua conta",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Erro"
            }
          }
        }
      },
      "Conflito": {
        "description": "Idempotency-Key repetida enquanto a primeira chamada ainda está em andamento",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Erro"
            }
          }
        }
      }
    }
  }
}