Introducing a new way to review your PRs.

Read the announcement

combodo / itop

A simple, web based CMDB & IT Service Management tool

View on GitHub

17 documents · Updated Nov 20, 2026

docs / web-service-apis

Web-service APIs

Web-service APIs provide machine access to iTop through REST/JSON and SOAP services. They authenticate a caller, apply the caller's iTop rights to CMDB data, and return structured results for reads, changes, searches, and service checks. Use this page with Integrations and automation, Data exchange and synchronization, and Background processing and notifications to place API calls in the wider integration model.

Service surface

The service surface has three distinct entry points. REST is the main general-purpose CMDB interface, SOAP supports a fixed contract for older or strongly typed clients, and the status endpoint gives a small unauthenticated health signal.

Entry pointMain useResponse style
webservices/rest.phpRead and change CMDB objects through versioned operationsJSON or JSONP
webservices/soapserver.phpCall the basic ticket and search services through SOAPSOAP response structures
webservices/itop.wsdl.phpDescribe the SOAP contract for client generation and inspectionXML WSDL
webservices/status.phpCheck if iTop can start and reach its configured data storeSmall JSON health result

REST entry point

The REST entry point accepts a version and a JSON request. It discovers the operations available for that version, authenticates the caller, dispatches the named operation to a service provider, and returns one JSON result. The list_operations operation lets a client learn the available verbs instead of hard-coding the provider list. webservices/rest.php• L66-70, webservices/rest.php• L137-210

REST versions 1.0 through 1.4 expose the core CMDB operations. Their scope is broad enough for an integration to create, read, update, delete, and transition objects, inspect related objects, or check credentials. The operation version is part of the contract, so a client must select a supported version before it sends the operation data. core/get also supports page and limit values for large result sets. core/restservices.class.inc.php• L374-422, core/restservices.class.inc.php• L541-632

The endpoint accepts json_data as a request value or as an uploaded file. It returns a standard result with a numeric code and message. Object results can include the class, key, selected fields, related objects, and relations. Sensitive fields are masked when input or output is recorded for service logs. webservices/rest.php• L72-90, webservices/rest.php• L223-270, core/restservices.class.inc.php• L37-117, core/restservices.class.inc.php• L193-248

References: webservices/rest.php• L66-70 webservices/rest.php• L72-90 webservices/rest.php• L137-210 webservices/rest.php• L223-270 core/restservices.class.inc.php• L37-117 core/restservices.class.inc.php• L193-248 core/restservices.class.inc.php• L374-422 core/restservices.class.inc.php• L541-632

SOAP entry point

The SOAP entry point creates a SOAP server from a WSDL URL and maps the WSDL data types to iTop result objects. A normal request uses HTTP POST; a non-POST request shows the available functions and links to the WSDL. A service_category value can select another service class derived from WebServicesBase; without it, the entry point uses BasicServices. webservices/soapserver.php• L28-58, webservices/soapserver.php• L60-87

The basic SOAP contract provides a version check, request-ticket creation, incident-ticket creation, and OQL-based object search. Ticket creation can resolve external references such as the caller, customer, service, workgroup, and impacted configuration items before it saves the ticket. webservices/webservices.basic.php• L29-139, webservices/webservices.basic.php• L160-218, webservices/webservices.basic.php• L226-258

SOAP operations return either a simple value or a SOAPResult. A SOAPResult carries an overall status plus result rows and separate information, warning, and error messages. This lets a client distinguish a completed call from a call that completed with issues during object matching or validation. webservices/itopsoaptypes.class.inc.php• L98-160, webservices/webservices.class.inc.php• L34-109

References: webservices/soapserver.php• L28-58 webservices/soapserver.php• L60-87 webservices/webservices.basic.php• L29-139 webservices/webservices.basic.php• L160-218 webservices/webservices.basic.php• L226-258 webservices/itopsoaptypes.class.inc.php• L98-160 webservices/webservices.class.inc.php• L34-109

WSDL generation

The WSDL endpoint builds the SOAP contract at request time. It selects the WSDL template for the requested service category, replaces the server placeholder with the matching SOAP endpoint, and emits XML for SOAP clients. The default category is BasicServices. webservices/itop.wsdl.php• L35-64, webservices/webservices.class.inc.php• L246-255

The contract defines the shared search, external-key, link, result, and log shapes. It also declares the SOAP operations and their input and output messages. Clients should use the WSDL as the source for the wire contract because a service category can change both the operation set and the endpoint URL. webservices/itop.wsdl.tpl#L5-L138, webservices/itop.wsdl.tpl#L141-L267

References: webservices/itop.wsdl.php• L35-64 webservices/webservices.class.inc.php• L246-255 webservices/itop.wsdl.tpl• L5-138 webservices/itop.wsdl.tpl• L141-267

Request handling

