{
  "info": {
    "name": "Hooks API — Coleção Pública",
    "_postman_id": "notreve-hooks-official-collection",
    "description": "🚀 Coleção pública para desenvolvedores testarem autenticação, projetos, endpoints, ingestão pública, eventos, entregas e tokens. Configure as variáveis `api_url`, `ingest_url`, `token`, `project_id`, `endpoint_id`, `event_uuid` e `delivery_uuid`. Todas as respostas seguem o padrão `{ status, message, data }`. Rotas administrativas, criação pública de conta e healthchecks não fazem parte desta coleção pública.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "api_url",
      "value": "https://api.hooks.notreve.com.br/v1"
    },
    {
      "key": "ingest_url",
      "value": "https://in.hooks.notreve.com.br"
    },
    {
      "key": "token",
      "value": "SEU_TOKEN_AQUI"
    },
    {
      "key": "email",
      "value": "seu-email@empresa.com.br"
    },
    {
      "key": "password",
      "value": "sua-senha"
    },
    {
      "key": "project_id",
      "value": "0000000000000000"
    },
    {
      "key": "endpoint_id",
      "value": "0000000000000000"
    },
    {
      "key": "event_uuid",
      "value": "00000000-0000-0000-0000-000000000000"
    },
    {
      "key": "delivery_uuid",
      "value": "00000000-0000-0000-0000-000000000000"
    },
    {
      "key": "customer_id",
      "value": "1"
    },
    {
      "key": "plan_slug",
      "value": "free"
    }
  ],
  "item": [
    {
      "name": "🔐 Autenticação",
      "description": "",
      "item": [
        {
          "name": "Login",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/auth/login",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "auth",
                "login"
              ]
            },
            "description": "Retorna token e dados do usuário.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"{{email}}\",\n  \"password\": \"{{password}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Minha conta",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/account",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "account"
              ]
            },
            "description": "Retorna dados da conta autenticada.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Uso da conta",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/account/usage",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "account",
                "usage"
              ]
            },
            "description": "Retorna consumo diário/mensal e limites.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Alterar senha",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/account/password",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "account",
                "password"
              ]
            },
            "description": "Altera senha do usuário autenticado.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"current_password\": \"senha_atual\",\n  \"new_password\": \"nova_senha\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "📁 Projetos",
      "description": "",
      "item": [
        {
          "name": "Listar projetos",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/projects",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "projects"
              ]
            },
            "description": "Lista projetos da conta com consumo e contagens.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Criar projeto",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/projects",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "projects"
              ]
            },
            "description": "Cria um projeto.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"API Pagamentos\",\n  \"description\": \"Eventos do gateway de pagamentos\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Detalhar projeto",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/projects/{{project_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "projects",
                "{{project_id}}"
              ]
            },
            "description": "Detalha um projeto.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Excluir projeto",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{api_url}}/projects/{{project_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "projects",
                "{{project_id}}"
              ]
            },
            "description": "Remove/arquiva projeto conforme política de retenção.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "🔗 Endpoints de Ingestão",
      "description": "",
      "item": [
        {
          "name": "Listar endpoints do projeto",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/projects/{{project_id}}/endpoints",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "projects",
                "{{project_id}}",
                "endpoints"
              ]
            },
            "description": "Lista endpoints de ingestão vinculados ao projeto.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Criar endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/projects/{{project_id}}/endpoints",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "projects",
                "{{project_id}}",
                "endpoints"
              ]
            },
            "description": "Cria endpoint de ingestão e destino de entrega.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Pagamento confirmado\",\n  \"target_url\": \"https://meuapp.com/webhooks/pagamento\",\n  \"method\": \"POST\",\n  \"secret\": \"meu-secret\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Editar endpoint",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/endpoints/{{endpoint_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "endpoints",
                "{{endpoint_id}}"
              ]
            },
            "description": "Atualiza dados do endpoint.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Novo nome\",\n  \"target_url\": \"https://meuapp.com/novo-webhook\",\n  \"method\": \"POST\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Pausar endpoint",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{api_url}}/endpoints/{{endpoint_id}}/pause",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "endpoints",
                "{{endpoint_id}}",
                "pause"
              ]
            },
            "description": "Pausa recebimento/entrega do endpoint.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retomar endpoint",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{api_url}}/endpoints/{{endpoint_id}}/resume",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "endpoints",
                "{{endpoint_id}}",
                "resume"
              ]
            },
            "description": "Retoma endpoint pausado.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Excluir endpoint",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{api_url}}/endpoints/{{endpoint_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "endpoints",
                "{{endpoint_id}}"
              ]
            },
            "description": "Remove/arquiva endpoint conforme política de retenção.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "📥 Ingestão Pública",
      "description": "Endpoint público `in.` usado por terceiros para enviar eventos.",
      "item": [
        {
          "name": "Receber webhook no endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{ingest_url}}/{{endpoint_id}}",
              "host": [
                "{{ingest_url}}"
              ],
              "path": [
                "{{endpoint_id}}"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event\": \"payment.paid\",\n  \"id\": \"pay_123\",\n  \"amount\": 1990,\n  \"currency\": \"BRL\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "📥 Simula o envio de um webhook de terceiro para a URL pública de ingestão."
          },
          "response": []
        }
      ]
    },
    {
      "name": "📋 Eventos Recebidos",
      "description": "",
      "item": [
        {
          "name": "Listar eventos",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/events",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "events"
              ]
            },
            "description": "Lista eventos recebidos pela ingestão.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Listar eventos de endpoint",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/endpoints/{{endpoint_id}}/events",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "endpoints",
                "{{endpoint_id}}",
                "events"
              ]
            },
            "description": "Lista eventos recebidos por um endpoint específico.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Detalhar evento",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/events/{{event_uuid}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "events",
                "{{event_uuid}}"
              ]
            },
            "description": "Detalha payload, headers e metadados do evento.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Entregas do evento",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/events/{{event_uuid}}/deliveries",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "events",
                "{{event_uuid}}",
                "deliveries"
              ]
            },
            "description": "Lista entregas/tentativas vinculadas ao evento recebido.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Replay do evento",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{api_url}}/events/{{event_uuid}}/replay",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "events",
                "{{event_uuid}}",
                "replay"
              ]
            },
            "description": "Reenfileira o evento para nova entrega.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Replay em lote",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/events/bulk/replay",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "events",
                "bulk",
                "replay"
              ]
            },
            "description": "Reenfileira eventos em lote de forma assíncrona.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_uuids\": [\n    \"{{event_uuid}}\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "🚚 Entregas Manuais / Outbound",
      "description": "",
      "item": [
        {
          "name": "Criar entrega manual",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/deliveries",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "deliveries"
              ]
            },
            "description": "Cria uma entrega manual/outbound.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"target_url\": \"https://api.parceiro.com/webhook\",\n  \"method\": \"POST\",\n  \"headers\": {\n    \"x-api-key\": \"minha-chave\"\n  },\n  \"payload\": {\n    \"event\": \"manual.test\",\n    \"ok\": true\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar entregas",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/deliveries",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "deliveries"
              ]
            },
            "description": "Lista entregas manuais/outbound.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Detalhar entrega",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/deliveries/{{delivery_uuid}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "deliveries",
                "{{delivery_uuid}}"
              ]
            },
            "description": "Detalha uma entrega manual/outbound.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Tentativas da entrega",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/deliveries/{{delivery_uuid}}/attempts",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "deliveries",
                "{{delivery_uuid}}",
                "attempts"
              ]
            },
            "description": "Lista tentativas HTTP da entrega.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retry da entrega",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{api_url}}/deliveries/{{delivery_uuid}}/retry",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "deliveries",
                "{{delivery_uuid}}",
                "retry"
              ]
            },
            "description": "Reenfileira uma entrega.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retry em lote",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/deliveries/bulk/retry",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "deliveries",
                "bulk",
                "retry"
              ]
            },
            "description": "Reenfileira entregas em lote de forma assíncrona.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"delivery_uuids\": [\n    \"{{delivery_uuid}}\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "🗝️ Tokens de API",
      "description": "",
      "item": [
        {
          "name": "Listar tokens",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/tokens",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "tokens"
              ]
            },
            "description": "Lista tokens sem exibir o valor completo.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Criar token",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/tokens",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "tokens"
              ]
            },
            "description": "Cria token. O valor completo aparece apenas uma vez.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Integração produção\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Excluir token",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{api_url}}/tokens/{{token_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "tokens",
                "{{token_id}}"
              ]
            },
            "description": "Revoga token.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "🧾 Logs",
      "description": "",
      "item": [
        {
          "name": "Logs do cliente",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/logs",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "logs"
              ]
            },
            "description": "Lista logs operacionais da conta autenticada.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    }
  ]
}