Logo Site EngageLab Mark Colored Transparent
Document

Create a Ticket

Developers can create a ticket through the API. After the ticket is created, the ticket ID is returned.

Request Method

POST

Endpoint

https://livedesk-api.engagelab.com/api/v2/accounts/tickets

Authentication

For details, see the authentication instructions in API Overview.

Request

Request Example

curl -X POST 'https://livedesk-api.engagelab.com/api/v2/accounts/tickets' \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic base64(api_key:api_secret)' \ -d '{ "title": "Printer paper jam, unable to print", "description": "The customer reported that A4 paper is stuck at the paper outlet and requires urgent attention.", "attachments": [ { "file_url": "https://example.com/files/error.jpg" } ], "requester": { "euid": "contact_12345", "channel_contacts": { "channel_id": "inbox_100", "contact_id": "-1001234567890", "sub_contact_id": "23232323", "followers": [ { "id": "7562646527", "name": "Zhang San" } ] } }, "submitter": { "id": "u_12345" }, "assignment_team": "IT Support", "priority": "high", "ticket_type": "incident", "custom_fields": { "device_sn": "PRN-2024-001", "location": "Beijing Headquarters—3rd Floor Printer Room" } }'
              
              curl -X POST 'https://livedesk-api.engagelab.com/api/v2/accounts/tickets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
-d '{
  "title": "Printer paper jam, unable to print",
  "description": "The customer reported that A4 paper is stuck at the paper outlet and requires urgent attention.",
  "attachments": [
    {
      "file_url": "https://example.com/files/error.jpg"
    }
  ],
  "requester": {
    "euid": "contact_12345",
    "channel_contacts": {
      "channel_id": "inbox_100",
      "contact_id": "-1001234567890",
      "sub_contact_id": "23232323",
      "followers": [
        {
          "id": "7562646527",
          "name": "Zhang San"
        }
      ]
    }
  },
  "submitter": {
    "id": "u_12345"
  },
  "assignment_team": "IT Support",
  "priority": "high",
  "ticket_type": "incident",
  "custom_fields": {
    "device_sn": "PRN-2024-001",
    "location": "Beijing Headquarters—3rd Floor Printer Room"
  }
}'

            
This code block in the floating window

Request Headers

Field Type Description
Authorization string Authenticate using Authorization: Basic base64(API Key:API Secret). Go to the API Keys page to obtain the API key and API secret, connect them with a colon, and encode them in Base64.
Content-Type application/json Data type. The value must be application/json.

Request Body Parameters

Field Type Required Description
title String Yes Ticket title.
description String No Ticket description. Supports Markdown format.
attachments Array No Attachment array. Upload the files through /upload first.
file_url String Yes File URL.
requester Object Yes Requester information.
euid String No Unique contact ID.
channel_contacts Object No Channel contact mapping. At least one of euid and this field must be provided.
channel_id String Yes Channel ID.
contact_id String Yes Channel contact ID, such as the Telegram chat ID.
sub_contact_id String No Channel sub-contact ID, such as the Telegram topic ID or email thread ID.
followers Array No Follower ID information used for in-channel pushing and notifications, including the id and name fields.
  • id: Follower ID.
  • name: Follower name.
  • submitter Object No Submitter information, including the id field.
  • id: Submitter ID.
  • assignment_team String No Assignment team name. The team must already exist.
    priority String No Priority: high, medium, or low. Defaults to medium if omitted.
    ticket_type String No Ticket type: problem, incident, question, task, or none. Defaults to none if omitted.
    custom_fields Object No Custom fields, such as source information, using the key-value format.

    Response

    Successful Response

    { "code": 0, "message": "Success", "data": { "ticket_id": "tk_20251104_789abc", "message": "Ticket created successfully" } }
                  
                  {
      "code": 0,
      "message": "Success",
      "data": {
        "ticket_id": "tk_20251104_789abc",
        "message": "Ticket created successfully"
      }
    }
    
                
    This code block in the floating window

    Response Parameters

    Field Type Required Description
    ticket_id String No Ticket ID.
    message String No Returned message content. For example: "Ticket created successfully".
    Icon Solid Transparent White Qiyu
    Contact Sales