> 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/createticket.md).

# CreateTicket

## 1. API Description

This API (CreateTicket) is used to create a ticket.

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

* After a ticket is created, it is asynchronously synchronized to the customer service system. A successful `CreateTicket` response means the ticket has been stored, at which point its status is `CREATING` and the ticket number has not been generated yet.
* If `contactName` and `contactEmail` are left empty, the name and email of the currently logged-in user are used automatically. Pass the corresponding contact information explicitly when the ticket is to be followed up by someone else.
* `contactEmail` is the only channel for subsequent communication about the ticket: if it is neither passed nor available for the currently logged-in user, you will not receive replies from customer support, and [DescribeTicketDetail](/api-reference/platform-service/zsp/ticket/describeticketdetail.md) cannot return the email correspondence records either.
* There is an upper limit on the number of tickets each team can create within one hour. You can call [DescribeTicketCreationQuota](/api-reference/platform-service/zsp/ticket/describeticketcreationquota.md) before submitting a ticket to query the remaining quota.
* The ticket type determines the impact level of the issue, so no additional priority parameter is required.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type                                                                          | Description                                                                                                                                                                                                                                                  |
| -------------- | -------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| type           | Yes      | [TicketType](/api-reference/platform-service/zsp/datastructure.md#tickettype) | Ticket type.                                                                                                                                                                                                                                                 |
| description    | Yes      | String                                                                        | <p>Issue description.</p><p>The length ranges from 1 to 4000 characters.</p>                                                                                                                                                                                 |
| contactName    | No       | String                                                                        | <p>Contact name.</p><p>If left empty, the name of the currently logged-in user is used.</p>                                                                                                                                                                  |
| contactEmail   | No       | String                                                                        | <p>Contact email.</p><p>Subsequent communication emails for the ticket are sent to this address, and the ticket details filter the email correspondence records by this address.</p><p>If left empty, the email of the currently logged-in user is used.</p> |
| contactPhone   | No       | String                                                                        | Contact phone number.                                                                                                                                                                                                                                        |

## 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 | <p>Ticket ID.</p><p>Use this ID to query the ticket details later.</p>                                                |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Create a service failure ticket.**

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

Request:
{
  "type": "SERVICE_FAILURE",
  "description": "Instance vm-xxxxxxxx in region SEA-A cannot be logged in via SSH since 2026-08-19 10:00, and port 22 times out.",
  "contactName": "Alice Chen",
  "contactEmail": "alice@example.com",
  "contactPhone": "+8613800000000"
}

Response:
{
  "requestId": "T12345678-0000-0000-0000-000000000001",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000001",
    "ticketId": "T-1000000000000001"
  }
}
```

**2. Create a billing inquiry ticket, with the contact information taken automatically from the currently logged-in user.**

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

Request:
{
  "type": "FINANCIAL_INQUIRIES",
  "description": "The inter-region bandwidth charges in the July 2026 bill do not match the usage. Please help verify."
}

Response:
{
  "requestId": "T12345678-0000-0000-0000-000000000002",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000002",
    "ticketId": "T-1000000000000003"
  }
}
```

{% 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                                                                |
| ---------------- | ------------------------------------------ | -------------------------------------------------------------------------- |
| 429              | OPERATION\_DENIED\_TICKET\_QUOTA\_EXCEEDED | The number of tickets created within one hour has reached the upper limit. |
| 500              | OPERATION\_FAILED\_TICKET\_CREATE          | Failed to create the ticket.                                               |
