דלג לתוכן הראשי
Subscribe to receive a notification when a chat is resolved by a human agent. The subscription filters on chat.agent.uid being present. Event name: chatResolvedByAgent\ Required token scopes:
  • Create scenarios
  • Manage scenarios on behalf of user
see Authentication

Subscribe

Send the body below to Import Subscription. 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.
Import body
{
  "data": {
    "version": "v1",
    "name": "(SUB) Chat Resolved by Agent",
    "description": "Sends a webhook when a chat is resolved by a human agent.",
    "triggerEvents": [
      "domain.chat.resolved"
    ],
    "loaders": {},
    "conditions": [
      [
        {
          "name": "filtrex",
          "params": {
            "expression": "exists(agent.uid)",
            "value": "%chat:chat%"
          },
          "confidentialData": false
        }
      ]
    ],
    "actions": [
      {
        "name": "request",
        "params": {
          "url": "{{yourWebhookURL}}",
          "method": "post",
          "json": true,
          "data": {
            "eventName": "chatResolvedByAgent",
            "eventData": {
              "chat": {
                "##provide": {
                  "provider": "chat",
                  "key": "chat"
                }
              }
            }
          }
        },
        "confidentialData": false
      }
    ],
    "options": {
      "unorderedActions": false
    }
  },
  "asStatus": "active"
}
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.

Payload

When the event fires, your URL receives an HTTP POST with eventName: "chatResolvedByAgent" and the following eventData:
chat
Chat
The resolved chat, with agent.uid populated. See the Chat object for all fields.
Example payload
{
  "eventName": "chatResolvedByAgent",
  "eventData": {
    "chat": {
      "_id": "69062b15262e17ab3033f886",
      "displayName": "Tyler Joseph",
      "status": 3,
      "resolvedUpdateTime": 1761664598,
      "agent": {
        "uid": "rShazWqr8iTDocIqkOp4GY0c0j32",
        "displayName": "גיל"
      },
      "...": "..."
    }
  }
}

Manage this subscription