Tickets

Retrieve a ticket

Changed on
get/api/tickets/{id}

Request

Path parameters

idinteger required

The ID of the ticket to retrieve.

Query parameters

relationshipsTicketExtraAttribute[]

Names of relations that should be included in returned data.

Response

The requested ticket.

idinteger required

ID of the ticket.

uristring required

URI of the ticket.

external_idstring required

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

status'open' | 'closed'
via'aircall' | 'api' | 'chat' | 'contact_form' | 'email' | 'facebook' | 'facebook-mention' | 'facebook-messenger' | 'facebook-recommendations' | 'form' | 'gorgias_chat' | 'help-center' | 'helpdesk' | 'instagram' | 'instagram-ad-comment' | 'instagram-comment' | 'instagram-direct-message' | 'instagram-mention' | 'internal-note' | 'offline_capture' | 'phone' | 'rule' | 'self_service' | 'shopify' | 'sms' | 'twilio' | 'twitter' | 'twitter-direct-message' | 'whatsapp' | 'yotpo' | 'yotpo-review' | 'zendesk' required
from_agentboolean required

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

spamboolean required

Whether the ticket is considered as spam or not.

importedboolean required

Whether the ticket was created by a historical import.

languagestring required

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.

subjectstring required

The subject of the ticket.

metaunknown required
custom_fieldsobject

The custom fields associated with the ticket.

created_datetimestring date-time required

When the ticket was created.

processed_datetimestring date-time required

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

opened_datetimestring date-time required

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

last_received_message_datetimestring date-time required

When the last customer's message was sent.

last_message_datetimestring date-time required

When the last message was sent.

updated_datetimestring date-time required

When the ticket was lastly updated.

closed_datetimestring date-time required

When the ticket was closed.

trashed_datetimestring date-time required

When the ticket was moved to the trash.

snooze_datetimestring date-time required

When the ticket will be re-opened.

reply_optionsobject required
is_unreadboolean required

Whether the ticket is unread for you.

Example response

