Skip to main content
Manage user profiles for the current session.

Get My Profiles

Retrieve all profiles associated with the logged-in user.

Endpoint

GET /apirest.php/getMyProfiles/

Headers

Content-Type
string
required
Must be application/json
Session-Token
string
required
Session token provided by the initSession endpoint
App-Token
string
Authorization string provided by the GLPI API configuration

Response

myprofiles
array
required
Array of all user profiles

Example

curl -X GET \
  -H 'Content-Type: application/json' \
  -H "Session-Token: 83af7e620c83a50a18d3eac2f6ed05a3ca0bea62" \
  -H "App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7" \
  'http://path/to/glpi/apirest.php/getMyProfiles'
Response:
{
  "myprofiles": [
    {
      "id": 1,
      "name": "Super-admin",
      "entities": []
    }
  ]
}

Get Active Profile

Retrieve the current active profile.

Endpoint

GET /apirest.php/getActiveProfile/

Headers

Content-Type
string
required
Must be application/json
Session-Token
string
required
Session token provided by the initSession endpoint
App-Token
string
Authorization string provided by the GLPI API configuration

Response

name
string
required
Profile name
entities
array
Entities associated with the active profile

Example

curl -X GET \
  -H 'Content-Type: application/json' \
  -H "Session-Token: 83af7e620c83a50a18d3eac2f6ed05a3ca0bea62" \
  -H "App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7" \
  'http://path/to/glpi/apirest.php/getActiveProfile'
Response:
{
  "name": "Super-admin",
  "entities": []
}

Change Active Profile

Change the active profile to a different one.

Endpoint

POST /apirest.php/changeActiveProfile/

Headers

Content-Type
string
required
Must be application/json
Session-Token
string
required
Session token provided by the initSession endpoint
App-Token
string
Authorization string provided by the GLPI API configuration

JSON Payload

profiles_id
integer
required
ID of the new active profile. Use getMyProfiles to get available profile IDs.

Response

Returns an empty response body on success.

Example

curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Session-Token: 83af7e620c83a50a18d3eac2f6ed05a3ca0bea62" \
  -H "App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7" \
  -d '{"profiles_id": 4}' \
  'http://path/to/glpi/apirest.php/changeActiveProfile'
Response:
200 OK

Status Codes

  • 200 OK - Profile changed successfully
  • 400 Bad Request - Error in input parameters
  • 404 Not Found - Profile does not exist or is not usable by the current user

Notes

  • This endpoint has write access to the session
  • Only profiles returned by getMyProfiles can be set as active
  • Changing the active profile affects permissions for subsequent API calls

Build docs developers (and LLMs) love