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

> Fires when a chat starts waiting for a human agent

ubscribe to receive a notification when a chat moves to **pending** status (waiting for a human agent) - e.g. after a bot handoff or an [Assign Chat](/api-reference/chats/assign-chat) call.

**Event name:** `chatPending`\\

**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 Pending",
    "description": "Sends a webhook when a chat moves to pending status (waiting for a human agent).",
    "triggerEvents": [
      "domain.chat.pending"
    ],
    "loaders": {},
    "conditions": [],
    "actions": [
      {
        "name": "request",
        "params": {
          "url": "{{yourWebhookURL}}",
          "method": "post",
          "json": true,
          "data": {
            "eventName": "chatPending",
            "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: "chatPending"` and the following `eventData`:

<ResponseField name="chat" type="Chat">
  The chat that moved to pending status (`status: 1`, with `pendingUpdateTime`). See the [Chat object](/api-reference/objects/chat) for all fields.
</ResponseField>

```json Example payload  theme={null}
{
  "eventName": "chatPending",
  "eventData": {
    "chat": {
      "_id": "69062b15262e17ab3033f886",
      "displayName": "Tyler Joseph",
      "status": 1,
      "pendingUpdateTime": 1761858108,
      "...": "..."
    }
  }
}
```

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