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.
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.
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.
Sample Filled form in response
Message
The Message event contains 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.
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.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
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.
Sample Custom event in response
System message
System message event is 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
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
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 most recent event created by an agent in the
customer’s chats, in RFC 3339 format.
string
The URL of the customer’s avatar.
string
The date and time of the most recent event created by the customer, in RFC
3339 format.
string
The date and time when the customer’s identity was created, in RFC 3339
format.
string
The customer’s email address.
boolean
Whether the customer confirmed their email address. See Request email
verification.
array
Custom key-value pairs available for the duration of the session.
string
The customer’s name.
string
The date and time of the most recent event seen by the customer, in RFC
3339 format. All earlier events are considered seen.
object
The customer’s most recent visit.
boolean
Whether the customer is currently connected to the chat.
object
The customer’s activity counters.
Sample Customer data structure
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 summaries
Chat summary is similar to the Chat data structure. The difference is that Chat contains athread object, while Chat summary includes last_thread_summary and last_event_per_type.
Fields
string
required
The chat ID.
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.
boolean
required
If
true, the requester follows the chat.Sample Chat summary 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
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.
Sample Thread data structure
Sample restricted Thread data structure