REST and SOAP follow different wire contracts but share the same high-level path: start the application, establish the caller, validate the request, run a CMDB operation, and format the result. The service entry point records the origin as a web service so downstream change tracking can identify API-driven changes. webservices/rest.php• L94-110, webservices/rest.php• L204-211, webservices/soapserver.php• L60-62

This diagram shows how a request moves from an external client to a CMDB result.

flowchart LR
    Client[API client] --> Choice{Protocol}
    Choice -->|REST JSON| Rest[REST entry point]
    Choice -->|SOAP XML| Soap[SOAP entry point]
    Rest --> Auth[Authenticate caller]
    Soap --> Dispatch[SOAP operation dispatch]
    Auth --> RestDispatch[Select version and operation]
    RestDispatch --> Rights[Apply iTop rights and object rules]
    Dispatch --> Rights
    Rights --> CMDB[Read or change CMDB data]
    CMDB --> Result[Structured response]

REST request lifecycle

The REST lifecycle rejects a request before dispatch when the version, JSON data, credentials, or operation is missing or invalid. Once the request passes those checks, the endpoint maps the operation name to a provider and returns provider errors in the same JSON result shape. webservices/rest.php• L94-155, webservices/rest.php• L160-220

For object access, the core provider uses the requested class and key or OQL-like selector to build a CMDB result. It checks read, bulk-read, modify, bulk-modify, and delete rights at the operation boundary. A delete can be simulated so the client can inspect planned direct and indirect changes before it asks for the real change. core/restservices.class.inc.php• L438-484, core/restservices.class.inc.php• L634-653, core/restservices.class.inc.php• L807-890

References: webservices/rest.php• L94-155 webservices/rest.php• L160-220 core/restservices.class.inc.php• L438-484 core/restservices.class.inc.php• L634-653 core/restservices.class.inc.php• L807-890

SOAP request lifecycle

The SOAP server lets PHP's SOAP layer map an incoming method to a service class. The basic methods check the supplied login and password, establish that user for the call, then perform ticket creation or OQL search. A failed login is returned as a failed SOAPResult rather than as successful business data. webservices/webservices.basic.php• L53-61, webservices/webservices.basic.php• L94-107, webservices/webservices.basic.php• L226-237

Ticket creation validates field values and resolves external keys by exact search conditions. A missing or ambiguous reference becomes an error or warning according to whether the target field is required. The result reports the created object when the object passes its write checks. webservices/webservices.class.inc.php• L296-367, webservices/webservices.class.inc.php• L380-465, webservices/webservices.class.inc.php• L482-497

References: webservices/webservices.basic.php• L53-61 webservices/webservices.basic.php• L94-107 webservices/webservices.basic.php• L226-237 webservices/webservices.class.inc.php• L296-367 webservices/webservices.class.inc.php• L380-465 webservices/webservices.class.inc.php• L482-497

CMDB access model

Programmatic CMDB access uses the same object model as other iTop data paths. REST exposes generic object operations and selected fields, while SOAP exposes a smaller set of ticket and search actions. Both paths preserve object validation and record the service origin for changes. core/restservices.class.inc.php• L374-422, webservices/webservices.basic.php• L160-218, webservices/rest.php• L208-210, webservices/soapserver.php• L60-62

REST reads can return one class, several classes, or joined object sets. Related-object reads add both object data and relation edges. The caller's bulk-read right is checked for every class included in the returned graph, which keeps relation traversal inside the same authorization boundary as direct reads. core/restservices.class.inc.php• L541-632, core/restservices.class.inc.php• L655-757

References: core/restservices.class.inc.php• L374-422 webservices/webservices.basic.php• L160-218 webservices/rest.php• L208-210 webservices/soapserver.php• L60-62 core/restservices.class.inc.php• L541-632 core/restservices.class.inc.php• L655-757

Authentication and authorization

Authentication proves which iTop user is making a service call. Authorization then decides which service entry point and CMDB actions that user may use; valid credentials alone do not grant read, change, export, or delete rights.

REST authentication boundary

The REST endpoint requires auth_user and auth_pwd and resets the web session before it logs in. When secure_rest_services is enabled, the user must also have the REST Services User profile. This separates service accounts from ordinary interactive sessions and gives administrators a profile boundary for REST access. webservices/rest.php• L94-135, core/config.class.inc.php• L1605-1619

REST authorization is checked again for each operation and target class. Reads require read and bulk-read permission. Writes and deletes require the matching modify or delete permission plus the bulk permission used by the service. The check is made after authentication and before the CMDB change or export. core/restservices.class.inc.php• L449-483, core/restservices.class.inc.php• L559-565, core/restservices.class.inc.php• L643-649

The configuration also includes an option to allow REST endpoint token authorization when the secure REST profile rule is active. The setting changes how token-based authorization interacts with the profile gate; the endpoint's normal credential and rights checks remain the contract to review when changing access policy. core/config.class.inc.php• L1605-1619