{
  "id": 123,
  "external_id": "RETURN#4213",
  "events": [
    {
      "created_datetime": "2019-11-16T15:59:41.966927",
      "data": null,
      "id": 1234,
      "type": "ticket-closed",
      "user": {
        "email": "steve@company.com",
        "firstname": "Steve",
        "id": 3924,
        "lastname": "Frazeli",
        "name": "Steve Frazelli"
      }
    }
  ],
  "customer": {
    "id": 3924,
    "email": "john@example.com",
    "name": "John Smith",
    "firstname": "John",
    "lastname": "Smith",
    "meta": {
      "position": "engineer"
    },
    "channels": [
      {
        "type": "email",
        "address": "marie@gorgias.io",
        "user": {
          "name": "John Smith"
        },
        "customer": {
          "name": "John Smith"
        }
      }
    ],
    "integrations": {
      "6": {
        "__integration_type__": "shopify",
        "customer": {
          "default_address": {
            "address1": "52 Washburn Street",
            "address2": "",
            "city": "SAN FRANCISCO",
            "country": "United States",
            "country_code": "US",
            "country_name": "United States",
            "customer_id": 667928133655,
            "default": true,
            "first_name": "Marie",
            "id": 707106144279,
            "last_name": "Curie",
            "name": "Marie Curie",
            "province": "California",
            "province_code": "CA",
            "zip": "94103"
          },
          "email": "marie@gorgias.io",
          "first_name": "Marie",
          "id": 667928133655,
          "last_name": "Curie",
          "note": "",
          "orders_count": 1,
          "tags": ""
        },
        "orders": [
          {
            "billing_address": {
              "address1": "52 Washburn Street",
              "address2": "",
              "city": "SAN FRANCISCO",
              "country": "United States",
              "country_code": "US",
              "first_name": "Marie",
              "last_name": "Curie",
              "name": "Marie Curie",
              "province": "California",
              "province_code": "CA",
              "zip": "94103"
            },
            "contact_email": "marie@gorgias.io",
            "created_at": "2018-12-04T03:29:37-08:00",
            "id": 772803526679,
            "line_items": [
              {
                "fulfillable_quantity": 1,
                "fulfillment_service": "manual",
                "fulfillment_status": null,
                "grams": 10,
                "id": 1760305053719,
                "name": "Acidulous candy",
                "price": "0.10",
                "price_set": {
                  "presentment_money": {
                    "amount": "0.10",
                    "currency_code": "USD"
                  },
                  "shop_money": {
                    "amount": "0.10",
                    "currency_code": "USD"
                  }
                },
                "product_id": 8345093387,
                "quantity": 1,
                "requires_shipping": true,
                "sku": "0987654321",
                "tax_lines": [
                  {
                    "price": "0.02",
                    "price_set": {
                      "presentment_money": {
                        "amount": "0.02",
                        "currency_code": "USD"
                      },
                      "shop_money": {
                        "amount": "0.02",
                        "currency_code": "USD"
                      }
                    },
                    "rate": 0.2,
                    "title": "tva"
                  }
                ],
                "taxable": true,
                "title": "acidulous candy",
                "total_discount": "0.00",
                "total_discount_set": {
                  "presentment_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                  },
                  "shop_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                  }
                },
                "variant_id": 28442938955
              }
            ],
            "total_tax": "0.02"
          }
        ]
      }
    },
    "external_id": "customer-84203241",
    "note": "Our best customer."
  },
  "assignee_user": {
    "id": 3924,
    "email": "steve@company.com",
    "name": "Steve Frazelli",
    "firstname": "Steve",
    "lastname": "Frazeli",
    "meta": {
      "avatar_url": "https://avatars.example.com/steve-profile.jpeg",
      "position": "engineer"
    },
    "bio": "Full stack developer at Gorgias"
  },
  "language": "fr",
  "subject": "Can I get a refund?",
  "summary": {
    "content": "The customer is asking for a refund.",
    "created_datetime": "2020-01-27T10:42:21.932637",
    "updated_datetime": "2020-01-27T10:42:21.932637",
    "triggered_by": 1
  },
  "tags": [
    {
      "decoration": {
        "color": "#F58D86"
      },
      "name": "urgent"
    }
  ],
  "messages": [
    {
      "id": 924712,
      "message_id": "<123345676453.2445.234@web>",
      "ticket_id": 12,
      "external_id": "MSG-78545",
      "public": true,
      "integration_id": 28643,
      "intents": [
        {
          "name": "discount/request"
        }
      ],
      "rule_id": 89465,
      "from_agent": true,
      "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"
      },
      "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",
      "replied_by": {
        "integration_id": 28643,
        "created_datetime": "2020-01-27T10:42:21.468912",
        "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        "
      },
      "replied_to": {
        "integration_id": 28643,
        "created_datetime": "2020-01-27T10:42:21.468912",
        "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        "
      }
    }
  ],
  "created_datetime": "2019-07-05T14:42:00.384938",
  "processed_datetime": "2019-07-05T14:42:00.384938",
  "opened_datetime": "2019-07-05T15:22:46.472436",
  "last_received_message_datetime": "2020-01-27T10:42:21.468912",
  "last_message_datetime": "2020-02-01T19:12:32.432197",
  "updated_datetime": "2020-01-27T10:42:21.932637",
  "satisfaction_survey": {
    "id": 1234,
    "customer_id": 120,
    "ticket_id": 12,
    "sent_datetime": "2019-11-23T15:59:41.966927",
    "scored_datetime": "2019-11-25T15:59:41.966927",
    "should_send_datetime": "2019-11-23T15:59:41.966927",
    "created_datetime": "2019-11-16T15:59:41.966927",
    "score": 2,
    "body_text": "Such speed, much pertinent.",
    "meta": {
      "externalData": {
        "id": 1234
      }
    }
  },
  "is_unread": true
}

Changes