Skip to main content
ITSM-NG provides comprehensive asset management through its REST API. You can manage various asset types including computers, monitors, network equipment, phones, printers, and more.

Asset Types (Itemtypes)

The following asset types are available:
  • Computer - Desktop computers, laptops, servers
  • Monitor - Display monitors
  • NetworkEquipment - Switches, routers, firewalls
  • Peripheral - External devices (keyboards, mice, etc.)
  • Phone - Desk phones and VoIP devices
  • Printer - Printers and multifunction devices
  • SoftwareLicense - Software licenses
  • CartridgeItem - Printer cartridges
  • ConsumableItem - Consumable items

Computer Object

A computer asset contains these key fields:
id
integer
Unique computer identifier
name
string
Computer name/hostname
serial
string
Serial number
otherserial
string
Inventory number or other serial
entities_id
integer
Entity ID to which the computer belongs
locations_id
integer
Physical location ID
manufacturers_id
integer
Manufacturer ID (e.g., Dell, HP, Lenovo)
computermodels_id
integer
Computer model ID
computertypes_id
integer
Computer type ID (Desktop, Laptop, Server)
users_id
integer
User ID of the computer owner
users_id_tech
integer
Technician responsible for this computer
states_id
integer
State ID (In use, In stock, etc.)
uuid
string
System UUID
date_creation
datetime
Asset creation date
date_mod
datetime
Last modification date
is_deleted
boolean
Whether the computer is in trash
is_dynamic
boolean
Whether the computer is managed by inventory agent

Get an Asset

Retrieve a specific asset 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/Computer/71?expand_dropdowns=true'

Additional Data Options

For Computer, NetworkEquipment, Peripheral, Phone, and Printer assets, you can retrieve additional associated data:
with_devices
boolean
default:"false"
Retrieve associated hardware components (processors, memory, disk drives, etc.)
with_disks
boolean
default:"false"
Retrieve associated file systems and partitions (Computer only)
with_softwares
boolean
default:"false"
Retrieve installed software (Computer only)
with_connections
boolean
default:"false"
Retrieve directly connected peripherals and printers (Computer only)
with_networkports
boolean
default:"false"
Retrieve network ports and connections
with_infocoms
boolean
default:"false"
Retrieve financial and administrative information
with_contracts
boolean
default:"false"
Retrieve associated contracts
with_documents
boolean
default:"false"
Retrieve associated documents
with_tickets
boolean
default:"false"
Retrieve associated tickets
with_logs
boolean
default:"false"
Retrieve change history

Response Example

{
  "id": 71,
  "entities_id": "Root Entity",
  "name": "LAPTOP-2024",
  "serial": "ABC123456",
  "otherserial": "INV-2024-001",
  "contact": "john.doe",
  "manufacturers_id": "Lenovo",
  "computermodels_id": "ThinkPad X1 Carbon",
  "computertypes_id": "Laptop",
  "users_id": "John Doe",
  "locations_id": "Office Floor 2",
  "states_id": "In use",
  "uuid": "4201F465-2759-A9FB-11BC-CDB864681F4B",
  "date_mod": "2024-03-02 09:33:41",
  "is_deleted": 0,
  "is_dynamic": 1
}

Get All Assets

Retrieve a list of assets with pagination.
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/Computer/?range=0-49'
range
string
default:"0-50"
Pagination range (e.g., 0-49 for first 50 items)
sort
integer
default:"1"
Field ID to sort by
order
string
default:"ASC"
Sort order: ASC or DESC

Create an Asset

Add a new asset to the inventory.
cURL
curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  -d '{
    "input": {
      "name": "LAPTOP-2024",
      "serial": "ABC123456",
      "entities_id": 0,
      "computermodels_id": 11,
      "computertypes_id": 1,
      "users_id": 42,
      "locations_id": 4
    }
  }' \
  'https://your-instance.com/apirest.php/Computer/'

Bulk Creation

You can create multiple assets in one request:
cURL
curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -d '{
    "input": [
      {
        "name": "LAPTOP-2024-01",
        "serial": "ABC123456"
      },
      {
        "name": "LAPTOP-2024-02",
        "serial": "ABC123457"
      }
    ]
  }' \
  'https://your-instance.com/apirest.php/Computer/'

Update an Asset

Update existing asset information.
cURL
curl -X PUT \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  -d '{
    "input": {
      "locations_id": 5,
      "states_id": 2
    }
  }' \
  'https://your-instance.com/apirest.php/Computer/71'

Delete an Asset

Move an asset to trash or permanently delete it.
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/Computer/71?force_purge=false'
force_purge
boolean
default:"false"
If true, permanently delete the asset. If false, move to trash.

Search Assets

Search for assets using specific criteria.
cURL
curl -g -X GET \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/search/Computer/?criteria[0][field]=1&criteria[0][searchtype]=contains&criteria[0][value]=LAPTOP'
This searches for all computers with “LAPTOP” in their name.

Common Use Cases

Retrieve a computer with all associated data:
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/Computer/71?with_devices=true&with_softwares=true&with_networkports=true&with_infocoms=true&with_logs=true'
curl -g -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/search/Computer/?criteria[0][field]=3&criteria[0][searchtype]=equals&criteria[0][value]=5&criteria[1][link]=AND&criteria[1][field]=4&criteria[1][searchtype]=equals&criteria[1][value]=1'
Where field 3 is locations_id=5 and field 4 is computertypes_id=1 (laptop).
curl -X PUT \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -d '{
    "input": [
      {"id": 71, "states_id": 3},
      {"id": 72, "states_id": 3}
    ]
  }' \
  'https://your-instance.com/apirest.php/Computer/'

Financial Information (Infocoms)

Assets can have associated financial information:
cURL
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/Computer/71?with_infocoms=true'
This includes:
  • Purchase date and price
  • Warranty information
  • Order number and delivery information
  • Supplier details
  • Budget allocation
Financial information is stored in the Infocom itemtype and linked to assets.

Best Practices

Use Serial Numbers

Always populate serial numbers for unique asset identification and inventory tracking.

Leverage Auto-Inventory

Use GLPI Agent for automatic inventory updates (sets is_dynamic=1).

Link to Users

Assign assets to users for accountability and asset tracking.

Use Locations

Always specify location for physical asset tracking and management.

Build docs developers (and LLMs) love