1. Threads And Channels
  2. Models

Threads And Channels

Models

Thread Model

The thread represents a conversation about a specific resource.


object "thread"
The description of the model.

has_more boolean
Indicates that there are more messages in the thread than what is displayed in the recent messages list.

id string
The ID of the thread. The ID will always be predicable with the resource_id prefixed with thrd_

location_id string
The ID of the location that this thread is currently associated with. If a resource changes locations, the thread will follow it.

name string
The name of the thread.

organization_id string
The ID of the organization that owns the resource to which this thread is referenced.

recent_messages Array< Message>
The recent 150 messages in the thread. If there are more than 150 messages, the has_more property will be set to true.

resource_id string
The ID of the resource this thread is referencing. The threads use a predictable ID format that is prefixed with thrd_ and the resource ID.

subscriber_ids Array<String>
The IDs of all of the subscribers on the thread including users, organizations, and contacts.

subscribers Array< Subscriber>
Details of all subscribers on the thread.

unread_by Array<String>
A list of all users and organizations that have unread messages in the thread.

updated_at Integer
The time in epoch seconds when the thread was last updated.



Message Model

The message represents a single message in a thread or channel


object "message"
The description of the model.

created_at Integer
The time in epoch seconds when the message was created.

edited_at Integer
The time in epoch seconds when the message was edited. Only the author of the message can edit it.

event string
The event that created the message is it was a system message that created it.

id string
The ID of the message.

name string
The name of the thread.

media_urls Array.<String>
All of the URLs of attachments for this message.

publish_to_channel_at Integer>
The time when the message should be published to the channel. This allows a message to be created on the thread but not published to the channel until a later time.

reactions Array.<Object>
The ID of the resource this thread is referencing. The threads use a predictable ID format that is prefixed with thrd_ and the resource ID.

Show Details
Object.emoji String
The emoji with which a user reacted with
Object.users Array.<String>
A list of users who used this reaction. Third parties cannnot react or see reactions.

resource_id String
The ID of the resource this message is referencing.

subscriber_id String
The ID of the subscriber who created the message.

text String
The text of the message.

thread_id String
The ID of the thread that this message belongs to.

type String
The type of message. Typically when using conversations, the type will be text. However, there are other message generated by the system.

  • text: A typical message where a subscriber wrote something
  • meta: A message about the thread itself. For example, when a subscriber is added to the thread.
  • tracking_update: A system generated message to send tracking updates which will notify subscribers
  • pickup_reminder: A system generated message to send pickup reminders which will notify subscribers


Subscriber Model

The subscriber represents a user, organization, or contact that is subscribed to a thread or channel. It provides enough information to create a chat UI.


email String
The email of the subscriber.

id Integer
The ID of the subscriber. This could be the ID of a user, organization, or contact.

is_archived boolean
Indicates that the subscriber has been removed from the thread, but they may have sent a message in the thread so their information is cached here.

name string
The name of the subscriber.

phone string
The E.164 formatted phone number of the subscriber.

type string
The type of subscriber, which also indicates how the user can authenticate to the thread or channel

  • user: A user that is a member of the organization
  • api_key: This is the auth type for organizations
  • contact: A contact that is not a member of the organization

viewed_at Integer>
The last time this subscriber viewed the thread. This will always be null for contact types.



Channel Model

The channel is a communication space between internal users & organizations and external contacts. Channels are created automatically.


object "thread"
The description of the model.

has_more boolean
Indicates that there are more messages in the channel than what is displayed in the recent messages list.

id string
The ID of the channel.

name string
The name of the channel. It's typically a combination of all of the names of the subscribers.

organization_id string
The ID of the organization that owns the resource to which this thread is referenced.

pending_messages Array< Message>
The messages that are pending to be sent to the channel. These messages are not yet published to the channel.

phone_hashes Array<String>
The unique hashes of the phone numbers of all of the subscribers on the channel. This is used internally to sync the conversations via sms.

publisher_ids Array<String>
All of the resource IDs that are publishing messages to the channel.

recent_messages Array< Message>
The recent 150 messages in the thread. If there are more than 150 messages, the has_more property will be set to true.

scheduled_publish_at Integer
When the earliest message in the channel is scheduled to be published to the channel from the pending_messages list.

subscriber_hash string
The has of the subscriber IDs that make this channel unique.

subscriber_ids Array<String>
The IDs of all of the subscribers on the thread including users, organizations, and contacts.

subscribers Array< Subscriber>
Details of all subscribers on the thread.

updated_at Integer
The time in epoch seconds when the thread was last updated.