Events
Events are sent to a chat through thesend_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 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.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.
boolean
Whether the event is deleted. This field is visible only to users with the
administrator or viceowner role.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.
string
required
The event visibility.
object
Custom properties organized by namespace and property name. See Properties.
string
required
The template that determines how the rich message is displayed.
array
required
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
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.
string
The custom event ID.
string
required
The system that generated the event. See System event
sources.
string
required
The event type. Always
system.string
required
The system event subtype. See System event
subtypes.
integer
required
The system event schema version.
string
required
The JSON-encoded event details.
string
required
The event creation timestamp in RFC 3339 format with microsecond precision.
Sample System event 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 email address suggested from tracked customer activity, such as a form
submission. The customer has not confirmed this address. It is independent
of
email and isn’t used for identity merging or segment membership,
including built-in lead segments.string
The customer name.
string
The customer phone number.
array
Custom key-value pairs available for the duration of the customer session.
object
The customer’s omnichannel data.
object
The customer’s address data.
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
Custom chat properties organized by namespace and property name. See
Properties.
object
The chat access settings.
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.
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 chat’s most recent thread is active.Sample Chat info 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