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

# Chat Unsubscribed from Template Messages

> Fires when a chat opts out of template messages

ubscribe to receive a notification when a chat **unsubscribes from template messages** - for example when the contact sends an opt-out keyword such as **"הסר"**, when an agent manually unsubscribes the chat in Texter, or via the [Unsubscribe from Templates](/api-reference/templates-subscriptions/unsubscribe-from-templates) endpoint.

**Event name:** `chatUnsubscribed`\\

**Required token scopes:**

* `Create scenarios`
* `Manage scenarios on behalf of user`

see [Authentication](/api-reference/authentication)

## Subscribe

Send the body below to [Import Subscription](/api-reference/subscribe-to-events/import-subscription-subscribe-to-an-event). You only need to change:

* **`url`** *(required)* - Located under `data.actions[0].params.url`. Replace `{{yourWebhookURL}}` with the destination URL that should receive the events.
* **`asStatus`** - Keep `"active"` to enable the subscription immediately, or `"inactive"` to save it as an inactive revision.

```json Import body [expandable]  theme={null}
{
  "data": {
    "version": "v1",
    "name": "(SUB) Chat Unsubscribed",
    "description": "Sends a webhook when a chat unsubscribed from receiving template messages (e.g., by replying \"הסר\")",
    "triggerEvents": [
      "domain.chat.unsubscribed"
    ],
    "loaders": {},
    "conditions": [],
    "actions": [
      {
        "name": "request",
        "params": {
          "url": "{{yourWebhookURL}}",
          "method": "post",
          "json": true,
          "data": {
            "eventName": "chatUnsubscribed",
            "eventData": {
              "chat": {
                "##provide": {
                  "provider": "chat",
                  "key": "chat"
                }
              }
            }
          }
        },
        "confidentialData": false
      }
    ],
    "options": {
      "unorderedActions": false
    }
  },
  "asStatus": "active"
}
```

<Note>
  A `201` response returns your new subscription - save its `_id` to manage it later. You can also add an optional `authorUid` root field (a Texter user UID) to attribute the subscription to a specific user.
</Note>

## Payload

When the event fires, your URL receives an HTTP `POST` with `eventName: "chatUnsubscribed"` and the following `eventData`:

<ResponseField name="chat" type="Chat">
  The chat that unsubscribed. Typically includes `unsubscribed.date` and `unsubscribed.bulkSendId`. See the [Chat object](/api-reference/objects/chat) for all fields.
</ResponseField>

```json Example payload  theme={null}
{
  "eventName": "chatUnsubscribed",
  "eventData": {
    "chat": {
      "_id": "69062b15262e17ab3033f886",
      "displayName": "Tyler Joseph",
      "unsubscribed": {
        "date": "2025-10-30T21:01:48.989Z",
        "bulkSendId": "97337f16-e717-4ac9-b2dd-8552909b9252"
      },
      "...": "..."
    }
  }
}
```

## Manage this subscription

| Action             | Endpoint                                                                              |
| ------------------ | ------------------------------------------------------------------------------------- |
| List subscriptions | [List All Subscriptions](/api-reference/subscribe-to-events/list-all-subscriptions)   |
| Pause              | [Inactivate Subscription](/api-reference/subscribe-to-events/inactivate-subscription) |
| Resume             | [Activate Subscription](/api-reference/subscribe-to-events/activate-subscription)     |
| Delete             | [Delete Subscription](/api-reference/subscribe-to-events/delete-subscription)         |
| Debug executions   | [List Scenario Runs](/api-reference/scenarios-advanced/list-scenario-runs)            |
