canonical: https://jentic.com/apis/glpi-project.org/glpi-project

# Glpi Project GLPI REST API

GLPI is an open-source IT asset management and helpdesk platform used to track computers, network devices, software, contracts, and support tickets. The GLPI REST API exposes that catalogue programmatically through a small set of generic endpoints: a session lifecycle (initSession, killSession, profile and entity switching) and a generic CRUD surface that operates on any GLPI item type via /{itemtype}, /{itemtype}/{id}, and the search endpoints. That keeps the surface compact while giving access to the full GLPI data model.

## For AI agents

Manage GLPI tickets, computers, and any GLPI item type through a generic REST surface with session-token auth on a self-hosted GLPI instance.

## Scope

Does not provide hosted infrastructure, network discovery scanning, or on-call paging - use for ticket and IT-asset CRUD plus search on a self-hosted GLPI instance only.

## Capabilities

- Open and close an authenticated GLPI session via initSession and killSession
- Create, read, update, and delete any GLPI item type (Ticket, Computer, User, etc.) via the generic /{itemtype} endpoints
- Search GLPI items with criteria via `/search/{itemtype}` and discover available filters via `/listSearchOptions/{itemtype}`
- Fetch related sub-items for an item (e.g. Ticket_User attached to a Ticket) via /{itemtype}/{id}/{subItemtype}
- Switch active profile and active entities mid-session for tenants with multi-entity hierarchies
- Retrieve multiple items in a single call via /getMultipleItems

## Use cases

### Help-Desk Ticket Automation

IT teams running GLPI can replace email-only inboxes with API-driven ticket creation: a chatbot or monitoring tool POSTs to /Ticket via the generic /{itemtype} endpoint and updates the ticket status as the issue is investigated. Combined with `/search/Ticket` for backlog views, this turns GLPI into the system of record for a fully automated triage flow. Setup is typically a day, including app-token provisioning.

Example prompt: POST /Ticket with {name, content, urgency} after initSession, then capture the returned ticket ID and store it on the originating alert.

### IT Asset Inventory Sync

Discovery tools that scan the network can keep the GLPI Computer inventory in sync by upserting Computer items via POST /Computer and PATCHing existing records by ID. The `/search/Computer` endpoint backs reporting, and `/listSearchOptions/Computer` surfaces every searchable field so the integration code does not have to be hard-coded against GLPI's internal numeric option IDs.

Example prompt: After initSession, POST /Computer for each scanned host and PUT `/Computer/{id}` for any existing record whose serial number matches.

### Agent-Assisted Service Desk

An AI agent through Jentic can resolve common service desk requests by searching for the user's open tickets via `/search/Ticket`, summarising the latest status, and either updating the ticket or creating a new one. Because GLPI's CRUD is generic, the same flow works for change requests, problems, or any other supported item type.

Example prompt: Search Jentic for 'list glpi tickets', load the schema for GET `/search/{itemtype}`, and execute with itemtype=Ticket and criteria for status open.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/initSession` | Open an authenticated session |
| GET | `/{itemtype}` | List items of a type |
| POST | `/{itemtype}` | Create one or more items |
| PUT | `/{itemtype}/{id}` | Update an item by ID |
| DELETE | `/{itemtype}/{id}` | Delete an item by ID |
| GET | `/search/{itemtype}` | Search items with criteria |
| GET | `/listSearchOptions/{itemtype}` | List searchable fields for an item type |

## Key resources

- **Session** — Open and close authenticated sessions and inspect the current session context.
- **Generic Items** — CRUD on any GLPI item type via /{itemtype} and /{itemtype}/{id}.
- **Search** — Run searches and discover searchable fields per item type.
- **Profiles and Entities** — Inspect and switch the active profile or entity inside a session.
- **Configuration** — Read GLPI configuration via getGlpiConfig.

## Why Jentic

- **Setup:** Wiring the GLPI REST API by hand means managing its Session-Token, App-Token, and userToken headers, pointing at your self-hosted instance host, and decoding its numeric search-option ids yourself. Through Jentic you install once, import the GLPI REST API from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** GLPI puts the item type and id in the URL path (/{itemtype}/{id}), so a rule can pin your agent to one item type such as tickets: it can read and search those and nothing else. You choose the operations it may call, so destructive ones like deleting an item are not included unless you add them.
- **Credential handling:** Your GLPI Session-Token, App-Token, and userToken values are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'open a GLPI ticket' or 'list GLPI computers', and Jentic returns the matching generic item-type or search operation with its schema so the agent calls the right endpoint without decoding numeric search-option ids.

## Related APIs

- **ServiceNow API** — Enterprise ITSM platform versus GLPI's open-source self-hosted model.
- **Freshdesk API** — SaaS helpdesk with simpler ticket-only surface compared to GLPI's combined ITSM and asset model.
- **PagerDuty API** — On-call paging that escalates GLPI tickets to humans on rotation.

## FAQ

### What authentication does the GLPI REST API use?

GLPI requires a Session-Token plus an App-Token, both sent as headers. You obtain the Session-Token by calling /initSession with either basicAuth credentials or a userTokenAuth Authorization header. Through Jentic both tokens are stored in the vault and injected per call.

### Can I create and update any GLPI item type with this API?

Yes. The /{itemtype} endpoints are generic - itemtype is a path parameter that resolves to Ticket, Computer, User, ContractItem, and any other GLPI class. POST creates, PUT updates, DELETE removes, and GET reads or lists.

### What are the rate limits for the GLPI REST API?

GLPI is self-hosted, so there is no provider-imposed rate limit; throughput depends on the host's PHP and database tuning. For bulk syncs use /getMultipleItems and batched POSTs to /{itemtype} rather than individual calls per record.

### How do I list open tickets through Jentic?

Search Jentic for 'glpi search items', load the schema for GET `/search/{itemtype}`, and execute with itemtype=Ticket and the appropriate status criteria. Run pip install jentic to start.

### How do I discover the searchable fields for an item type?

Call GET `/listSearchOptions/{itemtype}` - the response is the canonical list of numeric field IDs and labels that `/search/{itemtype}` accepts as criteria, removing the need to hard-code field numbers.

### Is the GLPI API free?

Yes. GLPI itself is open source and self-hosted, so the API is free to call against any GLPI instance you operate. Hosted GLPI providers may charge for the underlying instance but not per API call.

### Can I limit what my agent is allowed to do with the GLPI REST API?

Yes. Because you run Jentic One yourself, your own rules decide which GLPI operations and credentials the agent may use. Since GLPI puts the item type and id in the URL path (/{itemtype}/{id}), a rule can pin the agent to a single item type such as tickets, letting it read via GET /{itemtype} and search via GET `/search/{itemtype}` and nothing else. You choose the exact operations, so destructive calls like DELETE /{itemtype}/{id} stay off unless you add them.
