> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifique.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Eventos de Webhook

> Reciba notificación cuando RCS se envía, entrega, hace clic, falla o se cancela.

<Tip>
  Con la API usted **pregunta**; con webhooks Notifique **le avisa**. Ideal para marcar campañas como entregadas o medir clics en botones, sin polling.
</Tip>

## En resumen

* Cada entrega es un **POST** `application/json` a su URL registrada.
* Los eventos `rcs.*` son **solo RCS**; SMS usa `sms.*`, WhatsApp usa `message.*`.
* `instanceId` está **vacío** (RCS no usa instance de canal).
* Habilite **solo** los eventos que necesite su integración.
* Responda **2xx rápido**; el procesamiento pesado va a su cola.

Configuración general: [Webhooks](/es/guides/webhooks/index). Seguridad (firma HMAC): [Seguridad de Webhook](/es/guides/webhooks/seguranca).

***

## Cómo se ve el POST

```json theme={null}
{
  "event": "rcs.delivered",
  "workspaceId": "clxx123...",
  "instanceId": "",
  "timestamp": "2025-02-10T14:30:00.000Z",
  "data": {
    "rcsId": "clxx456...",
    "to": "5511999999999",
    "status": "DELIVERED",
    "deliveredAt": "2025-02-10T14:30:05.000Z"
  }
}
```

| Campo         | Descripción                                 |
| ------------- | ------------------------------------------- |
| `event`       | Event name (e.g. `rcs.delivered`)           |
| `workspaceId` | ID del Workspace                            |
| `instanceId`  | Always empty for RCS                        |
| `timestamp`   | ISO 8601, use para anti-replay              |
| `data`        | Send fields (`rcsId`, `to`, `status`, etc.) |

Headers: `X-Notifique-Signature`, `X-Notifique-Timestamp`, `X-Workspace-Id`, `X-Webhook-Event`.

***

## Qué debe devolver su servidor

| Respuesta               | Efecto                                    |
| ----------------------- | ----------------------------------------- |
| **2xx** en \~10s        | Evento entregado; removido de la cola     |
| **4xx / 5xx / timeout** | Reintento automático (5 min, 30 min, 2 h) |

<Note>
  ¿Procesamiento lento? Devuelva **200** de inmediato y procese en segundo plano.
</Note>

***

## Referencia de eventos

| Evento          | Cuándo se dispara                      | Qué hacer con él      |
| --------------- | -------------------------------------- | --------------------- |
| `rcs.sent`      | RCS accepted and sent to network       | Mark as sent          |
| `rcs.delivered` | Entregado al dispositivo               | Confirm delivery      |
| `rcs.clicked`   | Clic en short link o botón             | Campaña / conversión  |
| `rcs.failed`    | Failure (number without RCS, etc.)     | Fallback SMS o alerta |
| `rcs.cancelled` | Programación cancelada antes del envío | Actualizar cola       |

***

## Payload por evento

<AccordionGroup>
  <Accordion title="rcs.sent">
    ```json theme={null}
    {
      "event": "rcs.sent",
      "workspaceId": "clxx123...",
      "instanceId": "",
      "timestamp": "2025-02-10T14:29:00.000Z",
      "data": {
        "rcsId": "clxx456...",
        "to": "5511999999999",
        "status": "SENT",
        "sentAt": "2025-02-10T14:29:00.000Z",
        "messageType": "BASIC"
      }
    }
    ```
  </Accordion>

  <Accordion title="rcs.delivered">
    ```json theme={null}
    {
      "event": "rcs.delivered",
      "workspaceId": "clxx123...",
      "instanceId": "",
      "timestamp": "2025-02-10T14:30:00.000Z",
      "data": {
        "rcsId": "clxx456...",
        "to": "5511999999999",
        "status": "DELIVERED",
        "deliveredAt": "2025-02-10T14:30:05.000Z"
      }
    }
    ```
  </Accordion>

  <Accordion title="rcs.clicked">
    Se dispara en el **primer** clic rastreado en short link o botón de este envío.

    ```json theme={null}
    {
      "event": "rcs.clicked",
      "workspaceId": "clxx123...",
      "instanceId": "",
      "timestamp": "2025-02-10T14:35:00.000Z",
      "data": {
        "rcsId": "clxx456...",
        "to": "5511999999999",
        "status": "CLICKED",
        "clickedAt": "2025-02-10T14:35:00.000Z"
      }
    }
    ```
  </Accordion>

  <Accordion title="rcs.failed">
    Buena práctica: dispare fallback (SMS, email) cuando el número no soporte RCS.

    ```json theme={null}
    {
      "event": "rcs.failed",
      "workspaceId": "clxx123...",
      "instanceId": "",
      "timestamp": "2025-02-10T14:29:30.000Z",
      "data": {
        "rcsId": "clxx456...",
        "to": "5511999999999",
        "status": "FAILED",
        "failedAt": "2025-02-10T14:29:30.000Z",
        "errorMessage": "rcs_not_supported"
      }
    }
    ```
  </Accordion>

  <Accordion title="rcs.cancelled">
    ```json theme={null}
    {
      "event": "rcs.cancelled",
      "workspaceId": "clxx123...",
      "instanceId": "",
      "timestamp": "2025-02-10T12:00:00.000Z",
      "data": {
        "rcsId": "clxx456...",
        "to": "5511999999999",
        "status": "CANCELLED"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Próximos pasos

* [Quick Start](/es/rcs-api/como-funciona/quick-start): first send
* [Introduction](/es/rcs-api/como-funciona/introducao): status lifecycle
* [Scopes](/es/rcs-api/como-funciona/escopos-da-api-key): key permissions
* [Webhooks (general guide)](/es/guides/webhooks/index)
