Skip to main content
The User resource allows you to manage users, their profiles, and authentication settings in ITSM-NG.

User Object

A user object contains the following key fields:
id
integer
Unique user identifier
name
string
Username for login (unique)
realname
string
User’s last name
firstname
string
User’s first name
email
string
Primary email address
phone
string
Phone number
mobile
string
Mobile phone number
locations_id
integer
Default location ID
language
string
Preferred interface language
usertitles_id
integer
User title ID (Mr., Mrs., etc.)
usercategories_id
integer
User category ID
comment
string
Additional notes about the user
is_active
boolean
Whether the user account is active
is_deleted
boolean
Whether the user is in trash
authtype
integer
Authentication type (1=Local, 2=LDAP, 3=Mail, 4=External)
auths_id
integer
Authentication source ID (for LDAP, mail servers)
date_creation
datetime
Account creation date
date_mod
datetime
Last modification date
last_login
datetime
Last login timestamp

Get a User

Retrieve a specific user 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/User/42?expand_dropdowns=true'

Query Parameters

expand_dropdowns
boolean
default:"false"
Show dropdown names instead of IDs
with_logs
boolean
default:"false"
Include user activity history

Response Example

{
  "id": 42,
  "name": "john.doe",
  "realname": "Doe",
  "firstname": "John",
  "email": "john.doe@company.com",
  "phone": "+1-555-0123",
  "is_active": 1,
  "authtype": 1,
  "locations_id": "Office - Floor 2",
  "language": "en_GB",
  "date_creation": "2023-01-15 10:00:00",
  "last_login": "2024-03-02 08:30:00"
}

Get All Users

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

Create a User

Add a new user to 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": "jane.smith",
      "realname": "Smith",
      "firstname": "Jane",
      "email": "jane.smith@company.com",
      "password": "SecurePass123!",
      "password2": "SecurePass123!",
      "is_active": 1,
      "authtype": 1
    }
  }' \
  'https://your-instance.com/apirest.php/User/'

Request Body

input
object
required
User data object
When creating users with local authentication (authtype=1), both password and password2 must be provided and match.

Response

{
  "id": 43,
  "message": ""
}

Update a User

Update existing user information.
cURL
curl -X PUT \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -H "App-Token: your_app_token" \
  -d '{
    "input": {
      "email": "jane.smith.new@company.com",
      "phone": "+1-555-9999"
    }
  }' \
  'https://your-instance.com/apirest.php/User/43'

Delete a User

Move a user to trash or permanently delete.
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/User/43?force_purge=false'
force_purge
boolean
default:"false"
If true, permanently delete the user. If false, move to trash.

User Profiles

Users can have multiple profiles assigned across different entities.

Get User’s Profiles

cURL
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/User/42/Profile_User'
This returns all profile assignments for the user.

Assign Profile to User

cURL
curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -d '{
    "input": {
      "users_id": 42,
      "profiles_id": 4,
      "entities_id": 0,
      "is_recursive": 1
    }
  }' \
  'https://your-instance.com/apirest.php/Profile_User/'

User Groups

Users can be members of groups for organizing and permission management.

Get User’s Groups

cURL
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/User/42/Group_User'

Add User to Group

cURL
curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -d '{
    "input": {
      "users_id": 42,
      "groups_id": 5
    }
  }' \
  'https://your-instance.com/apirest.php/Group_User/'

Search Users

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

Common Use Cases

Use the special endpoint to get the current session user:
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/getFullSession'
The response includes user ID in session.glpiID.
curl -g -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/search/User/?criteria[0][field]=8&criteria[0][searchtype]=equals&criteria[0][value]=0'
Where field 8 is is_active=0.
curl -X PUT \
  -H 'Content-Type: application/json' \
  -H "Session-Token: your_session_token" \
  -d '{
    "input": {
      "password": "NewSecurePass456!",
      "password2": "NewSecurePass456!"
    }
  }' \
  'https://your-instance.com/apirest.php/User/42'
ITSM-NG provides a special endpoint for user profile pictures:
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/User/42/Picture' > profile.jpg
Returns 200 with image data, or 204 if no picture exists.

User Preferences

Users have preferences stored that control their interface settings.
cURL
curl -X GET \
  -H "Session-Token: your_session_token" \
  'https://your-instance.com/apirest.php/User/42/UserPreference'
Preferences include language, date format, display options, and notification settings.

Best Practices

Use Strong Passwords

Enforce password policies and use strong passwords for local authentication users.

Prefer External Auth

Use LDAP/OIDC authentication instead of local accounts for better security.

Regular Audits

Regularly review user accounts and disable inactive users.

Minimal Privileges

Assign only necessary profiles and permissions following least privilege principle.

Build docs developers (and LLMs) love