> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/platform-service/zsp/ticket/describeticketdetail.md).

# DescribeTicketDetail

## 1. API Description

This API (DescribeTicketDetail) is used to query the details and communication records of a specified ticket.

{% hint style="info" %}
**Notes**

* You can query only the tickets submitted by the current team. Querying a ticket of another team and querying a nonexistent ticket return the same error code.
* `messages` contains only the initial description provided when the ticket was submitted in either of the following cases: the ticket status is `CREATING` (it has not been synchronized to the customer service system yet), or `contactEmail` was not specified when the ticket was submitted (it is impossible to determine which correspondence emails belong to the customer).
* `ticketId` can be obtained by calling [DescribeTickets](/api-reference/platform-service/zsp/ticket/describetickets.md), or taken from the return value of [CreateTicket](/api-reference/platform-service/zsp/ticket/createticket.md). `ticketNumber` can be obtained by calling [DescribeTickets](/api-reference/platform-service/zsp/ticket/describetickets.md).
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type   | Description                                                                                                                                                                                                                                                                                    |
| -------------- | -------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ticketId       | No       | String | <p>Ticket ID.</p><p>Specify at least one of the ticket ID and the ticket number. If both are specified, the ticket ID takes precedence.</p>                                                                                                                                                    |
| ticketNumber   | No       | String | <p>Ticket number.</p><p>Specify at least one of the ticket ID and the ticket number. If both are specified, the ticket ID takes precedence.</p><p>A ticket that is still being created (the status is CREATING) does not have a ticket number yet, so it can be queried only by ticket ID.</p> |

## 3. Output Parameters

| Parameter Name | Type                                                                                         | Description                                                                                                                                                                                                                           |
| -------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                       | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p>                                                                                                                 |
| ticketId       | String                                                                                       | Ticket ID.                                                                                                                                                                                                                            |
| ticketNumber   | String                                                                                       | <p>Ticket number.</p><p>It is null while the ticket is still being created (the status is CREATING).</p>                                                                                                                              |
| type           | [TicketType](/api-reference/platform-service/zsp/datastructure.md#tickettype)                | Ticket type.                                                                                                                                                                                                                          |
| status         | [TicketStatus](/api-reference/platform-service/zsp/datastructure.md#ticketstatus)            | Ticket status.                                                                                                                                                                                                                        |
| description    | String                                                                                       | Issue description.                                                                                                                                                                                                                    |
| contactName    | String                                                                                       | Contact name.                                                                                                                                                                                                                         |
| contactEmail   | String                                                                                       | Contact email.                                                                                                                                                                                                                        |
| contactPhone   | String                                                                                       | Contact phone number.                                                                                                                                                                                                                 |
| createTime     | String                                                                                       | Creation time.                                                                                                                                                                                                                        |
| messages       | Array of [TicketMessage](/api-reference/platform-service/zsp/datastructure.md#ticketmessage) | <p>The ticket communication records, sorted by time in descending order, with the last one being the initial description provided when the ticket was submitted.</p><p>Only the emails related to the contact email are included.</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query the details of a ticket in the processing status by ticket ID.**

```json
POST /api/v2/zsp HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeTicketDetail
<Common Request Params>

Request:
{
  "ticketId": "T-1000000000000001"
}

Response:
{
  "requestId": "T12345678-0000-0000-0000-000000000007",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000007",
    "ticketId": "T-1000000000000001",
    "ticketNumber": "00123456",
    "type": "SERVICE_FAILURE",
    "status": "PROCESSING",
    "description": "Instance vm-xxxxxxxx in region SEA-A cannot be logged in via SSH.",
    "contactName": "Alice Chen",
    "contactEmail": "alice@example.com",
    "contactPhone": "+8613800000000",
    "createTime": "2026-08-19T10:05:00Z",
    "messages": [
      {
        "subject": "Re: Service Failure - SSH login failed",
        "content": "The issue has been located as a host network policy problem. A fix is in progress and service is expected to recover within 30 minutes.",
        "fromName": "Zenlayer Support",
        "fromAddress": "support@zenlayer.com",
        "toAddress": "alice@example.com",
        "ccAddress": null,
        "messageDate": "2026-08-19T11:20:00Z"
      },
      {
        "subject": "Service Failure - SSH login failed",
        "content": "Instance vm-xxxxxxxx in region SEA-A cannot be logged in via SSH.",
        "fromName": "Alice Chen",
        "fromAddress": "alice@example.com",
        "toAddress": "consolesfapi@zenlayer.com",
        "ccAddress": null,
        "messageDate": "2026-08-19T10:05:00Z"
      }
    ]
  }
}
```

**2. Query the details of a finished ticket by ticket number.**

```json
POST /api/v2/zsp HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeTicketDetail
<Common Request Params>

Request:
{
  "ticketNumber": "00123457"
}

Response:
{
  "requestId": "T12345678-0000-0000-0000-000000000008",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000008",
    "ticketId": "T-1000000000000002",
    "ticketNumber": "00123457",
    "type": "FINANCIAL_INQUIRIES",
    "status": "FINISHED",
    "description": "The bandwidth charges in the June 2026 bill need to be rechecked.",
    "contactName": "Bob Wang",
    "contactEmail": "bob@example.com",
    "contactPhone": null,
    "createTime": "2026-08-12T09:00:00Z",
    "messages": [
      {
        "subject": "Re: Billing Inquiry",
        "content": "It has been confirmed that the cause is a billing cycle spanning two months. The bill is correct, and we have contacted you by phone.",
        "fromName": "Zenlayer Support",
        "fromAddress": "support@zenlayer.com",
        "toAddress": "bob@example.com",
        "ccAddress": null,
        "messageDate": "2026-08-13T02:10:00Z"
      },
      {
        "subject": "Billing Inquiry",
        "content": "The bandwidth charges in the June 2026 bill need to be rechecked.",
        "fromName": "Bob Wang",
        "fromAddress": "bob@example.com",
        "toAddress": "consolesfapi@zenlayer.com",
        "ccAddress": null,
        "messageDate": "2026-08-12T09:00:00Z"
      }
    ]
  }
}
```

**3. Query the details of a ticket that is still being synchronized. The ticket does not have a ticket number yet, so it can be queried only by ticket ID.**

```json
POST /api/v2/zsp HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeTicketDetail
<Common Request Params>

Request:
{
  "ticketId": "T-1000000000000003"
}

Response:
{
  "requestId": "T12345678-0000-0000-0000-000000000009",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000009",
    "ticketId": "T-1000000000000003",
    "ticketNumber": null,
    "type": "FINANCIAL_INQUIRIES",
    "status": "CREATING",
    "description": "The charges in the July 2026 bill do not match the usage.",
    "contactName": null,
    "contactEmail": null,
    "contactPhone": null,
    "createTime": "2026-08-19T14:32:00Z",
    "messages": [
      {
        "subject": "Billing Inquiry",
        "content": "The charges in the July 2026 bill do not match the usage.",
        "fromName": null,
        "fromAddress": null,
        "toAddress": "consolesfapi@zenlayer.com",
        "ccAddress": null,
        "messageDate": "2026-08-19T14:32:00Z"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                  | Description                                               |
| ---------------- | --------------------------- | --------------------------------------------------------- |
| 404              | INVALID\_TICKET\_NOT\_FOUND | The ticket does not exist.                                |
| 400              | MISSING\_TICKET\_IDENTIFIER | Neither the ticket ID nor the ticket number is specified. |
