Chat model

Details on every Chat Object field
Written by Konstantine
Updated 1 year ago

Chats API allows you to get, search, create and snooze your chats. If necessary, you can also update chat status, assignee and department. In this way, you can fully control your HelpCrunch chats.

Here's the example response for most of the Chat API methods:

{
  "data": [
    {
      "id": 542335,
      "closedBy": "string",
      "lastCustomerMessageAt": "1603885746",
      "status": "new",
      "closedAt": "1603885746",
      "rating": "perfect",
      "createdAt": "1603885746",
      "lastMessageAt": "1603885746",
      "createdWith": "string",
      "snoozedUntil": "1603885746",
      "lastMessageText": "string",
      "lastMessageId": 542335,
      "applicationId": 542335,
      "lastCommunicatedAgentId": 542335,
      "agents": [
        {
          "id": 542335,
          "name": "string",
          "email": "string",
          "role": "string"
        }
      ],
      "customer": {
        "id": 542335,
        "name": "string",
        "email": "string",
        "userId": "string"
      },
      "assignee": {
        "id": 542335,
        "name": "string",
        "email": "string",
        "role": "string"
      },
      "department": {
        "id": 542335,
        "name": "string"
      }
    }
  ],
  "meta": {
    "total": 435
  }
}

Below you can find details on each of the Chat Object fields.

Field Type Description
id Integer Unique id of the chat provided by HelpCrunch
closedBy String "customer" or "agent". Who closed the chat
lastCustomerMessageAt String (UNIX timestamp) Date and time of customer's last message
status String Current chat status: "new", "opened", "pending", "onhold", "no communication", "closed" or "empty"
closedAt String (UNIX timestamp) Date and time the chat was closed
rating String How customer rated the chat after its closure: "great", "average", "poor"
createdAt String (UNIX timestamp) Date and time the chat was created
lastMessageAt String (UNIX timestamp) Date and time of the last message in chat, from agent or customer
createdWith String The trigger that led to the initiation of the chat: "public_api", "broadcast_reply", "agent_message", "customer_message"
snoozedUntil String (UNIX timestamp) Date and time the chat was snoozed for. To unsnooze, pass null value.
lastMessageText String Text of the last message in chat
lastMessageId Integer Unique id of the last message provided by HelpCrunch
applicationId Integer Unique id of the application provided by HelpCrunch
lastCommunicatedAgentId Integer Unique id of agent who sent the last message, provided by HelpCrunch. You can fetch agents' info (id, name, email, role) with Get all team members REST API method.
agents Array of agent objects Agents that sent at least one message to chat. Each agent data consists of id, name, email and role
customer Object Basic customer info, including unique HelpCrunch id, name, email and userId (defined on your side).
assignee Object Agent the chat is currently assigned to. Consists of unique HelpCrunch id, name, email and role.
department Object Department the chat is currently assigned to. Consists of unique HelpCrunch id and name.

If you have any questions regarding the REST API, feel free to chat us any time.

👩‍💻 Happy Coding! 👨‍💻

Did this answer your question?