Events
Events are sent to a chat through thesend_event method and returned in chat and thread responses.
An event can include a recipients field that limits who it’s visible to. Possible values are all and agents. The field is optional when sending an event. It’s returned on events read from the archives, where messages are reported as all; it’s not returned on events delivered through RTM pushes.
File
The File event represents an uploaded file.Request
Custom properties organized by namespace and property name. See
Properties.
The file URL. It must point to the Text CDN. Use the URL returned by
upload_file.Response
Custom properties organized by namespace and property name. See
Properties.
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
Custom properties organized by namespace and property name. See Properties.
The fields in the form. See Form fields.
Response
Custom properties organized by namespace and property name. See Properties.
The form type. Common values include
prechat, postchat, and ask_for_email. This field is absent from chats started before the field was introduced.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
Custom properties organized by namespace and property name. See Properties.
The fields in the form. See Filled form fields.
Response
Custom properties organized by namespace and property name. See Properties.
The form type. Common values include
prechat, postchat, and ask_for_email. This field is absent from chats started before the field was introduced.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
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.
Custom properties organized by namespace and property name. See Properties.
Response
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
Custom properties organized by namespace and property name. See Properties.
The template that determines how the rich message is displayed. Possible values:
cards, sticker, quick_replies.Response
Custom properties organized by namespace and property name. See Properties.
Sample Rich message in response
Custom
The Custom event contains a customizable payload.Request
Custom properties organized by namespace and property name. See
Properties.
Response
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
The system message type. See System message
types.
Response
Custom properties organized by namespace and property name. See
Properties.
The system message type. See System message
types.
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
The system that generated the event. See System event
sources.
Custom properties organized by namespace and property name. See
Properties.
The system event subtype. See System event
subtypes.
Sample System event in response
Users
Users represent customers and agents participating in chats.Customer
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.The phone number suggested for the customer based on tracked activity,
such as a form submission. The customer has not confirmed this number.
This field is independent of
phone_number and is not used for identity merging
or segment membership, including built-in lead segments.If
true, the customer’s name is a placeholder set by Text according to the
organization’s language settings, including custom translations.Sample Customer data structure
Agent
The timestamp of the most recent event seen by the agent, in RFC 3339
format. All earlier events are considered seen.
Sample Agent data structure
Other common structures
These structures support chats, forms, properties, and threads.Access
Sample Access data structure
Chats
The chat thread. See Threads.
Custom chat properties organized by namespace and property name. See
Properties.
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.
Custom chat properties organized by namespace and property name. See
Properties.
The chat access settings. See Access.
Sample Chat info data structure
Forms
A template of a prechat, postchat, or a ticket form.The fields in the form. See Form fields.
Sample Form data structure
Form fields
A component of the Form event.Sample Form fields
Filled form fields
A component of the Filled form event.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
Custom thread properties organized by namespace and property name. See
Properties.
Sample Thread data structure