Tier: FREELocal

API Docs

Webhook Interceptor API

Aquí gestionas la API del producto. Incluye captura de webhooks, gestión de endpoints, privacidad, colaboración con share links y administración de tiers.

START HERE

Quickstart en 60 segundos

  1. Crea tu endpoint desde home con un ID único
  2. Envía un evento de prueba a http://localhost:3000/api/webhook/my-endpoint
  3. Abre el inspector en http://localhost:3000/webhook/my-endpoint
curl -X POST http://localhost:3000/api/webhook/my-endpoint \
  -H "Content-Type: application/json" \
  -d '{"event":"quickstart.test","ok":true}'

POST | PUT | PATCH | DELETE

/api/webhook/{id}

Captura cualquier request entrante para inspección de payload.

Auth: no requerida. Si es private endpoint, exige `x-webhook-key`.

curl -X POST http://localhost:3000/api/webhook/my-endpoint \
  -H "Content-Type: application/json" \
  -d '{"event":"order.created"}'
{ "success": true, "webhookId": "uuid" }

GET

/api/webhook/{id}?_dashboard=1

Devuelve historial del endpoint para UI/dashboard.

Auth: requerida para private endpoint (owner o colaborador aprobado).

curl "http://localhost:3000/api/webhook/my-endpoint?_dashboard=1"

POST

/api/webhook/register

Registra un webhook ID para un usuario autenticado.

Auth: requerida. Respeta límites del tier y ownership.

{ "webhookId": "my-endpoint" }
{ "success": true }

POST

/api/webhook/register-guest

Registra endpoint para guest mode y emite `guest_id` firmado.

Auth: no requerida. Límite free aplicado por cookie firmada.

{ "webhookId": "guest-endpoint" }

GET

/api/account

Resumen de tier, policy y uso (endpoints + requests mensuales).

Auth: opcional. Si no hay sesión, retorna contexto guest/free.

GET

/api/account/endpoints

Lista endpoints del owner con privacidad y metadata.

Auth: requerida.

PATCH

/api/account/endpoints/{id}/privacy

Activa o desactiva endpoint privado y devuelve `accessKey` cuando aplica.

Auth: requerida. Private endpoint disponible desde STARTER.

{ "isPrivate": true }
{ "success": true, "isPrivate": true, "accessKey": "hex" }

POST

/api/account/endpoints/{id}/share

Genera share link para endpoint privado con expiración.

Auth: requerida. Solo owner.

{ "success": true, "shareUrl": "https://.../share/token", "expiresAt": "..." }

GET / DELETE

/api/account/endpoints/{id}/access

Consulta colaboradores con acceso y revoca por `userId`.

Auth: requerida. Solo owner.

{ "userId": "supabase-user-id" }

GET

/api/account/access-requests

Inbox de solicitudes pendientes para endpoints del owner.

Auth: requerida.

PATCH

/api/account/access-requests/{requestId}

Aprueba o rechaza solicitud de acceso (`approve` | `reject`).

Auth: requerida. Solo owner del endpoint.

{ "action": "approve" }

POST

/api/share/{token}/accept

Convierte share token en solicitud de acceso con estado `pending`.

Auth: requerida.

Errores estándar

StatusCuándo ocurreEjemplo
400Body inválido o falta campo requerido{ "error": "webhookId is required" }
401Usuario no autenticado en rutas protegidas{ "error": "Unauthorized" }
402Límite del tier o feature no disponible{ "error": "Private endpoints are available from STARTER tier" }
403Sin permisos sobre recurso del owner{ "error": "Forbidden" }
404Recurso no encontrado{ "error": "Endpoint not found" }
409Conflicto de ownership o webhook ID en uso{ "error": "This webhook ID is already owned by another user" }
410Share link expirado{ "error": "Share link expired" }

Snippets de integración

Node.js (fetch)

await fetch("http://localhost:3000/api/webhook/my-endpoint", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ event: "invoice.paid", amount: 42 }),
});

Python (requests)

import requests

requests.post(
    "http://localhost:3000/api/webhook/my-endpoint",
    json={"event": "invoice.paid", "amount": 42},
    timeout=10,
)