{
  "info": {
    "name": "Octuvia API",
    "description": "API pública de Octuvia: cuentas WhatsApp, Messenger, Instagram y TikTok, mensajes, plantillas y webhooks. Base URL https://api.octuvia.com/v1.\n\nGenerada desde https://docs.octuvia.com. Compatible con Postman, Insomnia, Bruno y otros clientes HTTP.\n\n1. En Variables, reemplaza `bearerToken` por tu secret key real.\n2. Ejemplo de placeholder: `octuvia_live_…`. Producción: octuvia_live_….",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_postman_id": "octuvia-docs-collection"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{bearerToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.octuvia.com/v1",
      "type": "string"
    },
    {
      "key": "bearerToken",
      "value": "octuvia_live_…",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "accounts",
      "item": [
        {
          "name": "GET Listar números",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts"
              ]
            },
            "description": "Lista cuentas conectadas (números WhatsApp, páginas Messenger, etc.). Respuesta slim: identidad + bloque de plataforma.\n\nFiltra por `platform` (p. ej. whatsapp). El detalle completo está en GET /accounts/{id}.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "POST Reconectar número",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/accounts/{account_id}/reconnect",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts",
                ":account_id",
                "reconnect"
              ]
            },
            "description": "Para un número ya conectado (`acc_…`) que dejó de funcionar o pide reautorización: reengancha el número con Meta sin crear otra cuenta.\n\nSin body. Path: `account_id` del número (`acc_…`), no del workspace. La API key identifica el workspace. Recomendado `Idempotency-Key`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "GET Listar plantillas",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/accounts/{account_id}/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts",
                ":account_id",
                "templates"
              ]
            },
            "description": "Lista las plantillas del número conectado. Son del WABA: todos los números del mismo WABA ven las mismas. Se sincronizan al listar.\n\nPath: `account_id` del número (`acc_…`). La API key identifica el workspace. Filtros opcionales por query.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "POST Crear plantilla",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/accounts/{account_id}/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts",
                ":account_id",
                "templates"
              ]
            },
            "description": "Crea una plantilla y la manda a revisión. Queda en `PENDING` hasta que se apruebe o rechace.\n\nPath: `account_id` (`acc_…`). Recomendado `Idempotency-Key`. Si el texto tiene `{{1}}`, `{{2}}`… debes mandar `example` con samples. Nombre ya usado en ese idioma → 409.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"pedido_enviado\",\n  \"language\": \"es\",\n  \"category\": \"UTILITY\",\n  \"components\": [\n    {\n      \"type\": \"BODY\",\n      \"text\": \"Hola {{1}}, tu pedido {{2}} ha salido.\",\n      \"example\": {\n        \"body_text\": [\n          [\n            \"María\",\n            \"ORD-123\"\n          ]\n        ]\n      }\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Actualizar perfil WhatsApp",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/accounts/{account_id}/whatsapp/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts",
                ":account_id",
                "whatsapp",
                "profile"
              ]
            },
            "description": "Actualiza about, description, email, vertical, websites y address en Meta.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"about\": \"Soporte 24/7\",\n  \"vertical\": \"OTHER\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "GET Leer settings WhatsApp",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/accounts/{account_id}/whatsapp/settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts",
                ":account_id",
                "whatsapp",
                "settings"
              ]
            },
            "description": "Perfil de negocio, métricas del número y datos del WABA.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "POST Actualizar zona horaria",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/accounts/{account_id}/whatsapp/timezone",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts",
                ":account_id",
                "whatsapp",
                "timezone"
              ]
            },
            "description": "Cambia el timezone_id numérico del WABA en Meta (día analítico). Meta puede rechazarlo si hay línea de crédito.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"timezone_id\": \"55\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Conectar con credenciales",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/accounts/whatsapp/credentials",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "accounts",
                "whatsapp",
                "credentials"
              ]
            },
            "description": "Traes tu propia app Meta (BYO): WABA, número, token de System User y app_secret. Octuvia valida, engancha el webhook del número y crea el account. Solo keys live.\n\nAlternativa al connect link cuando ya tienes app + WABA. La API key identifica el workspace. Recomendado `Idempotency-Key`. El token necesita `whatsapp_business_management` y `whatsapp_business_messaging`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"waba_id\": \"102290129340398\",\n  \"phone_number_id\": \"106540352242922\",\n  \"access_token\": \"EAAB…\",\n  \"app_secret\": \"…\",\n  \"name\": \"Ventas\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "conversations",
      "item": [
        {
          "name": "GET Listar conversaciones",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/conversations",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "conversations"
              ]
            },
            "description": "Bandeja del workspace: de la actividad más reciente a la más antigua.\n\nSin body. Filtra con query. Cada ítem trae `window_expires_at` (ventana 24 h) y el contacto.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "GET Mensajes del hilo",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/conversations/{conversation_id}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "messages"
              ]
            },
            "description": "Historial de una conversación (más reciente primero).\n\nSin body. Path: `conversation_id` (`conv_…`). Query: `limit`, `cursor`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "POST Enviar mensaje interactivo",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/conversations/{conversation_id}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "messages"
              ]
            },
            "description": "Botones, lista, CTA URL, flow, ubicación, contacto, llamada, producto, catálogo o carrusel. Ventana de 24 h.\n\nJSON con `type: interactive` + objeto `interactive`. `body` es obligatorio salvo `product`. Máx. 3 botones; lista máx. 10 filas.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"interactive\",\n  \"interactive\": {\n    \"type\": \"buttons\",\n    \"header\": \"Hola\",\n    \"body\": \"¿Cómo quieres continuar?\",\n    \"footer\": \"OCTUVIA\",\n    \"buttons\": [\n      {\n        \"id\": \"btn_1\",\n        \"title\": \"Botón 1\"\n      },\n      {\n        \"id\": \"btn_2\",\n        \"title\": \"Botón 2\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Enviar archivo",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/conversations/{conversation_id}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "messages"
              ]
            },
            "description": "Imagen, video, audio, documento o sticker por multipart en el hilo. Ventana de 24 h.\n\nContent-Type: `multipart/form-data` en el **mismo path** que el reply JSON. Campos form: `type`, `file` (obligatorios), `caption`, `filename`, `voice_note`, `reply_to`. Límites WhatsApp: imagen 5 MB, audio/video 16 MB, documento 100 MB.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "POST Responder en hilo",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/conversations/{conversation_id}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "messages"
              ]
            },
            "description": "Atajo de POST /messages: el número y el destinatario salen de la conversación. Ventana de 24 h.\n\nJSON. Path: `conversation_id`. Body: `type` + el objeto de ese tipo (`text`, `location`, …). Opcional `reply_to` y `metadata`. Recomendado `Idempotency-Key`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"text\",\n  \"text\": {\n    \"body\": \"Hola, ¿en qué te ayudamos?\",\n    \"preview_url\": false\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Responder a un mensaje",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/conversations/{conversation_id}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "messages"
              ]
            },
            "description": "Cita un mensaje del hilo con `reply_to` (`msg_…`). Misma ventana de 24 h.\n\nEs el mismo endpoint que [Responder en hilo](/communications/whatsapp/conversations/post-conversation-messages): añade `reply_to`. El mensaje citado debe ser del mismo `conv_…`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"text\",\n  \"text\": {\n    \"body\": \"¡Claro!\",\n    \"preview_url\": false\n  },\n  \"reply_to\": \"msg_01J8Z3K4M5N6P7Q8R9S0T1U2V3\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Enviar plantilla",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/conversations/{conversation_id}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "messages"
              ]
            },
            "description": "Envía una plantilla aprobada en un hilo existente. Funciona con la ventana 24 h cerrada.\n\nJSON con `type: template` + `template`. Preferido: `template.id` (`tpl_…`). Alternativa: `name` + `language`. El `account_id` y el `to` salen de la conversación. Debe estar `APPROVED`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"template\",\n  \"template\": {\n    \"id\": \"tpl_01J8Z3K4M5N6P7Q8R9S0T1U2V3\",\n    \"body_parameters\": [\n      \"Ana\",\n      \"1042\"\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "events",
      "item": [
        {
          "name": "GET Listar eventos",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events"
              ]
            },
            "description": "Log de eventos del workspace (más reciente primero). Útil si tu endpoint estuvo caído: reconciliás y reintentas entregas.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "GET Entregas de un evento",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/events/{event_id}/deliveries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events",
                ":event_id",
                "deliveries"
              ]
            },
            "description": "Intentos de entrega de un evento a tus endpoints (status, intentos, HTTP).",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "messages",
      "item": [
        {
          "name": "POST Enviar plantilla",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "messages"
              ]
            },
            "description": "Primer contacto o ventana 24 h cerrada: envía una plantilla aprobada. Crea el hilo si no existe.\n\nJSON: `account_id` + `to` + `type: template` + `template`. Preferido: `template.id` (`tpl_…`). Alternativa: `name` + `language`. Debe estar `APPROVED`. Recomendado `Idempotency-Key`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"account_id\": \"acc_01J8Z3K4M5N6P7Q8R9S0T1U2V3\",\n  \"to\": \"+51987654321\",\n  \"type\": \"template\",\n  \"template\": {\n    \"id\": \"tpl_01J8Z3K4M5N6P7Q8R9S0T1U2V3\",\n    \"body_parameters\": [\n      \"Ana\",\n      \"1042\"\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Enviar mensaje",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "messages"
              ]
            },
            "description": "Texto (ventana 24 h) o plantilla. Usa el account_id del número conectado. La conversación se crea al vuelo.\n\nBody JSON: `account_id` + `to` + `type` + objeto del tipo. También admite multipart (`file`) para media. Asíncrono: 202 `queued`. Recomendado `Idempotency-Key`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"account_id\": \"acc_01J8Z3K4M5N6P7Q8R9S0T1U2V3\",\n  \"to\": \"+51987654321\",\n  \"type\": \"template\",\n  \"template\": {\n    \"id\": \"tpl_01J8Z3K4M5N6P7Q8R9S0T1U2V3\",\n    \"body_parameters\": [\n      \"Ana\",\n      \"1042\"\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "DELETE Quitar reacción",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/messages/{message_id}/reactions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "messages",
                ":message_id",
                "reactions"
              ]
            },
            "description": "Elimina tu reacción saliente del mensaje.\n\nSin body. Path: `message_id` (`msg_…`). Solo quita tu reacción `outbound`.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "POST Reaccionar a un mensaje",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/messages/{message_id}/reactions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "messages",
                ":message_id",
                "reactions"
              ]
            },
            "description": "Un emoji por mensaje; otro lo reemplaza. Necesita ventana de 24 h.\n\nPath: `message_id` (`msg_…`). Body JSON con `emoji`. Responde el mensaje con `reactions` actualizado; el envío a WhatsApp va en la cola del hilo.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"emoji\": \"👍\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "webhook-deliveries",
      "item": [
        {
          "name": "POST Reintentar entrega",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/webhook-deliveries/{delivery_id}/retry",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhook-deliveries",
                ":delivery_id",
                "retry"
              ]
            },
            "description": "Reencola una entrega para envío inmediato, incluso si quedó dead. Idempotency-Key recomendado.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "webhook-endpoints",
      "item": [
        {
          "name": "GET Listar endpoints",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/webhook-endpoints",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhook-endpoints"
              ]
            },
            "description": "Lista los webhook endpoints del workspace (modo de la API key).",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "POST Crear endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/webhook-endpoints",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhook-endpoints"
              ]
            },
            "description": "Registra una URL HTTPS y los eventos a recibir. El signing_secret (whsec_…) solo se muestra aquí y al rotar: guárdalo.\n\nRecomendado `Idempotency-Key`. La URL debe ser HTTPS pública (accesible desde internet).",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://api.tuapp.com/octuvia/webhooks\",\n  \"description\": \"Producción\",\n  \"events\": [\n    \"message.*\",\n    \"account.*\",\n    \"whatsapp.*\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "DELETE Eliminar endpoint",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/webhook-endpoints/{webhook_endpoint_id}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhook-endpoints",
                ":webhook_endpoint_id"
              ]
            },
            "description": "Borra el endpoint. Las entregas pendientes a esa URL se cancelan.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "PATCH Actualizar endpoint",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/webhook-endpoints/{webhook_endpoint_id}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhook-endpoints",
                ":webhook_endpoint_id"
              ]
            },
            "description": "Cambia URL, eventos, filtros o status (enabled / disabled). Úsalo también para reactivar uno en disabled_by_failures.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"enabled\",\n  \"events\": [\n    \"message.*\",\n    \"whatsapp.account.*\",\n    \"whatsapp.number.*\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Rotar secreto",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/webhook-endpoints/{webhook_endpoint_id}/rotate-secret",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhook-endpoints",
                ":webhook_endpoint_id",
                "rotate-secret"
              ]
            },
            "description": "Genera un signing_secret nuevo. Durante expire_previous_in_seconds (default 24 h) cada entrega lleva dos firmas en X-Octuvia-Signature (v1=nuevo,v1=anterior) para migrar sin perder eventos.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"expire_previous_in_seconds\": 86400\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "POST Probar endpoint",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/webhook-endpoints/{webhook_endpoint_id}/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhook-endpoints",
                ":webhook_endpoint_id",
                "test"
              ]
            },
            "description": "Envía un evento webhook.test firmado a tu URL y devuelve el resultado del intento (status HTTP y cuerpo). No reintenta.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "whatsapp",
      "item": [
        {
          "name": "POST Crear connect link",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/whatsapp/connect-link",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "connect-link"
              ]
            },
            "description": "Crea una URL alojada por Octuvia (con tu marca). El usuario completa el Embedded Signup de Meta, elige o registra el número, y el navegador vuelve a tu return_url.\n\nCanal en la ruta (`/whatsapp/…`). La API key (`octuvia_live_…`) identifica el workspace. Recomendado `Idempotency-Key`. `return_url` `https` con host en **Configuración → Dominios de return_url** (si no → 422 `RETURN_URL_NOT_ALLOWED`).",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"return_url\": \"https://dev-app.octuvia.com/channels/whatsapp\",\n  \"onboarding\": \"cloud_api\",\n  \"locale\": \"es\",\n  \"reference\": \"onboarding-demo\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "GET Estado del connect link",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/whatsapp/connect-links/{connect_link_id}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "connect-links",
                ":connect_link_id"
              ]
            },
            "description": "Consulta un enlace: `pending` → `completed` (con `account_id`) | `cancelled` | `failed` | `expired`. Úsalo para confirmar el alta tras el redirect.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "response": []
        }
      ]
    }
  ]
}