{
  "info": {
    "_postman_id": "329b46a8-1bcc-4e00-a7ab-dfede7b1d456",
    "name": "alethor_api__V06",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "1387422",
    "_collection_link": "https://go.postman.co/collection/1387422-329b46a8-1bcc-4e00-a7ab-dfede7b1d456?source=collection_link"
  },
  "item": [
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Webhook List",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks",
              "host": [
                "{{endpoint_base}}webhooks"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Webhook Create",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://webhook.site/your-endpoint-azul\",\n  \"events\": [\"document.finalized\"],\n  \"payload_mode\": \"full\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks",
              "host": [
                "{{endpoint_base}}webhooks"
              ]
            },
            "description": "Cria webhook (is_active=false ate verificacao). O `secret` em plaintext e retornado SO nesta resposta e em rotate-secret. Guarde-o."
          },
          "response": []
        },
        {
          "name": "Webhook Show",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Webhook Update",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"events\": [\"document.finalized\"],\n  \"payload_mode\": \"reference\",\n  \"is_active\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}"
              ]
            },
            "description": "Trocar `url` reseta a verificacao (is_active=false, verified_at=null) e redispara o job de verificacao. Enviar company_id/secret/verified_at/consecutive_failures retorna 422."
          },
          "response": []
        },
        {
          "name": "Webhook Delete",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "DELETE",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}"
              ]
            },
            "description": "Cascateia para webhook_deliveries; a entrada de auditoria sobrevive (webhook_id vira null)."
          },
          "response": []
        },
        {
          "name": "Webhook Verify",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}/verify",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}",
                "verify"
              ]
            },
            "description": "Redispara a verificacao de posse (sincrono). O endpoint do cliente deve ecoar `challenge` no corpo JSON. 200 = verificado; 422 = challenge errado; 409 = ja verificado."
          },
          "response": []
        },
        {
          "name": "Webhook Test",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}/test",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}",
                "test"
              ]
            },
            "description": "Envia payload sintetico com \"test\": true. NAO cria linha em webhook_deliveries. Retorna status e corpo truncado do endpoint."
          },
          "response": []
        },
        {
          "name": "Webhook Rotate Secret",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}/rotate-secret",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}",
                "rotate-secret"
              ]
            },
            "description": "Gera novo secret de 64 chars e o retorna em plaintext uma unica vez. Invalida o anterior."
          },
          "response": []
        },
        {
          "name": "Webhook Audit Logs",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}/audit-logs",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}",
                "audit-logs"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Webhook Company Audit Logs History",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}audit-logs-history-webhooks-company",
              "host": [
                "{{endpoint_base}}audit-logs-history-webhooks-company"
              ]
            },
            "description": "Historico de auditoria de toda a company, incluindo entradas de webhooks ja deletados (webhook_id null)."
          },
          "response": []
        },
        {
          "name": "Webhook Deliveries List",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}/deliveries?status=exhausted",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}",
                "deliveries"
              ],
              "query": [
                {
                  "key": "document_id",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "from",
                  "value": "2026-07-20T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "to",
                  "value": "2026-07-22T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "exhausted"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Webhook Delivery Redeliver",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}/deliveries/{{delivery_id}}/redeliver",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}",
                "deliveries",
                "{{delivery_id}}",
                "redeliver"
              ]
            },
            "description": "Reenvio manual de uma entrega. Cria linha NOVA com replay_of; a original nunca e mutada."
          },
          "response": []
        },
        {
          "name": "Webhook Delivery Replay",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"date\": \"2026-07-26\",\n  \"status\": \"exhausted\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{endpoint_base}}webhooks/{{webhook_id}}/deliveries/replay",
              "host": [
                "{{endpoint_base}}webhooks"
              ],
              "path": [
                "{{webhook_id}}",
                "deliveries",
                "replay"
              ]
            },
            "description": "Replay em lote por janela. Cria linhas novas com replay_of. Cap 5.000 por request, janela max 90 dias. `status` opcional (default: failed+exhausted)."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Logout",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{token}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": []
        },
        "url": {
          "raw": "{{endpoint_base}}auth/logout",
          "host": [
            "{{endpoint_base}}auth"
          ],
          "path": [
            "logout"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Me",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{token}}",
              "type": "string"
            },
            {
              "key": "password",
              "value": "{{API_V3_TOKEN}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": []
        },
        "url": {
          "raw": "{{endpoint_base}}auth/me",
          "host": [
            "{{endpoint_base}}auth"
          ],
          "path": [
            "me"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Login",
      "request": {
        "auth": {
          "type": "noauth"
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "email",
              "value": "{{user}}",
              "type": "text",
              "uuid": "a847b58e-de59-494c-909c-3ef5c707b3ea"
            },
            {
              "key": "password",
              "value": "{{password}}",
              "type": "text",
              "uuid": "cd1c3765-904d-49ea-9c8c-23062d2eb6c5"
            }
          ]
        },
        "url": {
          "raw": "{{endpoint_base}}auth/login",
          "host": [
            "{{endpoint_base}}auth"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Document Create",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{token}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "uuid": "0e04ce5f-1c52-4c1d-ad96-2c91c738ceea",
              "src": "/C:/Users/jonat/Google Drive/03__In Root/Projeto__Horus_Validator/uploads_exemplos/uploads_exemplos/cnh/cnh_jonatas_antiga__EM_PDF.pdf"
            },
            {
              "key": "document_type",
              "value": "cnh",
              "type": "text",
              "uuid": "92ac52f6-2541-4050-b51b-687d7917426d"
            }
          ]
        },
        "url": {
          "raw": "{{endpoint_base}}document/create",
          "host": [
            "{{endpoint_base}}document"
          ],
          "path": [
            "create"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Document Create reconciliation_input",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{token}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "uuid": "0e04ce5f-1c52-4c1d-ad96-2c91c738ceea",
              "src": "/C:/Users/jonat/Google Drive/03__In Root/Projeto__Horus_Validator/uploads_exemplos/uploads_exemplos/cnh/cnh_jonatas_antiga__EM_PDF.pdf"
            },
            {
              "key": "document_type",
              "value": "cnh",
              "type": "text",
              "uuid": "92ac52f6-2541-4050-b51b-687d7917426d"
            },
            {
              "key": "reconciliation_input",
              "value": "[\n  { \"field\": \"cnh.nome_completo\", \"value\": \"JÔNATAS LANDIM SILVA\", \"match_mode\": \"strict\" },\n  { \"field\": \"cnh.cpf\",           \"value\": \"099.749.127-25\",        \"match_mode\": \"strict\" }\n]",
              "type": "text",
              "uuid": "da1ab1fc-b522-419d-95f0-0ea602844cc2"
            }
          ]
        },
        "url": {
          "raw": "{{endpoint_base}}document/create",
          "host": [
            "{{endpoint_base}}document"
          ],
          "path": [
            "create"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Document Create reconciliation_input undefined",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{token}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "uuid": "0e04ce5f-1c52-4c1d-ad96-2c91c738ceea",
              "src": "/C:/Users/jonat/Google Drive/03__In Root/Projeto__Horus_Validator/uploads_exemplos/uploads_exemplos/contrato-social/21137065000153_contrato_social_3__28.pdf"
            },
            {
              "key": "document_type",
              "value": "contrato-social",
              "type": "text",
              "uuid": "92ac52f6-2541-4050-b51b-687d7917426d"
            },
            {
              "key": "reconciliation_input",
              "value": "[\n  {\"field\": \"undefined\", \"value\": \"ACESSIBILIDADE SERVICOS EM SAUDE LTDA\", \"match_mode\": \"tolerant\"},\n  {\"field\": \"undefined\", \"value\": \"21.137.065/0001-53\", \"match_mode\": \"strict\"}\n]",
              "type": "text",
              "uuid": "da1ab1fc-b522-419d-95f0-0ea602844cc2"
            }
          ]
        },
        "url": {
          "raw": "{{endpoint_base}}document/create",
          "host": [
            "{{endpoint_base}}document"
          ],
          "path": [
            "create"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Document Result",
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      },
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{token}}",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": []
        },
        "url": {
          "raw": "{{endpoint_base}}document/result/7aabf057-5018-4f75-b7ec-ce95264ff036",
          "host": [
            "{{endpoint_base}}document"
          ],
          "path": [
            "result",
            "7aabf057-5018-4f75-b7ec-ce95264ff036"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Document Reenvia para Webhook",
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      },
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{token}}",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": []
        },
        "url": {
          "raw": "{{endpoint_base}}document/reenvia-para-webhook/2",
          "host": [
            "{{endpoint_base}}document"
          ],
          "path": [
            "reenvia-para-webhook",
            "2"
          ]
        }
      },
      "response": []
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "endpoint_base",
      "value": ""
    },
    {
      "key": "user",
      "value": ""
    },
    {
      "key": "password",
      "value": ""
    },
    {
      "key": "token",
      "value": ""
    },
    {
      "key": "webhook_id",
      "value": ""
    },
    {
      "key": "delivery_id",
      "value": ""
    }
  ]
}