The Ticket object

A ticket is a conversation between your support agents and one of your customers.
It contains a list of messages, can be associated with tags, assigned to a user and/or a team, and also collect customer's feedback with a satisfaction survey.

Ticket properties

int32

ID of the ticket.

object

The user assigned to the ticket.

string

The channel used to initiate the conversation with the customer.

ISO 8601 datetime

When the ticket was closed.

ISO 8601 datetime

When the ticket was created.

object

The customer linked to the ticket.

array

All action-executed events with the related user if any on the ticket.

string

External ID of the ticket in a foreign system. This field is not used by Gorgias, feel free to set it as you wish.

boolean

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

boolean

Whether the ticket is unread for you.

string

The language primarily used in the ticket. The language is automatically detected on the first messages by Gorgias if not set explicitly.Once the language has been set, it won't be updated according to future messages.

ISO 8601 datetime

When the last message was sent.

ISO 8601 datetime

When the last customer's message was sent.

array

Messages of the ticket.

object

Data associated with the ticket. You can use this field to store structured information (key-value data) about the ticket.

ISO 8601 datetime

When the ticket was opened for the first time by a user.

None

Which channels can and can't be used to reply.

object

The satisfaction survey linked to the ticket.

ISO 8601 datetime

When the ticket will be re-opened.

boolean

Whether the ticket is considered as spam or not.

string

The status of the ticket.

string

The subject of the ticket.

array

Tags linked to the ticket.

ISO 8601 datetime

When the ticket was moved to the trash.

ISO 8601 datetime

When the ticket was lastly updated.

string

How the first message of the ticket has been received or sent from Gorgias.

string

URI of the ticket.

Ticket example object

