> ## 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.

# Webhooks Overview

> Receive real-time events from your Texter environment

ubscribe to events in your Texter environment - new messages, chat status changes, label changes, channel health problems - and receive an HTTP `POST` at your URL whenever they happen.

Under the hood, subscriptions are **Scenarios** (Texter's automation feature). You never need to build one from scratch: every event in the sidebar has a ready-made template you import once.

## The payload envelope

Every delivery is a `POST` with a JSON body in the same envelope:

```json theme={null}
{
  "eventName": "newIncomingMessage",
  "eventData": {
    "message": { "...": "see The Message object" },
    "chat": { "...": "see The Chat object" }
  }
}
```

* `eventName` - which event fired (each event page lists its name)
* `eventData` - the event's data; the exact fields are documented per event

Respond with any **2xx** status to acknowledge. Write one generic handler that switches on `eventName`, and add subscriptions over time.

## Subscribe in three steps

<Steps>
  <Step title="Pick an event">
    Open the event's page in the sidebar - e.g. [New Incoming Messages](/he/api-reference/webhooks/message-events/new-incoming-messages) or [Chat Resolved](/he/api-reference/webhooks/chat-events/chat-resolved). Each page contains the full import body.
  </Step>

  <Step title="Fill in your values">
    Replace `{{yourWebhookURL}}` with your endpoint, plus any template-specific placeholders (each page tells you exactly what to change and where it sits in the JSON).
  </Step>

  <Step title="Import it">
    Send the body to [Import Subscription](/he/api-reference/subscribe-to-events/import-subscription-subscribe-to-an-event) with a token holding the scopes **Create scenarios** and **Manage scenarios on behalf of user**. A `201` returns your subscription - save its `_id`.
  </Step>
</Steps>

## Manage subscriptions

| Action                                    | Endpoint                                                                                                                                                           |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| List all (templates are prefixed `(SUB)`) | [List All Subscriptions](/he/api-reference/subscribe-to-events/list-all-subscriptions)                                                                             |
| Pause                                     | [Inactivate Subscription](/he/api-reference/subscribe-to-events/inactivate-subscription)                                                                           |
| Resume / revert to a version              | [Activate Subscription](/he/api-reference/subscribe-to-events/activate-subscription)                                                                               |
| Delete permanently                        | [Delete Subscription](/he/api-reference/subscribe-to-events/delete-subscription)                                                                                   |
| **Debug deliveries**                      | [List Scenario Runs](/he/api-reference/scenarios-advanced/list-scenario-runs) - see whether the event fired, conditions matched, and the webhook request succeeded |

## Customizing filters

Some templates filter with **filtrex expressions** you can adapt:

* Single keyword: `text == "help"`
* Multiple keywords (OR): `text == "buy" or text == "purchase"`
* Complex logic with `and`, `or`, `not`, parentheses: `(text == "urgent" and text == "error") or text == "critical"`
* Whole sentences match exactly: `text == "I want to speak to a human"`
* Field existence: `exists(agent.uid)` / `not exists(agent.uid)`
* Array membership: `inArray(addedLabels, "vip")`

If the provided templates don't satisfy your needs, contact [Texter Support](https://wa.me/972586640430) - we'll gladly help modify any triggers, conditions or actions for your webhook.
