Integrations and automation
iTop connects to external systems through authenticated APIs and structured data exchange. It can load and reconcile external records, run work on a schedule, move slow work to a background queue, and notify users when rules or jobs produce a result.
Integration model
The integration model separates the way data enters iTop from the way iTop processes and reports it. A request can write objects at once, load records for later synchronization, or create work that a scheduled worker completes outside the request.
flowchart LR
A[External system] --> B[REST or SOAP API]
A --> C[CSV import]
A --> D[Data synchronization source]
B --> E[iTop data and change tracking]
C --> F[Loaded external records]
D --> F
F --> G[Reconciliation and object updates]
E --> H[Triggers and actions]
G --> H
H --> I[Email or newsroom notification]
J[Administrator cron] --> K[Scheduled and background work]
K --> G
K --> I
The main boundary is authentication. API calls, imports, and synchronization runs establish an iTop user context before they can read or change data. The same boundary also controls which records an integration can access.
External interfaces
External systems use REST for versioned JSON operations or SOAP for a WSDL-described service. CSV endpoints provide a simple path for bulk object loads and synchronization feeds. See Web-service APIs for the interface contracts and Data exchange and synchronization for record movement.
The iTop Hub Connector links an iTop instance with iTop Hub for remote landing pages and message access. Its shared settings define the hub destination, message actions, setup guidance, and privacy information.
References: webservices/rest.php• L70-110 webservices/soapserver.php• L28-62 webservices/import.php• L43-86 synchro/synchro_import.php• L37-80 datamodels/…/datamodel.itop-hub-connector.xml• L15-25
Automation boundary
The cron.php entry point is the control point for recurring work. It discovers registered processes, runs work whose next time has arrived, records run state, and prevents two cron runs from operating at the same time. See Background processing and notifications for the worker model.
The runtime configuration also sets the maximum time for one cron run, the limit for an individual background task, and the pause before cron checks again. These limits keep scheduled work within the request or command-line time available to it.
References: webservices/cron.php• L187-209 webservices/cron.php• L362-431 webservices/cron.php• L501-529 core/config.class.inc.php• L578-600
Web-service APIs
iTop exposes two API styles for system-to-system calls. REST accepts a version, an operation, and JSON data, then selects the service provider for that operation. SOAP exposes service classes through a generated WSDL.
REST operations
The REST path validates credentials, the requested version, and the JSON structure before it publishes the operations available for that version. A provider executes the chosen operation and returns a JSON result with a status code and message. REST use can also be recorded as an event with the request and response data.
References: webservices/rest.php• L72-110 webservices/rest.php• L137-209 webservices/rest.php• L223-270 core/config.class.inc.php• L498-505
SOAP services
The SOAP path gives clients a WSDL that describes callable services and result types. The default service category supports common actions such as creating response tickets and searching objects. A SOAP result carries success state plus returned data, information, warnings, and errors.
References: webservices/soapserver.php• L28-57 webservices/webservices.basic.php• L29-53 webservices/webservices.basic.php• L160-218 webservices/webservices.class.inc.php• L34-109
API object handling
API operations resolve related objects by search values instead of requiring callers to know every local identifier. The service reports missing or ambiguous links as issues, so an integration can distinguish a completed change from a request that needs correction.
References: webservices/webservices.class.inc.php• L296-367 webservices/webservices.class.inc.php• L380-465 webservices/webservices.class.inc.php• L482-497
Data exchange
Data exchange turns tabular input into iTop objects or into records held by a synchronization source. The two paths share a CSV concept but serve different goals: bulk import changes target objects directly, while synchronization keeps an external record set available for later comparison.
Bulk object import
The bulk import path accepts CSV data over HTTP or from a command-line file. It maps columns to object attributes, supports related-object fields, and uses reconciliation keys to decide whether each row creates a new object or updates an existing one. A simulation can produce the expected report without writing changes.
References: webservices/import.php• L59-152 webservices/import.php• L314-366 webservices/import.php• L433-530 webservices/import.php• L631-656 core/config.class.inc.php• L407-447
Synchronization feed
A synchronization feed loads rows into a data source associated with a target class. Each row has a primary key that identifies the external record. The feed can stop on an import error or continue and report errors. It can also start the synchronization phase after the load.
References: synchro/synchro_import.php• L53-152 synchro/synchro_import.php• L349-447 synchro/synchro_import.php• L453-581 synchro/synchro_import.php• L633-682
Data synchronization
Synchronization compares records in a data source with iTop objects and applies the configured ownership rules. It uses reconciliation keys to match records, update rules to select writable data, and disappearance rules to decide whether records become obsolete or are deleted.
Synchronization source
A SynchroDataSource defines the target class, the external data area, the fields used for reconciliation, and the policy for updates and missing records. Its records are paired with replica status so the system can tell new, changed, synchronized, obsolete, and missing data apart.
References: synchro/synchrodatasource.class.inc.php• L16-32 synchro/synchrodatasource.class.inc.php• L104-175 synchro/synchrodatasource.class.inc.php• L121-165 synchro/synchrodatasource.class.inc.php• L927-1014
Synchronization run
Each run creates a change record and a synchronization log before it processes replicas. The run then checks external records, creates or updates iTop objects, and handles records that are no longer present according to the source policy. The log holds counts, warnings, errors, and traces for later review.
References: synchro/synchrodatasource.class.inc.php• L3054-3110 synchro/synchrodatasource.class.inc.php• L3138-3226 synchro/synchrodatasource.class.inc.php• L3235-3308 synchro/synchrodatasource.class.inc.php• L3443-3499
Synchronization status
Synchronization status is visible through the source history and replica results. A run with errors can send a message to the configured contact with a link to the affected replicas. This makes the data source both a load target and the record of integration health.
The default safety setting also stops a synchronization when all replicas would become obsolete at once. This protects the target data when an external full load is empty or incomplete.
References: synchro/synchrodatasource.class.inc.php• L386-428 synchro/synchrodatasource.class.inc.php• L624-662 synchro/synchrodatasource.class.inc.php• L3277-3304 core/config.class.inc.php• L959-966
Scheduled execution
Scheduled execution gives recurring work a durable next-run time instead of tying it to an incoming request. A process declares either a repeat interval or a calendar occurrence, and cron updates the run record after each attempt.
Process timing
Periodic processes run again after a fixed number of seconds. Scheduled processes calculate their next occurrence from configured days and time. An enabled flag can move a scheduled process far into the future without removing its registration.
References: core/backgroundprocess.inc.php• L21-62 core/backgroundprocess.inc.php• L81-106 core/backgroundprocess.inc.php• L171-230
Cron coordination
Cron first brings the stored process list in line with the processes known to iTop. It then runs active work that is due, applies time limits, records duration and result data, and calculates the next run. A mutex allows only one cron loop to run at a time.
References: webservices/cron.php• L88-167 webservices/cron.php• L187-297 webservices/cron.php• L362-431 webservices/cron.php• L501-529 core/config.class.inc.php• L578-600
Asynchronous work
Asynchronous work stores an operation as a planned task so the original request can finish before the work completes. A short-lived worker claims one planned task, processes it, records its result, and removes it when complete.
Task lifecycle
An AsyncTask moves through planned, running, and completed or error states. The task records its start time and last error. A running marker prevents another worker from claiming the same task.
References: core/asynctask.class.inc.php• L28-55 core/asynctask.class.inc.php• L63-97 core/asynctask.class.inc.php• L119-141 core/asynctask.class.inc.php• L232-257
Retry handling
A failed task can return to planned state when retries remain. The retry delay can be fixed or exponential. When no retries remain, the task enters error state and can run a final failure action. Retry limits and delays can be set per asynchronous task class.
References: core/asynctask.class.inc.php• L143-193 core/asynctask.class.inc.php• L204-215 core/asynctask.class.inc.php• L262-310 core/config.class.inc.php• L602-608
Email delivery
When asynchronous email is enabled, iTop places the message in the async queue instead of sending it during the request. The worker rebuilds the message and sends it synchronously through the configured mail transport. Delivery errors use the task retry and error path.
References: sources/…/EmailSymfony.php• L131-141 sources/…/EmailSymfony.php• L339-365 core/asynctask.class.inc.php• L333-417 core/config.class.inc.php• L618-632
Event-driven notifications
iTop uses triggers and actions to turn changes or other system events into user-facing notifications. The event record links the notification to its trigger, action, target object, and recipient. This lets the interface show context and lets users manage read state.
Notification production
Newsroom notifications are created from an action with a title, message, priority, target link, and recipient list. The notification service chooses an action icon, an object icon, or the application logo so the event remains useful even when no target object exists.
References: sources/…/EventNotificationNewsroomService.php• L22-75 core/asynctask.class.inc.php• L420-500
Notification delivery
Notification subscriptions connect contacts to a trigger and action. The notification repository can find a contact’s notifications and can separate subscribed from unsubscribed recipients. Read newsroom events are removed after the configured retention period by a daily background process.
References: sources/…/NotificationsRepository.php• L58-78 sources/…/NotificationsRepository.php• L142-221 sources/…/EventNotificationNewsroomGC.php• L12-33
Integration event logs
Web-service calls and other system activity can leave event records for audit and diagnosis. REST logs include the operation, provider, result code, and sanitized input and output. SOAP services record the operation result and its information, warning, and error messages when web-service logging is enabled.
References: core/event.class.inc.php• L23-52 core/event.class.inc.php• L283-315 core/event.class.inc.php• L318-350 webservices/rest.php• L246-270 webservices/webservices.class.inc.php• L265-285
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to REST operation versions or provider discovery must stay aligned with the operation list, input contract, result codes, and the web-service event log.
- Changes to synchronization source fields must stay aligned with the external data columns, reconciliation settings, replica status updates, and the synchronization log.
- Changes to process timing must preserve the distinction between interval-based and calendar-based scheduling, including the stored next-run time and the cron time limits.
- Changes to asynchronous task states or retry data must preserve worker claiming, retry scheduling, event status messages, and final error handling.
- Changes to notification actions or recipients must preserve the trigger and action links used by subscription searches and newsroom event creation.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| REST credentials are valid but the account lacks the required REST profile when secure REST services are enabled | The operation is rejected before the provider runs | Use an account with the REST Services User profile and check the returned authorization code |
| An import has no valid reconciliation key or a key matches more than one record | Rows cannot be safely mapped to one target object | Define stable reconciliation fields and review ambiguity errors before enabling writes |
A synchronization feed omits a required primary_key or source reconciliation setup | The load or synchronization cannot identify external records | Validate the feed schema and source policy before execution |
| A full-load window makes all existing replicas look absent | The run can attempt broad obsolescence or deletion | Set the full-load interval correctly and keep the delete policy conservative; the system also protects against deleting all replicas when configured |
| Cron is not run by an administrator or the cron mutex is held by another process | Work is rejected or skipped for that invocation | Run the authenticated cron entry point with administrator rights and monitor task status |
| A cron run or task exceeds its configured time limit | Remaining work waits for a later run or the task stops before completion | Set cron and task limits below the host request limit and monitor the next-run state |
| An asynchronous task exhausts its retries or contains corrupted data | The task enters error state or is deleted, and the queued result is not delivered | Inspect task errors and linked events, then correct the cause before replaying the work |
Key files
| File | Why to read it |
|---|---|
| webservices/rest.php | Shows the REST request boundary, provider selection, authentication, response, and usage logging flow. |
| webservices/soapserver.php and webservices/webservices.basic.php | Shows how SOAP clients discover services and how common ticket and search actions use iTop objects. |
| webservices/import.php | Shows the direct CSV-to-object import path and its reconciliation and simulation behavior. |
| synchro/synchro_import.php | Shows how a CSV feed enters a synchronization source and can lead into a synchronization run. |
| synchro/synchrodatasource.class.inc.php | Defines the synchronization source and the run that compares replicas with iTop objects. |
| webservices/cron.php and core/backgroundprocess.inc.php | Define process discovery, timing, run tracking, and cron coordination. |
| core/config.class.inc.php | Defines the time limits, retry policy, email mode, logging, and synchronization safeguards that shape integration behavior. |
| core/asynctask.class.inc.php and sources/…/EmailSymfony.php | Define queued work, retry behavior, and asynchronous email delivery. |
| sources/…/EventNotificationNewsroomService.php and sources/…/NotificationsRepository.php | Define newsroom event creation and recipient or read-state access. |
| core/event.class.inc.php | Defines the event records used to relate activity, web-service calls, and notifications to their context. |
| datamodels/…/datamodel.itop-hub-connector.xml | Defines the high-level connection settings between an iTop instance and iTop Hub. |