References: webservices/rest.php• L94-135 core/config.class.inc.php• L1605-1619 core/restservices.class.inc.php• L449-483 core/restservices.class.inc.php• L559-565 core/restservices.class.inc.php• L643-649

SOAP authentication boundary

The basic SOAP methods receive the login and password as operation inputs. Each method checks those credentials before it calls UserRights::Login, so the method runs in the context of the authenticated iTop user. GetVersion is the simple version operation and does not take login fields in the WSDL contract. webservices/webservices.basic.php• L41-51, webservices/webservices.basic.php• L53-61, webservices/itop.wsdl.tpl#L141-L145

SOAP does not use the REST operation registry or the REST profile check in its entry point. Its authorization boundary is the authenticated user context combined with the validation and write rules applied by the SOAP service methods. A new SOAP service category must therefore define its own method contract and preserve the expected user and object checks. webservices/soapserver.php• L37-58, webservices/webservices.basic.php• L160-218

References: webservices/webservices.basic.php• L41-51 webservices/webservices.basic.php• L53-61 webservices/itop.wsdl.tpl• L141-145 webservices/soapserver.php• L37-58 webservices/webservices.basic.php• L160-218

Status endpoint

The status endpoint is a lightweight health check rather than a CMDB API. It starts the application and its data model, then returns RUNNING with an HTTP success response when startup works. If startup fails, it returns ERROR, includes the failure message, and uses HTTP 500. webservices/status.php• L3-16, sources/…/Status.php• L67-89

The endpoint does not perform user login before the check. It only reports whether the application can load its root and configuration files and start its normal data model. Keep it separate from authenticated business operations when defining monitoring or load-balancer probes. webservices/status.php• L3-24, sources/…/Status.php• L24-65

References: webservices/status.php• L3-16 webservices/status.php• L18-24 sources/…/Status.php• L24-65 sources/…/Status.php• L67-89

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the REST version list, list_operations output, and client-visible operation behavior aligned.
  • Keep REST result fields, relation shapes, and error codes aligned with clients that parse them.
  • Keep the WSDL template, SOAP type mapping, and service-category selection aligned. A name change in one can break generated SOAP clients.
  • Keep SOAP method parameters and result types aligned across the service class, WSDL, and mapped PHP types.
  • Recheck both authentication and per-class rights when changing a REST operation or adding a SOAP operation.
  • Preserve the web-service change origin and sensitive-data masking when changing request logging or CMDB writes.
  • Keep status HTTP behavior and JSON fields stable for health probes.

Important failure modes

TriggerConsequenceGuard
REST request omits version or json_dataThe endpoint returns a structured error and does not dispatch an operation.Validate the request envelope before sending the operation body.
REST version has no registered operationsThe endpoint reports an unsupported version.Call list_operations for the selected version or use a supported version.
Authenticated REST user lacks the REST service profile while the secure setting is onREST access is rejected before the CMDB operation runs.Use a dedicated service account with the required profile, or review the access policy.
REST user lacks read, bulk-read, modify, bulk-modify, or delete rightsThe service returns an authorization result and does not perform the protected action.Grant only the class actions required by the integration.
SOAP client uses a stale WSDL or mismatched type namesSOAP mapping or method calls fail before useful business data returns.Regenerate or refresh the client contract when the WSDL or mapped types change.
SOAP external key matches zero or multiple objectsTicket creation reports an error or warning and may not save the ticket.Use search conditions that identify one valid CMDB object.
Status startup cannot read configuration or start the data modelThe endpoint returns HTTP 500 with status ERROR.Use the endpoint as a readiness check and fix configuration or data-store startup failures.

Key files

FileWhy to read it
webservices/rest.phpShows the REST request envelope, authentication gate, provider dispatch, response output, and service logging.
core/restservices.class.inc.phpDefines the core CMDB operation contract, result shapes, rights checks, relation reads, and delete planning.
webservices/soapserver.phpShows SOAP server setup, service-category selection, WSDL use, and request handling.
webservices/webservices.basic.phpShows the supported basic SOAP business actions and their CMDB-facing behavior.
webservices/webservices.class.inc.phpDefines shared SOAP results, object validation helpers, external-key matching, and WSDL lookup.
webservices/itop.wsdl.phpShows how the runtime SOAP contract and endpoint address are produced.
webservices/itop.wsdl.tplDefines the SOAP types and basic operation messages used by clients.
webservices/itopsoaptypes.class.inc.phpMaps WSDL data types to the PHP structures returned by SOAP calls.
webservices/status.phpDefines the public JSON health response and HTTP status behavior.
sources/…/Status.phpDefines the application-start checks behind the health response.
core/config.class.inc.phpDocuments the REST profile gate and token authorization setting.
tests/…/RestTest.phpShows the expected REST envelope, JSONP behavior, operation discovery, and core object access contract.