Skip to main content
The Ticket resource represents ITSM tickets (incidents and requests) in ITSM-NG. You can create, retrieve, update, and delete tickets using the API.

Ticket Object

A ticket in ITSM-NG contains the following key fields:
id
integer
Unique ticket identifier
name
string
Ticket title/subject
content
string
Ticket description content
status
integer
Current ticket status:
  • 1 - New
  • 2 - Processing (assigned)
  • 3 - Processing (planned)
  • 4 - Pending
  • 5 - Solved
  • 6 - Closed
urgency
integer
Urgency level (1-5, where 5 is highest)
impact
integer
Impact level (1-5, where 5 is highest)
priority
integer
Priority (automatically calculated from urgency × impact matrix)
type
integer
Ticket type:
  • 1 - Incident
  • 2 - Request
entities_id
integer
Entity ID to which the ticket belongs
users_id_recipient
integer
Requester user ID
users_id_lastupdater
integer
Last user who updated the ticket
date
datetime
Ticket creation date
date_mod
datetime
Last modification date
closedate
datetime
Ticket close date
solvedate
datetime
Ticket solve date
itilcategories_id
integer
Ticket category ID
locations_id
integer
Location ID associated with the ticket

Get a Ticket

Retrieve a specific ticket by ID.
cURL
curl -X GET \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  'https://your-instance.com/apirest.php/Ticket/123'

Query Parameters

expand_dropdowns
boolean
default:"false"
Show dropdown names instead of IDs
with_logs
boolean
default:"false"
Include ticket history
with_documents
boolean
default:"false"
Include associated documents
with_contracts
boolean
default:"false"
Include associated contracts

Response

{
  "id": 123,
  "name": "Printer not working",
  "content": "The office printer on floor 2 is not responding",
  "status": 2,
  "urgency": 3,
  "impact": 3,
  "priority": 3,
  "type": 1,
  "entities_id": 0,
  "users_id_recipient": 5,
  "date": "2024-03-02 10:30:00",
  "date_mod": "2024-03-02 14:20:00",
  "itilcategories_id": 12,
  "locations_id": 4
}

Create a Ticket

Create a new ticket in the system.
cURL
curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  -d '{
    "input": {
      "name": "Printer not working",
      "content": "The office printer on floor 2 is not responding",
      "urgency": 3,
      "impact": 3,
      "type": 1,
      "entities_id": 0
    }
  }' \
  'https://your-instance.com/apirest.php/Ticket/'

Request Body

input
object
required
Ticket data object

Response

{
  "id": 124,
  "message": ""
}

Update a Ticket

Update an existing ticket.
cURL
curl -X PUT \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  -d '{
    "input": {
      "status": 5,
      "solution": "Printer was offline. Reconnected and working now."
    }
  }' \
  'https://your-instance.com/apirest.php/Ticket/123'

Delete a Ticket

Delete (or move to trash) a ticket.
cURL
curl -X DELETE \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  'https://your-instance.com/apirest.php/Ticket/123?force_purge=false'
force_purge
boolean
default:"false"
If true, permanently delete the ticket. If false, move to trash.

Add a Followup

Add a followup (comment) to a ticket.
cURL
curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  -d '{
    "input": {
      "items_id": 123,
      "itemtype": "Ticket",
      "content": "Investigating the issue with the printer.",
      "is_private": false
    }
  }' \
  'https://your-instance.com/apirest.php/ITILFollowup/'

Search Tickets

Search for tickets using criteria.
cURL
curl -X GET \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  'https://your-instance.com/apirest.php/search/Ticket/?criteria[0][field]=12&criteria[0][searchtype]=equals&criteria[0][value]=2&range=0-50'
This searches for tickets with status = 2 (Processing).
See the Search endpoint documentation for detailed search syntax and options.

Common Use Cases

curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/search/Ticket/?criteria[0][field]=12&criteria[0][searchtype]=contains&criteria[0][value]=1,2,3,4'
This returns tickets with status 1-4 (New through Pending).
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/search/Ticket/?criteria[0][field]=5&criteria[0][searchtype]=equals&criteria[0][value]=42'
This returns tickets assigned to user ID 42.
Use multipart/form-data to upload files with ticket creation:
curl -X POST \
  -H "Session-Token: your_session_token" \
  -H 'Content-Type: multipart/form-data' \
  -F 'uploadManifest={"input": {"name": "Issue with screenshot", "content": "See attached", "_filename": ["screenshot.png"]}};type=application/json' \
  -F 'filename[0][email protected]' \
  'https://your-instance.com/apirest.php/Ticket/'

Best Practices

Set Appropriate Priority

Let the system calculate priority automatically based on urgency and impact values.

Use Categories

Always assign tickets to appropriate categories for better organization and reporting.

Track Status Changes

Use the with_logs parameter to retrieve ticket history and track all status changes.

Handle Pagination

When searching tickets, use the range parameter to paginate results (e.g., range=0-49).

Build docs developers (and LLMs) love