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:
Username for login (unique)
Preferred interface language
User title ID (Mr., Mrs., etc.)
Additional notes about the user
Whether the user account is active
Whether the user is in trash
Authentication type (1=Local, 2=LDAP, 3=Mail, 4=External)
Authentication source ID (for LDAP, mail servers)
Get a User
Retrieve a specific user by ID.
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
Show dropdown names instead of IDs
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 -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'
Pagination range (e.g., 0-49 for first 50 users)
Create a User
Add a new user to the system.
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
User data object
Unique username for login
Password (for local auth only)
Password confirmation (must match password)
Whether the account is active
Authentication type (1=Local, 2=LDAP)
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 -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 -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'
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 -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 -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 -X GET \
-H "Session-Token: your_session_token" \
'https://your-instance.com/apirest.php/User/42/Group_User'
Add User to Group
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 -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
Get current logged-in user
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 -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.