The TicketMessage object

A ticket-message represents a message (an email, an SMS, a Facebook comment, chat message, etc..) under a normalized format.
There are 3 types of messages:

  • Outgoing messages: messages sent by your company (by rules or support agents) to your customers.
  • Incoming messages: messages sent by your customers to your company.
  • Internal notes: internal messages sent between support agents (users). Internal notes are not sent/shared with your customers.

A ticket-message is associated with only one ticket.

TicketMessage properties

integer

ID of the message.

string

URI of the message.

string | null

ID of the message on the service that sent the message.It can be the ID of an email, a Messenger message, a Facebook comment, etc...

integer

The ID of the ticket the message is associated with.

string | null

ID of the message in a foreign system (Aircall, Zendesk, etc...). This field is not used by Gorgias, feel free to set it as you wish.

boolean

Whether the message was sent/receive by a customer. Internal notes are not public.

LegacyChannelSlug | string

The channel used to send the message.

None

How the message has been received, or sent from Gorgias.

TicketMessageSource | null

Information used to route the message. It contains the names and the addresses of the sender and receivers.

None

The person who sent the message. It can be a user or a customer.

TicketMessageAuthCustomerIdentity | null

Identity of the authenticated customer, if any, in the context of a message sent on a channel that does not require authentication such as email, SMS or Gorgias chat.This attribute is used to differentiate messages sent by unauthenticated and authenticated customers.

integer | null

ID of the integration that either received or sent the message.

array
None
integer | null

ID of the rule which sent the message, if any.

boolean

Whether the message was sent by your company to a customer, or the opposite.

TicketMessageUserOrCustomer | null

The primary receiver of the message. It can be a user or a customer. Optional when the source type is "internal-note".

string | null

The subject of the message.

string | null

The full text version of the body of the message, if any.

string | null

The full HTML version of the body of the message, if any.

string | null

The URL to download the archived body of the email message. Empty until the body is archived, 30 days after it was sent or received. Only applies to email messages that have stripped bodies.

string | null

The text version of the body of the message without email signatures and previous replies.

string | null

The HTML version of the body of the message without email signatures and previous replies.

string | null
None
array | null

A list of files attached to the message.

array | null

A list of macros.

array | null

A list of actions executed before the message was sent. These actions are set by macros.

object | null

Message headers. Used for email messages.

boolean | null

Whether the message was created by a historical import.

null

Metadata associated with the message.

You can use this field to store structured information (key-value data) about the message.

Reserved keys:

  • current_page: The page from where the user is currently chatting.
  • relevant_content_indexes: Indexes containing relevant text of the message.
  • is_quick_reply: Whether the message is a "quick reply".
  • campaigns: ID of the chat campaign the message is replying to.
  • campaigns_id: ID of the chat campaign that sent this message.
  • self_service_flow: An object containing metadata of the self-service flow associated to the message.
ISO 8601 datetime

When the message was created.

string | null

When the message was processed by Gorgias. Differs from created_datetime which refers to the external service.

string | null

When the message was deleted.

string | null

When the message was sent. If omitted, the message will be sent by Gorgias.

string | null

When the message failed to be sent. Messages that couldn't be sent can be resend.

string | null

When the message was opened by the primary receiver.

TicketMessageSendingError | null

Details of the last error encountered when Gorgias attempted to send the message.

boolean

It determines if the message can be retried or not.

TicketMessageRepliedByOrTo | null

The message designated as a response to the current message. This field is temporary and only provided to the web app.

TicketMessageRepliedByOrTo | null

The message designated as replied by the current message. This field is temporary and only provided to the web app.

TicketMessage example object

{
  "id": 924712,
  "message_id": "<123345676453.2445.234@web>",
  "ticket_id": 12,
  "external_id": "MSG-78545",
  "public": true,
  "channel": "email",
  "via": "api",
  "source": {
    "from": {
      "address": "[email protected]",
      "id": 7,
      "name": "Sender Doe"
    },
    "to": [
      {
        "address": "[email protected]",
        "id": 8,
        "name": "Receiver Doe"
      }
    ],
    "type": "email"
  },
  "sender": {
    "id": 93
  },
  "integration_id": 28643,
  "rule_id": 89465,
  "from_agent": true,
  "receiver": {
    "id": 8
  },
  "subject": "Re:Refund request",
  "body_text": "Hello,\n\n        I can't place an order on your site, it says: I don't have enough credit.\n        How can I add some credits?\n\n        Cheers,\n        John Doe\n        ",
  "body_html": "Hello,<br><br>\n\n            I can't place an order on your site, it says: I don't have enough credit.<br>\n            How can I add some credits?<br><br>\n\n            Cheers,<br>\n            John Doe\n            ",
  "attachments": [],
  "macros": [],
  "actions": [],
  "headers": {
    "My-Header": "foo"
  },
  "imported": false,
  "meta": {},
  "created_datetime": "2020-01-27T10:42:21.468912",
  "processed_datetime": "2020-01-27T10:42:21.468912",
  "deleted_datetime": "2020-01-27T10:42:21.468912",
  "opened_datetime": "2019-07-05T15:22:46.472436"
}