{
  "id": 123,
  "assignee_user": null,
  "channel": "email",
  "closed_datetime": null,
  "created_datetime": "2019-07-05T14:42:00.384938",
  "customer": {
    "data": {
      "city": "San Francisco"
    },
    "id": 3924,
    "external_id": "customer-84203241",
    "email": "[email protected]",
    "name": "John Smith",
    "language": "fr",
    "timezone": "UTC",
    "created_datetime": "2019-04-13T03:27:56.973873",
    "updated_datetime": "2019-09-25T06:18:22.839271",
    "meta": {
      "position": "engineer"
    },
    "customer": {},
    "note": "Our best customer.",
    "active": true,
    "firstname": "John",
    "integrations": {
      "6": {
        "orders": [
          {
            "id": 772803526679,
            "total_tax": "0.02",
            "created_at": "2018-12-04T03:29:37-08:00",
            "line_items": [
              {
                "id": 1760305053719,
                "sku": "0987654321",
                "name": "Acidulous candy",
                "grams": 10,
                "price": "0.10",
                "title": "Acidulous candy",
                "taxable": true,
                "quantity": 1,
                "price_set": {
                  "shop_money": {
                    "amount": "0.10",
                    "currency_code": "USD"
                  },
                  "presentment_money": {
                    "amount": "0.10",
                    "currency_code": "USD"
                  }
                },
                "tax_lines": [
                  {
                    "rate": 0.2,
                    "price": "0.02",
                    "title": "TVA",
                    "price_set": {
                      "shop_money": {
                        "amount": "0.02",
                        "currency_code": "USD"
                      },
                      "presentment_money": {
                        "amount": "0.02",
                        "currency_code": "USD"
                      }
                    }
                  }
                ],
                "product_id": 8345093387,
                "variant_id": 28442938955,
                "total_discount": "0.00",
                "requires_shipping": true,
                "fulfillment_status": null,
                "total_discount_set": {
                  "shop_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                  },
                  "presentment_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                  }
                },
                "fulfillment_service": "manual",
                "fulfillable_quantity": 1
              }
            ],
            "contact_email": "[email protected]",
            "billing_address": {
              "zip": "94103",
              "city": "SAN FRANCISCO",
              "name": "Marie Curie",
              "country": "United States",
              "address1": "52 Washburn Street",
              "address2": "",
              "province": "California",
              "last_name": "Curie",
              "first_name": "Marie",
              "country_code": "US",
              "province_code": "CA"
            }
          }
        ],
        "customer": {
          "id": 667928133655,
          "note": "",
          "tags": "",
          "email": "[email protected]",
          "first_name": "Marie",
          "last_name": "Curie",
          "orders_count": 1,
          "default_address": {
            "id": 707106144279,
            "zip": "94103",
            "city": "SAN FRANCISCO",
            "name": "Marie Curie",
            "country": "United States",
            "default": true,
            "address1": "52 Washburn Street",
            "address2": "",
            "province": "California",
            "last_name": "Curie",
            "first_name": "Marie",
            "customer_id": 667928133655,
            "country_code": "US",
            "country_name": "United States",
            "province_code": "CA"
          }
        },
        "__integration_type__": "shopify"
      }
    },
    "lastname": "Smith"
  },
  "events": [
    {
      "user": {
        "id": 3924,
        "external_id": "user-84203241",
        "email": "[email protected]",
        "bio": "Full stack developer at Gorgias",
        "name": "Steve Frazelli",
        "created_datetime": "2019-04-13T03:27:56.973873",
        "updated_datetime": "2019-09-25T06:18:22.839271",
        "meta": {
          "avatar_url": "https://avatars.example.com/steve-profile.jpeg",
          "position": "engineer"
        },
        "account_id": 69392,
        "active": true,
        "firstname": "Steve",
        "has_password": true,
        "has_2fa_enabled": false,
        "lastname": "Frazeli",
        "role": {
          "id": 43728,
          "name": "admin"
        }
      },
      "type": "ticket-closed",
      "data": null,
      "id": 1234,
      "uri": "/api/events/1234/",
      "context": "dd4ff312-69df-494a-be96-1a58b3d8b8e0",
      "created_datetime": "2019-11-16T15:59:41.966927",
      "object_id": 123,
      "object_type": "Ticket",
      "user_id": 123
    }
  ],
  "external_id": "RETURN#4213",
  "is_unread": true,
  "language": "fr",
  "last_message_datetime": "2020-02-01T19:12:32.432197",
  "last_received_message_datetime": "2020-01-27T10:42:21.468912",
  "messages": {
    "macros": [
      {
        "id": 5132
      }
    ],
    "id": 924712,
    "external_id": "MSG-78545",
    "message_id": "<[email protected]>",
    "public": true,
    "channel": "email",
    "via": "api",
    "source": {
      "type": "email",
      "from": {
        "id": 7,
        "name": "Sender Doe",
        "address": "[email protected]"
      },
      "to": [
        {
          "id": 8,
          "name": "Receiver Doe",
          "address": "[email protected]"
        }
      ]
    },
    "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        ",
    "stripped_text": null,
    "stripped_html": null,
    "stripped_signature": null,
    "attachments": [],
    "meta": {},
    "created_datetime": "2020-01-27T10:42:21.468912",
    "opened_datetime": "2019-07-05T15:22:46.472436",
    "failed_datetime": null,
    "deleted_datetime": null,
    "actions": [],
    "uri": "/api/tickets/12/messages/924712/",
    "integration_id": 28643,
    "rule_id": 89465,
    "ticket_id": 12,
    "from_agent": true,
    "sender": {
      "id": 7
    },
    "receiver": {
      "id": 8
    },
    "headers": {},
    "last_sending_error": null
  },
  "meta": {},
  "opened_datetime": "2019-07-05T15:22:46.472436",
  "satisfaction_survey": {
    "id": 1234,
    "score": 2,
    "body_text": "Such speed, much pertinent.",
    "meta": {
      "externalData": {
        "id": 1234
      }
    },
    "created_datetime": "2019-11-16T15:59:41.966927",
    "should_send_datetime": "2019-11-23T15:59:41.966927",
    "sent_datetime": "2019-11-23T15:59:41.966927",
    "scored_datetime": "2019-11-25T15:59:41.966927",
    "uri": "/api/satisfaction-surveys/1234/",
    "customer_id": 120,
    "ticket_id": 12
  },
  "snooze_datetime": null,
  "spam": false,
  "status": "open",
  "subject": "Can I get a refund?",
  "tags": [
    {
      "name": "urgent",
      "description": "Mark a ticket as urgent",
      "usage": 123,
      "decoration": {
        "color": "#F58D86"
      },
      "created_datetime": "2020-07-1300:00:00-05:00",
      "deleted_datetime": "2020-07-1500:00:00-05:00"
    }
  ],
  "trashed_datetime": null,
  "updated_datetime": "2020-01-27T10:42:21.932637",
  "via": "email",
  "uri": "/api/tickets/123/"
}