Events
Events are sent to a chat through thesend_event method.
File
The File event indicates about an uploaded file.Request
string
The custom event ID.
string
required
The event type. Must be
file.string
default:"all"
The event visibility. Possible values:
all, agents.object
Custom event 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 an image.
Response
string
required
The event ID.
string
The custom event ID.
string
required
The event creation timestamp in UTC with microsecond precision.
string
required
The event type.
string
required
The ID of the event author.
string
required
The event visibility.
object
Custom event 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.
boolean
If
true, the event is deleted. This field is visible only to users with
the administrator or viceowner role.Sample File in response
Form
The Form event contains an empty form to be filled out by the customer. It doesn’t matter how the form is configured or what fields it has — it can be any event of typeform. 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.string
default:"all"
The event visibility. Possible values:
all, agents.object
Custom event 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
required
The ID of the event author.
string
required
The event visibility.
object
Custom event 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.
boolean
If
true, the event is deleted. This field is visible only to users with
the administrator or viceowner role.Sample Form in response
Filled form
The Filled form event contains data from a form (prechat or postchat survey).Request
string
The custom event ID.
string
required
The event type. Must be
filled_form.string
default:"all"
The event visibility. Possible values:
all, agents.object
Custom event properties organized by namespace and property name. See
Properties.
string
required
The form ID.
array
required
The completed form fields. 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.
string
required
The event visibility.
object
Custom event 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 completed form fields. See Filled form fields.
boolean
If
true, the event is deleted. This field is visible only to users with
the administrator or viceowner role.Sample Filled form in response
Message
The Message event contains a text message to other chat users.Request
string
The custom event ID.
string
required
The message text. The raw text can be up to 16 KB. A single UTF-8 character
can use up to 4 bytes. Split longer text into multiple messages.
string
required
The event type. Must be
message.string
default:"all"
The event visibility. Possible values:
all, agents.object
Custom event properties organized by namespace and property name. See
Properties.
object
The postback that generated the message in response to a rich message.
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. Always
message.string
required
The ID of the event author.
string
required
The event visibility.
string
required
The message text.
object
The rich message postback that triggered the message.
object
Custom event properties organized by namespace and property name. See
Properties.
boolean
If
true, the event is deleted. This field is visible only to users with
the administrator or viceowner role.Sample Message in response
Rich message
Rich message (RM) event contains a rich message data structure.Request
string
The custom event ID.
string
required
The event type. Must be
rich_message.string
default:"all"
The event visibility. Possible values:
all, agents.object
Custom event 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, ecommerce.array
An array of up to 10 rich message elements.
Response
string
required
The server-generated event ID.
string
The custom event ID.
string
required
The event type.
string
required
The server-generated ID of the event author.
string
required
The server-generated event creation timestamp in UTC with microsecond
precision.
string
required
The event visibility.
object
Custom event properties organized by namespace and property name. See
Properties.
string
required
The template that determines how the rich message is displayed.
array
required
The rich message elements.
Sample Rich message in response
Custom
Custom event is an event with customizable payload.Request
string
The custom event ID.
string
required
The event type. Must be
custom.object
The custom JSON content.
string
default:"all"
The event visibility. Possible values:
all, agents.object
Custom event properties organized by namespace and property name. See
Properties.
Response
string
required
The event ID generated by the server.
string
The custom event ID.
string
required
The event type.
string
required
The ID of the event author generated by the server.
string
required
The event creation timestamp generated by the server in RFC 3339 format with
microsecond precision.
object
The custom JSON content.
string
required
The event visibility.
object
Custom event properties organized by namespace and property name. See
Properties.
boolean
If
true, the event is deleted. This field is visible only to users with
the administrator or viceowner role.Sample Custom event in response
System message
System message event is a native system event sent in specific situations.Request
string
The custom event ID.
string
required
The event type. Must be
system_message.string
The text displayed to recipients.
string
required
The system message type. See System message
types.
string
default:"agents"
The event visibility. Possible values:
all, agents.object
The variables substituted into the system message text.
Response
string
required
The event ID generated by the server.
string
The custom event ID.
string
required
The event type.
string
required
The event creation timestamp generated by the server in RFC 3339 format with
microsecond precision.
string
The text displayed to recipients.
string
required
The system message type. See System message
types.
string
required
The event visibility.
object
The variables substituted into the system message text.
Sample System message in response
System
System event is an extension and a future replacement for System message. Similarly, it is a native system event sent in specific situations. Request It is not possible to send a System event in API version 3.7.Response
string
required
The event ID generated by the server.
string
The custom event ID.
string
required
The system event source.
string
required
The event type. Always
system.string
required
The system event subtype.
integer
required
The system event schema version.
string
required
The JSON-encoded event details.
string
required
The event creation timestamp generated by the server in RFC 3339 format with
microsecond precision.
string
required
The event visibility.
Sample System event in response
Users
Users represent agents and customers participating in chats.Agent
Fields
string
required
The agent ID.
string
required
The user type. Always
agent.string
The agent’s name.
string
The agent’s email address.
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
required
The URL of the agent’s avatar.
string
required
The agent’s visibility. Possible values:
all, agents.Sample agent data structure
My profile
Fields
string
required
The agent ID.
string
required
The user type. Always
agent.string
The agent’s name.
string
The agent’s email address.
boolean
If
true, the agent is present in the chat.string
required
The URL of the agent’s avatar.
string
The agent’s routing status. Possible values:
accepting_chats,
not_accepting_chats, offline. The offline value applies only to bot
agents.string
The timestamp of the most recent event seen by the agent, in RFC 3339
format. All earlier events are considered seen.
string
required
The agent’s role. Possible values:
normal, administrator, viceowner,
owner.Sample My profile data structure
Customer
Fields
string
required
The customer ID.
string
required
The user type. Always
customer.string
The date and time of the last event created by an agent in the customer’s
chats.
string
The URL of the customer’s avatar.
string
The date and time of the last event created by the customer.
string
The date and time when the customer’s identity was created.
string
The customer’s email address.
boolean
If
true, the customer confirmed their email address.string
The email address suggested for the customer based on tracked activity,
such as a form submission. The customer has not confirmed this address.
This field is independent of
email and is not used for identity merging
or segment membership, including built-in lead segments.array
An array of custom key-value objects available for the session duration.
string
The customer’s name.
string
The customer’s phone number.
string
The timestamp of the most recent event seen by the customer, in RFC 3339
format. All earlier events are considered seen.
object
Geolocation and page-view data from the customer’s most recent online
visit.
boolean
If
true, the customer is present in the chat.object
Counters and activity timestamps for the customer.
object
The customer’s identities on supported messaging channels.
array
The customer’s shopping carts.
object
The customer’s address data.
object
The customer’s property values, keyed by customer property ID.
string
The customer’s relationship level. Possible values:
vip.array
The customer’s segment memberships.
string
The customer’s internal LC2 identifier.
boolean
required
If
true, the requester follows the customer.boolean
required
If
true, the customer is online.array
The IDs of groups associated with the customer.
array
The customer’s tickets.
string
The customer’s activity state. This field is omitted when the activity state
is unavailable. Possible values:
unknown, browsing, queued, invited,
chatting, chat closed, offline.Sample Customer data structure
Cart
Fields
string
required
Unique identifier of the store.
string
required
The store platform, such as
shopify.boolean
required
If
true, the customer is signed in to the store.number
required
The cart subtotal in the original currency.
number
required
The cart total in the original currency.
number
required
The cart subtotal converted to United States dollars.
number
required
The cart total converted to United States dollars.
string
required
The ISO 4217 currency code.
array
required
The items in the cart.
string
required
The date and time when the cart was last updated, in RFC 3339 format.
Sample Cart data structure
Cart item
Fields
integer
required
The item ID.
integer
required
The quantity of the item in the cart.
integer
required
The product variant ID.
Sample cart item data structure
Customer property
Customer properties are identified by the UUID generated in the Create customer property definition method. The property’s type is set on creation.Fields
any
required
The current property value. Its type is determined by the property
definition’s
CustomerPropertyType.string
required
The date and time when the value was last updated, in RFC 3339 format.
string
The account ID of the agent who last set the value.
string
The client ID of the app that last set the value.
Sample customer property data structure
Segment membership
A segment membership records whether a customer satisfies a segment definition. For more information, see Customer segments.Sample Segment membership data structure
Fields
integer
required
The segment definition ID.
boolean
required
If
true, the customer meets all conditions of the segment.string
The date and time when
is_member last changed. This field is returned if
the customer belonged to the segment at least once.array
Account IDs of agents credited with the customer joining the segment. This
field is returned when an agent’s change added the customer to the segment.
object
An object where the keys are the names of the conditions the customer meets
(for example,
email_set) and the values are condition provenance objects.Other common structures
These structures describe shared objects used throughout the Agent Chat API.Access
Fields
array
The IDs of groups with access. The
0 value grants access to all agents.Sample Access data structure
Chats
Fields
string
required
The chat ID.
object
Custom chat properties organized by namespace and property name.
object
The groups that can access the chat.
boolean
required
If
true, the requester follows the chat.Sample Chat data structure
Chat info
Chat info is similar to the Chat data structure. The difference is that Chat contains athread object, while Chat info includes last_thread_info.
When you have no access to the thread, last_thread_info contains a restricted_access field instead of last_event_per_type.
Fields
string
required
The chat ID.
object
Information about the most recent thread.
object
Custom chat properties organized by namespace and property name. See
Properties.
boolean
required
If
true, the requester follows the chat.Sample Chat info data structure
Sample restricted Chat info data structure
Form fields
A component of the Form event.Fields
array
required
The fields in the form.
Sample Form fields
Filled form fields
A component of the Filled form event.Fields
array
required
The completed fields in the form.
Sample Filled form fields
Properties
Properties are key-value stores. You can set them on a chat, thread, or event. For more information, see the Configuration API documentation.Fields
object
The custom properties in the namespace.
Sample Properties data structure
Threads
Fields
string
required
The thread ID.
object
The groups that can access the thread.
boolean
required
If
true, the thread is active. If false, the thread is inactive.array
The IDs of users participating in the thread.
array
The events in the thread. This field is absent when
restricted_access is
present.object
The AI-generated thread summary. This field is present only for inactive
threads when the
auto_summary_enabled
chat property is enabled or when the summary was requested through
Request thread summary.object
Custom thread properties organized by namespace and property name.
string
The reason access to the thread is restricted.
object
The thread’s queue information. This field is present while the chat is
waiting for an available agent.
integer
The total time the chat spent in queues, in seconds.
string
The preceding thread ID.
string
The following thread ID.
string
The preceding thread ID accessible to the requester. This field is returned
by
list_archives.string
The following thread ID accessible to the requester. This field is returned
by
list_archives.string
required
The server-generated thread creation timestamp in RFC 3339 format with
microsecond precision.
array
The thread tags. This field is returned when the thread has at least one
tag.
object
The customer’s network, browser, and geolocation data for the thread.
Sample Thread data structure
Sample restricted Thread data structure
Sample Thread with legacy summary
Thread summary
Text generates thread summaries with"version": 1. A stored summary without version uses the legacy format.
- Version 1
- Version 0 (legacy)
Fields
string
required
The summary generation status. Possible values:
ok, error.integer
required
The summary format version. Must be
1.object
required
The structured summary content.
string
required
The date and time when the summary was last updated, in RFC 3339 format
with microsecond precision.
Sample thread summary data structure
Deleted event
The Deleted Event is returned to agents with thenormal role in place of the original event.
Fields
string
required
The event ID.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
string
required
The original event type.
string
required
The event visibility. Possible values:
all, agents.boolean
required
If
true, the event is deleted.string
The ID of the event author.
string
The custom event ID.
Sample Deleted event in response