-
Notifications
You must be signed in to change notification settings - Fork 15
REST API Network Mapper
The complete usage guide for the Network Mapper module of the REST API β diagrams, nodes, connectors, version snapshots and the suggestions feed. Mirrors the interactive documentation at System β API β Documentation (with its live "Try it" tester).
Note
New to the API? The basics table on REST API: Tickets covers base URL, authentication, the response envelope, error codes, rate limits and PATCH semantics β identical across all modules.
What's distinctive about Network Mapper:
| π€ Built for discovery agents | The target consumer is an agentic network-discovery tool keeping diagrams alive: read what's drawn, ask what's missing, add the new switch, snapshot a version first. Stale network diagrams are the classic ITSM failure β this API is the fix. |
| π§ Diagrams a machine can understand | Nodes aren't anonymous boxes β each is bound to a CMDB object, and reads hydrate everything: the CI's name, class, effective icon, planned flag, optionally its full typed properties, plus each connector's endpoint objects and the CMDB relationship verb it represents, and a layout block with the canvas bounding box. |
| π§ Surgical edits with stable ids | The editor can only save the whole canvas (regenerating every node id). The API adds incremental operations β add/move/restyle/remove a single node or connector β and the ids stay stable, so an agent can track elements across edits. |
| π§² Think in CIs, not node ids | Connectors accept from_object_id/to_object_id, and cmdb_relationship_id: "auto" binds the drawn line to the real CMDB relationship between the two objects. Omitted x/y coordinates auto-place in a tidy column for a human to arrange later. |
| π°οΈ Versions as undo points | The module's linear version chain: only the newest (leaf) version is editable, history is frozen. POST .../versions snapshots before automated changes β a free rollback point for cautious agents. |
B="https://your-server/api/v1"; K="Authorization: Bearer fitsm_β¦"
# What's on the diagram? (full hydration: CIs, classes, verbs, layout)
curl -s "$B/network-diagrams/7?include_properties=true" -H "$K"
# What's missing? CMDB neighbours of drawn objects, not yet on the canvas
curl -s "$B/network-diagrams/7/suggestions" -H "$K"
# Snapshot first (free undo), then draw the newly discovered switch
NEW=$(curl -s -X POST "$B/network-diagrams/7/versions" -H "$K" \
-H "Content-Type: application/json" -d '{"version_label": "auto-sync"}' | jq -r '.data.id')
curl -s -X POST "$B/network-diagrams/$NEW/nodes" -H "$K" -H "Content-Type: application/json" \
-d '{"cmdb_object_id": 41}' # x/y omitted β auto-placed
curl -s -X POST "$B/network-diagrams/$NEW/connectors" -H "$K" -H "Content-Type: application/json" \
-d '{"from_object_id": 41, "to_object_id": 38, "cmdb_relationship_id": "auto"}'Current versions only by default (all_versions=true for frozen history), most recently updated first, with node/connector counts. Filters: q (titles + descriptions), contains_object_id (every diagram a given CI is drawn on β "which maps show this server?"), created_by, updated_since, pagination.
title required. Optionally ship the whole initial drawing in one call:
{ "title": "Head office network",
"nodes": [ { "cmdb_object_id": 1, "ref": "fw" },
{ "cmdb_object_id": 2, "ref": "sw1", "x": 300, "y": 100, "size": "large" } ],
"connectors": [ { "from_ref": "fw", "to_ref": "sw1", "cmdb_relationship_id": "auto" } ] }Nodes may carry a ref (any string) for connectors to reference; nodes without x/y are auto-placed. Also settable: paper_size/paper_orientation (A4/A3/A2/Letter/Tabloid), branding header/footer slots (null = inherit the org default).
The full machine-legible drawing. Add ?include_properties=true for each object's typed CI property values:
{ "data": { "id": 7, "title": "Head office network", "is_current": true,
"nodes": [ { "id": 224, "x": 100, "y": 100, "size": "medium", "size_px": 56,
"icon": "server", "icon_override": null,
"object": { "id": 16, "name": "SQLSVR01", "is_planned": false,
"class": { "id": 12, "name": "Server", "icon": "server" } } } ],
"connectors": [ { "id": 185,
"from": { "node_id": 224, "object_id": 16, "object_name": "SQLSVR01" },
"to": { "node_id": 225, "object_id": 38, "object_name": "CORE-SW01" },
"relationship": { "id": 21, "verb": "connects to", "inverse_verb": "is connected from" },
"label": null, "line_style": "dashed" } ],
"layout": { "bounds": { "min_x": 100, "min_y": 100, "max_x": 316, "max_y": 156 },
"width": 216, "height": 56,
"node_sizes_px": { "small": 40, "medium": 56, "large": 80 } } } }Partial metadata update (title, description, version_label, paper, branding). Sending nodes and/or connectors switches to full contents replace β both sets are replaced and every node id regenerates, exactly like an editor save. For surgical edits, use the node/connector endpoints instead. A frozen historical version is a 409.
Leaf-only: deleting the current version resurfaces its parent as current ("discard this draft"). A version with newer history after it is a 409 β the UI lets that corrupt the chain; the API refuses. ?chain=true deletes the entire version chain, transactionally.
The whole chain containing this diagram, oldest first, with is_current flags.
Clones the current version forward β nodes, connectors, paper and branding all copied; the clone becomes editable and the source freezes (the editor's "New version"). title/description/version_label default to the source's. 409 unless called on the current version.
CMDB neighbours of on-diagram objects that aren't drawn yet β found via relationships in both directions and object_ref property links (one direction more than the module's own related-objects feed). Each suggestion carries everything needed to draw it:
{ "data": [ { "object": { "id": 39, "name": "CORE-RTR01", "is_planned": false,
"class": { "id": 18, "name": "Network Device", "icon": "network" } },
"via": [ { "kind": "relationship", "from_object_id": 38,
"label": "connects to", "relationship_id": 26 } ] } ] }?object_id= scopes to one on-diagram object's neighbours; ?limit= caps results (default 50). An empty array means the diagram already shows everything the CMDB knows about.
All these require the current version (frozen history is a 409) and carry π network_diagrams.update.
One node (body = the node) or a batch ({"nodes": [...]}). cmdb_object_id required; x/y optional (auto-placed in a fresh column right of the drawing); size small|medium|large; icon_override any key from GET /cmdb-icons. An object already on the diagram is a 409 unless allow_duplicate: true.
PATCH moves/restyles (x, y, size, icon_override β null reverts to the class icon). DELETE removes the node and every connector touching it (count returned).
Endpoints by from_node_id/to_node_id or from_object_id/to_object_id (422 if the object isn't on the diagram, or is on it twice β disambiguate with node ids). cmdb_relationship_id: an id, null, or "auto" (binds to the existing CMDB relationship between the two objects, either direction). Self-loops are a 422; an already-connected pair is a 409 unless allow_duplicate: true. label free text, line_style solid|dashed.
PATCH updates label, line_style, cmdb_relationship_id (null clears, "auto" re-resolves).
The icon catalogue β every icon_key usable as a class icon or a node's icon_override.
- Everything is a CI. You can't draw a free-form box β nodes must reference CMDB objects. If discovery finds something new, create the CI first (via the CMDB API), then draw it. That constraint is the feature: the diagram is always backed by real inventory.
- Strict where the editor is lenient: unknown object ids, sizes, icon keys and line styles are 422s (the editor silently skips bad rows on save).
- Deleting a CMDB object removes it from every diagram β nodes and their connectors go with the CI (as of the #705 integrity fix; previously grown installs silently dropped the boxes from view while leaving orphaned rows behind).
- The PNG/PDF export is client-side (rendered in the browser), so the API can't produce images β only the structure. Render pipelines can consume the hydrated GET instead.
- Coordinates are canvas pixels, top-left origin;
layout.node_sizes_pxgives each size class's footprint so an agent can reason about overlap and spacing.
See also: REST API (how it all works) Β· REST API: CMDB (the objects behind the nodes) Β· Network Mapper (the module itself) Β· the other module guides linked from the sidebar.
FreeITSM β an open-source IT Service Management platform Β· github.com/edmozley/freeitsm Β· MIT licence
- Installation
- β° Scheduled tasks (cron jobs)
- Architecture
- AI Providers
- Internationalisation (i18n)
- Timezones & Time Handling
- Theming & Dark Mode
- β¨οΈ Command palette (βK)
- π Searching inside tickets
- π Attached documents
- MobileβFriendly
-
Security
- Layer 1 β which modules you can enter
- β³ π§© Module Access Control
- β³ π οΈ Module Access β Developer Guide
- Layer 2 β what you can administer
- β³ π Roles & Permissions
- β³ π οΈ Roles β Developer Guide
- β³ π€ Why capabilities are constants
- Layer 3 β the System module
- β³ π Admin Access Control
- Hardening
- β³ π Security review response 2026-08
- β³ π‘οΈ Security hardening 2026-08
- β³ π οΈ Security hardening 2026-08 β Developer Guide
- β³ π‘οΈ Round three β plain English
- β³ π οΈ Round three β Developer Guide
- Single Sign-On (SSO)
- ποΈ LDAP & Active Directory
- Browser Extension
- API Reference
-
π REST API β how it works
- β³ π« REST API: Tickets
- β³ π» REST API: Assets
- β³ π΄ REST API: Problems
- β³ π REST API: Changes
- β³ π REST API: Knowledge
- β³ β REST API: Tasks
- β³ ποΈ REST API: CMDB
- β³ π REST API: Contracts
- β³ ποΈ REST API: Calendar
- β³ πΏ REST API: Software
- β³ π¦ REST API: Service Status
- β³ βοΈ REST API: Morning Checks
- β³ π REST API: Forms
- β³ βοΈ REST API: Workflow
- β³ πΊοΈ REST API: Network Mapper
- β³ π§ Using the API docs page
- β³ π OpenAPI specification
- β³ β OpenAPI: kept correct
- β³ π οΈ Maintaining the catalogue
- Watchtower
-
Tickets
- β³ Mailbox Authentication
- β³ π€ Email send log
- β³ Basic IMAP mailboxes
- β³ Email rendering & images
- β³ SLA Management
- β³ WhatsApp channel
- β³ π¬ Web chat channel
- β³ π£ Slack channel
- β³ π Linking tickets
- β³ ποΈ Canned responses
- β³ βοΈ Limiting replies to particular senders
- β³ βοΈ Email signatures
- β³ π The public web address
- β³ π Raising a ticket for someone else
- β³ π Merging tickets
- β³ β Splitting tickets
- β³ β Selecting several tickets
- β³ π οΈ Snoozing tickets β Developer Guide
- β³ π₯ Collision detection
- β³ β±οΈ Time tracking
- Problem Management
- Tasks
- Assets
- Knowledge
- Change Management
- Calendar
- Morning Checks
- Reporting
- Software
- Forms
- Contracts
- Service Status
- π Notifications
- π¨ War Room
- Self-Service Portal
- LMS
- Process Mapper
- CMDB
- Network Mapper
- Workflows
- Issue trackers (Jira, Azure DevOps)
- System
-
Overview
- β³ π Progress tracker
- β³ Concepts & vocabulary
- β³ Email routing & mailboxes
- β³ Settings: global vs per-company
- β³ Users & self-service
- β³ Staff cross-company access
- β³ Worked examples
- β³ Pitfalls & gotchas
- β³ Scope: what it's for
- β³ π οΈ Developer Guide (make a module multi-company)
- β³ ποΈ Case study: CMDB (a linked graph)
- β³ π§ͺ Test harness (prove it's isolated)