Squid supports HTTP GET requests and returns JSON.
Request
Squid API Request Overview Overview diagram showing the structure of a Squid API request. A Squid URL consists of:
1. Base path (fixed): /api/x_a46gh_squidx/v1/data/
2. Configuration name: The primary element - determines database view, fields, reference handling, and available relations
3. Query parameters in three categories:
- Filters (purple): Restrict which records return
- Relations (red): Include related entities
- Flags (gray): Toggle output features /api/x_a46gh_squidx/v1/data/ Base path (fixed) cmdb_ci_server Configuration ? encodedQuery =base_name=myserver Filters & relations =network_ports,used_by Relations & showTags & ... Flags Configuration The configuration defines what data is returned and how it's rendered. QUERY PARAMETERS Filters Restrict which records return encodedQuery sys_id limit updatedSince filterOnTags filterOnTeams Relations Include related entities relations {config}.relations 1:N, M:N, CMDB relations Flags Toggle output features showBlank showTags showConfig metaData preservePrefix lenient
The URL is https://yourinstance/api/x_a46gh_squidx/v1/data/{configName} where {configName} is the name of the configuration you are requesting. Configurations define what data is returned—for example, cmdb_ci_server returns all server CIs. See Predefined Configurations for available configurations.
Query parameters refine requests: filter results, request specific entities, include relations, and toggle output features.
Try it: https://demo.squid46.io/cmdb_ci_server_minimal?limit=10
The demo server is proxied and rate-limited. If you're getting HTTP 429s, slow down! (This is only an issue on the publicly available demo server. )
To keep URLs shorter and more readable, all links to https://demo.squid46.io omit the /api/x_a46gh_squidx/v1/data/ path segment.
Response
Every Squid response contains four sections:
Squid Response Structure This diagram illustrates the structure of a Squid JSON response, showing how the four main sections
connect to provide complete entity data with resolved references and relations.
RESPONSE STRUCTURE - A Squid response contains four top-level sections:
1. METADATA - Request information and statistics
2. DATA - Array of requested entities with reference stubs
3. RELATIONS - Related entities organized by parent sys_id
4. REFERENCED - Fully resolved reference and relation data
The diagram uses color-coded sys_ids to show how references resolve:
- Cyan "5f9b83bf..." in data matches the key "5f9b83bf..." in relations
- Purple "6577e590..." in data.assigned_to resolves to "6577e590..." in referenced
- Purple "b85d4495..." in relations resolves to "b85d4495..." in referenced SQUID RESPONSE application/json "metadata" { config, row_count, provided_filter, ... } "data" [ array of entities ] { "sys_id": "5f9b83bf... ", "name": "Server01", "assigned_to": { "sys_id": "6577e590... " } } "relations" { keyed by entity sys_id } "5f9b83bf... ": { "user_groups": [ { "sys_id": "b85d4495... " }, ... ] } "referenced" { resolved entities } "6577e590... ": { "name": "Sarah Chen", "email": "sarah.chen@example.com", "sys_class_name": "sys_user" }, "b85d4495... ": { "name": "Infrastructure", "active": true, "sys_class_name": "sys_user_group" } HOW IT CONNECTS Entity sys_id links data → relations Reference sys_ids resolve in "referenced" No data duplication
metadata — Request information, timing, and filter details
data — Array of requested entities
relations — Related entities, organized by parent sys_id
referenced — Complete data for all referenced and related entities
This structure avoids data duplication: an entity referenced multiple times appears once in referenced.
Relations
Resolving references and relations is the added value of Squid. References are resolved by default and do not have to be
explicitly requested. Relations require additional database queries and are only resolved if requested.
Squid supports three different types of relations:
Squid Relation Types Overview This diagram explains the three types of relations Squid supports for retrieving related data from ServiceNow.
The diagram uses a vertical layout with one section per relation type.
1. 1:N RELATIONS (Top section, cyan color):
A child entity has a reference field pointing back to the parent entity.
The diagram shows a Parent table (cmdb_ci with sys_id "5f9b83bf...") on the left, and a Child table
(cmdb_ci_network_adapter) on the right with multiple rows, each containing a "cmdb_ci" field
with value "5f9b83bf..." pointing back to the parent.
An arrow flows from the child table back to the parent, illustrating the reference direction.
Example use case: Network adapters belonging to a server, IP addresses on a NIC.
Key characteristic: Child references parent via a field. Single efficient query.
2. M:N RELATIONS (Middle section, purple color):
A junction table connects two entities via reference fields (from_column and to_column).
The diagram shows three tables: Table A (cmdb_ci) on the left, a Junction table (cmdb_rel_team)
in the center with columns for "ci", "group", and "group_type", and Table B (sys_user_group) on the right.
Arrows connect Table A to the junction table's "ci" column, and the junction table's "group" column
to Table B.
The group_type column is highlighted as it can become a dynamic JSON property name.
Example use case: Team assignments (managed_by, support, approval groups for a CI).
Key characteristic: Junction table with optional column for dynamic JSON property names.
3. CI RELATIONS (Bottom section, red color):
ServiceNow's native CI relationship system using the cmdb_rel_ci table.
The diagram shows a Parent CI (e.g., Server) on the left, the cmdb_rel_ci table in the center
with columns for "parent", "child", and "type", and a Child CI (e.g., Application) on the right.
Bidirectional arrows indicate that queries can retrieve parents, children, or both.
A relationship type badge shows "runs_on" as an example type.
Other relationship types include: depends_on, hosts, contains, uses, virtualizes.
Example use case: Server runs_on VM, Application depends_on Database.
Key characteristic: Directional - query parents, children, or both. Named relationship types.
All three relation types can be rendered using either "Relation" render types (batched, efficient,
data in separate relations/referenced sections) or "Inline" render types (self-contained but
with potential performance impact for large datasets). 1:N Relations Child references parent cmdb_ci sys_id: 5f9b83bf... cmdb_ci_network_adapter cmdb_ci: 5f9b83bf... cmdb_ci: 5f9b83bf... cmdb_ci: 5f9b83bf... Child entity contains a reference field pointing to the parent entity. Single query retrieves all children for multiple parents. Very efficient. Examples: network adapters, IP addresses, disks M:N Relations Junction table connects entities cmdb_ci sys_id cmdb_rel_team ci (from) group (to) group_type sys_user_group sys_id Junction table connects two tables via reference columns. Column values can become dynamic JSON property names: group_type → "managed_by", "support" Examples: team assignments, task_ci, user groups CI Relations cmdb_rel_ci Parent CI Server cmdb_rel_ci parent child type Child CI Application runs_on get_parents get_children ServiceNow's native CI relationship system with named relationship types. Directional: query parents, children, or both directions. Relationship types: depends_on hosts runs_on contains uses virtualizes
See Predefined Relations for an overview of all predefined relations
provided by Squid.
relations
Relations are requested as query parameter relations. Squid accepts this parameter in various formats:
relations=rel1,rel2,rel3
relations=rel1&relations=rel2&relations=rel3
relations=rel1,rel2&relations=rel3
Use whatever fits your calling application best.
Depending on your configurations, relations may be rendered in various ways. See RenderTypes for Relations for details on all available options, including Relation types and Inline types .
The key distinction is where related data appears in the response:
Relation vs Inline Rendering Comparison This diagram compares two approaches for rendering relations in Squid responses: external (Relation)
rendering and Inline rendering. The comparison helps developers choose the right approach based on
their performance and data structure requirements.
RELATION RENDERING (Left side, recommended default):
The data array contains minimal entity data for server "web-prod-zurich-01". Related entities are
placed in the "relations" object, keyed by parent sys_id, with dynamically named properties
("managed_by", "support") containing references (sys_id + sys_class_name) to user groups.
Full entity details are resolved once in the "referenced" object, keyed by sys_id. Dynamic property
names reflect the role each user group plays.
Example structure shown:
- data: [{ sys_id: "da9b0e66...", name: "web-prod-zurich-01" }]
- relations: { "da9b0e66...": { managed_by: [{ sys_id: "81339666..." }], support: [{ sys_id: "01335a66..." }], ... } }
- referenced: { "81339666...": { name: "IT Infrastructure", ... }, ... }
The diagram shows a visual connection (dashed arrow) from the sys_id "81339666..." in the managed_by
relations entry to the corresponding resolved entity in the referenced section, demonstrating the
lookup pattern.
Benefits marked with checkmarks:
- Efficient: batched queries, one query per relation type
- No duplicates: referenced entities appear once regardless of how many times referenced
INLINE RENDERING (Right side, use with caution):
Related entities are embedded directly within the parent entity object in the data array, under the
dynamically named property "managed_by". The full entity data (name, active status, etc.) is nested
inside the parent object. The relations and referenced objects exist but are empty for inline
relations (shown dimmed). Note: other elements like references could still populate these sections.
Example structure shown:
- data: [{ sys_id: "da9b0e66...", name: "web-prod-zurich-01", managed_by: [{ name: "IT Infrastructure", ... }], ... }]
- relations: {} (dimmed, empty for inline relations)
- referenced: {} (dimmed, empty for inline relations)
Benefits marked with checkmarks:
- Self-contained: each entity has all its data inline
- Easy to consume: no assembly required, ready to use
Tradeoffs marked with warning triangle:
- Performance impact: requires individual queries for each entity's relations
- Data duplication: same referenced entity may appear multiple times
RECOMMENDATION: Use Relation rendering by default. Only use Inline when the consuming
application truly benefits from self-contained entities and the performance cost is acceptable. RELATION RENDERING Default "data" : [{"sys_id": "da9b0e66...", "name": "web-prod-zurich-01" }], "relations" : {"da9b0e66...": { "managed_by" : [{ "sys_id": "81339666... " } ], "support" : [{ "sys_id": "01335a66..." } ], ... } }, "referenced" : {"81339666... ": { "name": "IT Infrastructure", ... }, ... } Efficient (batched queries) No duplicates in response INLINE RENDERING Use with care "data" : [{"sys_id": "da9b0e66...", "name": "web-prod-zurich-01", "managed_by" : [{ "name": "IT Infrastructure", "active": true, ... } ], ... }], "relations": {}, "referenced": {} Self-contained entities Easy to consume Performance impact possible Data duplication possible
Relation
Relations are rendered not in the parent JSON object, but in a dedicated relations property.
See RenderType Relation* for details.
Try
it: https://demo.squid46.io/cmdb_ci_server_minimal?encodedQuery=base_name=web-prod-zurich-01&relations=ci_to_user_group_dynamic
Response
{ ... , "data" : [ { "name" : "web-prod-zurich-01" , "sys_class_name" : "cmdb_ci_server" , "sys_id" : "da9b0e66ebf67254f0a4fe7acad0cdf3" , <= sys_id of requested server "sys_mod_count" : 1 , "sys_updated_on" : "2026-02-04T14:30:00Z" } ] , "relations" : { "da9b0e66ebf67254f0a4fe7acad0cdf3" : { <= sys_id of requested server "managed_by" : [ <= dynamic property name { "sys_id" : "81339666eb3a7254f0a4fe7acad0cdba" , <= sys_id of user group "sys_class_name" : "sys_user_group" } ] , "change" : [ <= dynamic property name { "sys_id" : "81339666eb3a7254f0a4fe7acad0cdba" , <= same group , different role "sys_class_name" : "sys_user_group" } ] , "support" : [ <= dynamic property name { "sys_id" : "01335a66eb3a7254f0a4fe7acad0cd4e" , <= sys_id of user group "sys_class_name" : "sys_user_group" } ] , "approval" : [ <= dynamic property name { "sys_id" : "a715cd759f2002002920bde8132e7018" , <= sys_id of user group "sys_class_name" : "sys_user_group" } ] } } , "referenced" : { <= each group resolved once "81339666eb3a7254f0a4fe7acad0cdba" : { <= managed_by + change "active" : true , "description" : "Infrastructure operations team ..." , "name" : "IT Infrastructure" , "sys_created_by" : "ferret" , "sys_created_on" : "2026-02-04T15:01:46Z" , "sys_id" : "81339666eb3a7254f0a4fe7acad0cdba" , "sys_mod_count" : 0 , "sys_updated_by" : "ferret" , "sys_updated_on" : "2026-02-04T15:01:46Z" } , "01335a66eb3a7254f0a4fe7acad0cd4e" : { <= support "name" : "IT Service Desk" , ... } , "a715cd759f2002002920bde8132e7018" : { <= approval "name" : "Change Management" , ... } } }
Inline
Inline relations are rendered as properties of the enclosing JSON object.
Rendering relations inline may have an extreme performance impact .
See RenderType Inline* for details.
Try
it: https://demo.squid46.io/cmdb_ci_server_inline_minimal?encodedQuery=base_name=web-prod-zurich-01&relations=ci_to_user_group_inline
Response
{ ... , "data" : [ { "name" : "web-prod-zurich-01" , "sys_class_name" : "cmdb_ci_server" , "sys_id" : "da9b0e66ebf67254f0a4fe7acad0cdf3" , "sys_mod_count" : 1 , "sys_updated_on" : "2026-02-04T14:30:00Z" , "user_groups" : [ <= ci_to_user_group_inline { "active" : true , "description" : "Infrastructure operations team ..." , "name" : "IT Infrastructure" , "sys_id" : "81339666eb3a7254f0a4fe7acad0cdba" , <= sys_id of user group "sys_mod_count" : 0 , ... } , { "active" : true , "description" : "First-line support for end-user issues" , "name" : "IT Service Desk" , "sys_id" : "01335a66eb3a7254f0a4fe7acad0cd4e" , <= sys_id of user group "sys_mod_count" : 0 , ... } , ... ] } ] , "relations" : { } , <= empty — relations are inline "referenced" : { } <= empty — entities are inline }
{configName}.relations
The relations parameter only resolves relations for root entities. To add relations to referenced or
related entities — for example, resolving users for each user group — use:
{configName}.relations=relationName
This tells Squid: "whenever you render an entity using {configName}, also resolve these relations."
How {configName}.relations Works This diagram shows how the {configName}.relations query parameter adds relations to entities
that are not rendered with the root configuration, creating deeply nested inline structures.
REQUEST shown at top:
/cmdb_ci_server_inline_minimal?encodedQuery=base_name=web-prod-zurich-01
&relations=ci_to_user_group_dynamic_inline
&sys_user_group_inline.relations=user_group_to_user_inline_minimal
This request has two relation parameters:
- relations=ci_to_user_group_dynamic_inline (cyan) adds user groups inline to the root server entity
- sys_user_group_inline.relations=user_group_to_user_inline_minimal (orange) adds users inline
to each group rendered with the sys_user_group_inline configuration
The JSON RESPONSE shows a deeply nested inline structure in the data section:
The server "web-prod-zurich-01" contains four inline relation arrays representing different
team roles: managed_by, change, support, and approval. Each array contains user group objects.
The managed_by group "IT Infrastructure" is shown expanded, containing a "users" array with
user objects (Michael Weber, Sarah Johnson, and more). These users only appear because of
the sys_user_group_inline.relations parameter. The other groups (support, change, approval)
are shown collapsed for brevity but contain the same nested structure.
The relations and referenced sections are both empty objects — all data is embedded inline
in the nested structure, demonstrating how inline rendering eliminates the need for
cross-referencing between response sections.
Key insight: The root "relations" parameter adds groups to the server.
The {configName}.relations parameter adds users to each group.
Without sys_user_group_inline.relations, the groups would appear without their users array.
Color coding:
- Cyan (#0891b2): Elements added by the relations= parameter (user groups in server)
- Orange (#ea580c): Elements added by sys_user_group_inline.relations= parameter (users in groups)
- Gray (#6b7280): Collapsed groups and empty response sections REQUEST /cmdb_ci_server_inline_minimal?encodedQuery=base_name=web-prod-zurich-01 &relations=ci_to_user_group_dynamic_inline &sys_user_group_inline.relations=user_group_to_user_inline_minimal RESPONSE "data" [ nested inline structure ] [{ "name": "web-prod-zurich-01", "sys_id": "da9b0e66...", ..., "managed_by": [{ "name": "IT Infrastructure", ..., "users": [ { "name": "Michael Weber", ... }, { "name": "Sarah Johnson", ... }, ... ] }], "support": [{...}], "change": [{...}], ... }] from relations= ci_to_user_group_dynamic_inline from sys_user_group_inline. relations= user_group_to_user_inline_minimal "relations": {} "referenced": {} all inline KEY INSIGHT relations adds groups to the server. {configName}.relations adds users to each group.
Example: Fetch a server with its user groups inline, and resolve the users for each group:
Try it: https://demo.squid46.io/cmdb_ci_server_inline_minimal?encodedQuery=base_name=web-prod-zurich-01&relations=ci_to_user_group_dynamic_inline&sys_user_group_inline.relations=user_group_to_user_inline_minimal
relations=ci_to_user_group_dynamic_inline — adds user groups inline to the server
sys_user_group_inline.relations=user_group_to_user_inline_minimal — adds users inline to each group rendered with the sys_user_group_inline configuration
Without the second parameter, the groups would appear without their users.
Response (trimmed)
{ ... , "data" : [ { "name" : "web-prod-zurich-01" , "sys_class_name" : "cmdb_ci_server" , "sys_id" : "da9b0e66ebf67254f0a4fe7acad0cdf3" , ... , "managed_by" : [ <= inline user group { "name" : "IT Infrastructure" , "sys_id" : "81339666eb3a7254f0a4fe7acad0cdba" , ... , "users" : [ <= inline users { "name" : "Michael Weber" , "email" : "michael.weber@example.com" , "sys_id" : "bb135666eb3a7254f0a4fe7acad0cd37" , ... } , { "name" : "Sarah Johnson" , ... } , ... ] } ] , "change" : [ ... ] , "support" : [ ... ] , "approval" : [ ... ] } ] , "relations" : { } , <= empty — all relations are inline "referenced" : { } <= empty — all entities are inline }
As with relations, Squid accepts this parameter in various formats:
configName.relations=rel1,rel2,rel3
configName.relations=rel1&configName.relations=rel2
See Recursive Structures for an advanced use case with nested parent-child hierarchies.
Filters
Most use cases require filtering to retrieve a specific subset of data.
See Filters for all filter parameters: encodedQuery , sys_id , timestamp filters , filterOnTags , filterOnTeams , and limit .
Flags
Flags are query parameters that turn on features.
See Flags for all available flags: showBlank , showTags , showTagsInline , preservePrefix , showConfig , metaData , and lenient .