Skip to main content
This document contains a reference of data structures available in the Customer Chat API. Here, you can review the object fields, as well as sample responses for the event, user, and other common structures. The reference applies both to the Web and RTM APIs.

Events

Events are sent to a chat through the send_event method.

File

The File event represents an uploaded file.
Request
string
The custom event ID.
string
required
The event type. Must be file.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The file URL. It must point to the Text CDN. Use the URL returned by upload_file.
string
The alternative text for the image.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
string
required
The event type.
string
required
The ID of the event author.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The file name.
string
required
The file URL.
string
images only
The image thumbnail URLs.
string
required
The file media type.
integer
images only
The file size and image dimensions.
string
images only
The alternative text for the image.
Sample File in response

Form

The Form event contains an empty form to be sent in the chat. It doesn’t matter how the form is configured or what fields it has — it can be any event of type form. Currently, the Form events are not supported natively in Text, but you can leverage this feature in a custom chatting solution.
Request
string
The custom event ID.
string
required
The event type. Must be form.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The form ID.
array
required
The fields in the form. See Form fields.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
string
required
The event type.
string
The ID of the event author. Omitted when the form is generated by the system.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The form ID.
string
The form type. Common values include prechat, postchat, and ask_for_email. This field is absent from chats started before the field was introduced.
array
required
The fields in the form. See Form fields.
Sample Form in response

Filled form

The Filled form event contains data submitted through a prechat or postchat form.
Request
string
The custom event ID.
string
required
The event type. Must be filled_form.
string
default:"all"
required
The event recipients. Possible values: all, agents.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The form ID.
array
required
The fields in the form. See Filled form fields.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
string
required
The event type.
string
required
The ID of the event author.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The form ID.
string
The form type. Common values include prechat, postchat, and ask_for_email. This field is absent from chats started before the field was introduced.
array
required
The fields in the form. See Filled form fields.
Sample Filled form in response

Message

The Message event contains a text message sent to chat users.
Request
string
The custom event ID.
string
required
The message text. The maximum raw text size is 16 KB. A UTF-8 character can use up to 4 bytes. Split longer text into multiple messages.
string
required
The event type. Must be message.
object
Custom properties organized by namespace and property name. See Properties.
object
The postback that generated the message from a rich message event.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
string
required
The event type.
string
required
The ID of the event author.
string
required
The message text.
object
The postback that generated the message from a rich message event.
object
Custom properties organized by namespace and property name. See Properties.
Sample Message in response

Rich message

The Rich message event contains interactive rich message content.
Request
string
The custom event ID.
string
required
The event type. Must be rich_message.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The template that determines how the rich message is displayed. Possible values: cards, sticker, quick_replies.
array
An array of up to 10 rich message elements.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event type.
string
required
The ID of the event author.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The template that determines how the rich message is displayed.
array
An array of up to 10 rich message elements.
Sample Rich message in response

Custom

The Custom event contains a customizable payload.
Request
string
The custom event ID.
string
required
The event type. Must be custom.
object
The custom JSON content.
object
Custom properties organized by namespace and property name. See Properties.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event type.
string
required
The ID of the event author.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
object
The custom JSON content.
object
Custom properties organized by namespace and property name. See Properties.
Sample Custom event in response

System message

The System message event is generated by the system in specific situations.
Request
string
The custom event ID.
string
required
The event type. Must be system_message.
string
The message text.
string
required
The system message type. See System message types.
object
The variables substituted into the system message text.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event type.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
string
The message text.
string
required
The system message type. See System message types.
object
The variables substituted into the system message text.
Sample System message in response

Users

Users represent customers and agents participating in chats.

Customer

string
required
The customer ID.
string
required
The user type. Always customer.
string
The customer avatar URL.
string
The customer email address.
boolean
Whether the customer confirmed their email address.
string
The customer name.
array
Custom key-value pairs available for the duration of the customer session.
boolean
If true, the customer is present in the chat.
string
The timestamp of the most recent event seen by the customer, in RFC 3339 format. All earlier events are considered seen.
Sample Customer data structure

Agent

string
required
The agent ID.
string
required
The user type. Always agent.
string
The agent’s name.
string
required
The URL of the agent’s avatar.
boolean
If true, the agent is present in the chat.
string
The timestamp of the most recent event seen by the agent, in RFC 3339 format. All earlier events are considered seen.
string
The agent’s job title.
Sample Agent data structure

Other common structures

These structures support chats, forms, properties, and threads.

Access

array
The IDs of groups that can access the resource. Group 0 grants access to all agents.
Sample Access data structure

Chats

string
required
The chat ID.
object
The chat thread. See Threads.
array
The chat users. See Customer and Agent.
object
Custom chat properties organized by namespace and property name. See Properties.
object
The chat access settings.
Sample Chat data structure

Chat summaries

Chat summary is similar to the Chat data structure. The difference is that Chat contains a thread object, while Chat summary includes last_event_per_type.
string
required
The chat ID.
string
The ID of the most recent thread.
string
The creation timestamp of the most recent thread, in RFC 3339 format with microsecond precision.
array
The chat users. See Customer and Agent.
object
required
The most recent event of each event type, keyed by event type.
object
Custom chat properties organized by namespace and property name. See Properties.
object
The chat access settings. See Access.
boolean
required
If true, the chat’s most recent thread is active.
Sample Chat summary data structure

Forms

A template of a prechat, postchat, or a ticket form.
string
The form ID.
array
required
The fields in the form. See Form fields.
Sample Form data structure

Form fields

A component of the Form event.
array
required
The fields in the form.
Sample Form fields

Filled form fields

A component of the Filled form event.
array
required
The fields in the submitted form.
Sample Filled form fields

Properties

Properties are key-value pairs that can be set on a chat, thread, or event. For details, see the Configuration API.
Sample Properties data structure

Threads

string
required
The thread ID.
object
The thread access settings.
boolean
required
Whether the thread is active.
array
required
The IDs of users participating in the thread.
array
The events in the thread.
object
Custom thread properties organized by namespace and property name. See Properties.
object
The queue information. Present only when the chat is queued.
string
The ID of the preceding thread.
string
The ID of the following thread.
string
required
The server-generated thread creation timestamp in RFC 3339 format with microsecond precision.
Sample Thread data structure