CMDB Instance API
-
- UpdatedJan 30, 2025
- 31 minutes to read
- Yokohama
- API reference
The CMDB Instance API provides endpoints to create, read, update, and delete operations on existing Configuration Management Database (CMDB) tables. You can only insert, update, or delete one record at a time.
This API requires the user have the ITIL role.
CMDB Instance - DELETE /now/cmdb/instance/{classname}/{sys_id}/relation/{rel_sys_id}
Deletes the relation for the specified configuration item (CI).
URL format
Versioned URL: /api/now/{api_version}/cmdb/instance/{className}/{sys_id}/relation/{rel_sys_id}
Default URL: /api/now/cmdb/instance/{className}/{sys_id}/relation/{rel_sys_id}
Supported request parameters
Name | Description |
---|---|
className | CMDB class name.
This is the name of the table that contains the desired CI records, such as
cmdb_ci_linux_server or cmdb_ci_apache_web_server. Data type: String |
rel_sys_id | Sys_id of the relation to remove. Data type: String |
sys_id | Sys_id of the CI. Data type: String |
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
None |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Name | Description |
---|---|
None |
Example: Sample cURL request
CMDB Instance - GET /now/cmdb/instance/{classname}
Returns the available configuration items (CI) for a specified Configuration Management Database (CMDB) class (table).
URL format
Versioned URL: /api/now/{api_version}/cmdb/instance/{className}
Default URL: /api/now/cmdb/instance/{className}
Supported request parameters
Name | Description |
---|---|
className | CMDB class name.
This is the name of the table that contains the desired CI records, such as
cmdb_ci_linux_server or cmdb_ci_apache_web_server. Data type: String |
Name | Description |
---|---|
sysparm_limit | Maximum number of records to return. For requests that exceed this number of records, use the sysparm_offset parameter to paginate record retrieval.
This limit is applied before ACL evaluation. If no records return, including records you have access to, rearrange the record order so records you have access to return first. Note: Unusually large sysparm_limit values can impact system performance.
Data type: Number Default: 20 Maximum: 100 |
sysparm_offset | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the
number of records, in small manageable chunks.
For example, the first time you call this endpoint, sysparm_offset is set to "0". To simply page through all available records, use
Data type: Number Default: 0 |
sysparm_query | Encoded query used to filter the result set. You can use a UI filter
to obtain a properly encoded query. Syntax: sysparm_query=<col_name><operator><value> .
All parameters are case-sensitive. Queries can contain more than one entry, such as sysparm_query=<col_name><operator><value>[<operator><col_name><operator><value>]. For example:
Encoded queries also support order by functionality. To sort responses based on certain fields, use the
Syntax:
For example: This query filters all active records and orders the results in ascending order by number, and then in descending order by category. If part of the query is invalid, such as by specifying an invalid field name, the instance ignores the invalid part. It then returns rows using only the valid portion of the query. You
can control this behavior using the property glide.invalid_query.returns_no_rows. Set this property to true to return no rows on an invalid query. Note: The
glide.invalid_query.returns_no_rows property controls the behavior of all queries across the instance, such as in lists, scripts (GlideRecord.query()), and web service
APIs. Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Name | Description |
---|---|
name | Name of a CI within the specified class. Data type: String |
sys_id | Sys_id of the CI. Data type: String |
Example: Sample cURL request
CMDB Instance - GET /now/cmdb/instance/{classname}/{sys_id}
Returns attributes and relationship information for a specified configuration item (CI) record.
URL format
Versioned URL: /api/now/{api_version}/cmdb/instance/{className}/{sys_id}
Default URL: /api/now/cmdb/instance/{className}/{sys_id}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
className | CMDB class name.
This is the name of the table that contains the desired CI records, such as
cmdb_ci_linux_server or cmdb_ci_apache_web_server. Data type: String |
sys_id | Sys_id of the CI record to retrieve. Data type: String |
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Example: Sample cURL request
CMDB Instance - POST /now/cmdb/instance/{classname}
Creates a single configuration item (CI) with the specified outbound and inbound relations within the specified Configuration Management Database (CMDB) table.
URL format
Versioned URL: /api/now/{api_version}/cmdb/instance/{className}
Default URL: /api/now/cmdb/instance/{className}
Supported request parameters
Name | Description |
---|---|
className | CMDB class name.
This is the name of the table that contains the desired CI records, such as
cmdb_ci_linux_server or cmdb_ci_apache_web_server. Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Example: cURL Request
The following code example shows how to call this endpoint.
Example: cURL Request
The following code example shows how to call this endpoint for a class that has a dependant identification rule defined. The outbound_relations.target must be included in the payload and contain the sys_id of an existing CI.
Example: cURL Request
The following code example shows what is returned when a sys_id is not passed for a class that has a dependant identification rule defined. Same result occurs if the sys_id is invalid.
CMDB Instance - PUT /now/cmdb/instance/{classname}/{sys_id}
Updates the specified configuration item (CI) record with the specified attribute name-value pairs. This endpoint does not create, update, or delete the associated relations.
URL format
Versioned URL: /api/now/{api_version}/cmdb/instance/{className}/{sys_id}
Default URL: /api/now/cmdb/instance/{className}/{sys_id}
Supported request parameters
Name | Description |
---|---|
className | CMDB class name.
This is the name of the table that contains the desired CI records, such as
cmdb_ci_linux_server or cmdb_ci_apache_web_server. Data type: String |
sys_id | Sys_id of the CI record to update. Data type: String |
Name | Description |
---|---|
None |
Name | Description |
---|---|
attributes | Data attributes to replace in the CI record. The available attributes depend on the specified CMDB class. You can locate the available attributes in the associated CMDB table which typically begins with "cmdb_ci", such as cmdb_ci_linux_server or cmdb_ci_mfp_printer. For information about attestation, see CIs attestation. Data type: Object |
source | Required. Entity that updated the information. This must
be one of the choice values specified in the discovery_source field in the
Configuration Item [cmdb_ci] table. Data type: String |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Example: Sample cURL request
CMDB Instance - POST /now/cmdb/instance/{classname}/{sys_id}/relation
Adds an inbound and/or outbound relation to the specified configuration item (CI). The specified CI is the parent.
URL format
Versioned URL: /api/now/{api_version}/cmdb/instance/{className}/{sys_id}/relation
Default URL: /api/now/cmdb/instance/{className}/{sys_id}/relation
Supported request parameters
Name | Description |
---|---|
className | CMDB class name.
This is the name of the table that contains the desired CI records, such as
cmdb_ci_linux_server or cmdb_ci_apache_web_server. Data type: String |
sys_id | Sys_id of the CI record to update. Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Example: Sample cURL request
CMDB Instance - PATCH /now/cmdb/instance/{classname}/{sys_id}
Replaces the attributes in the specified configuration item (CI) record with the specified name-value pairs. This endpoint does not create, update, or delete the associated relations.
URL format
Versioned URL: /api/now/{api_version}/cmdb/instance/{className}/{sys_id}
Default URL: /api/now/cmdb/instance/{className}/{sys_id}
Supported request parameters
Name | Description |
---|---|
className | CMDB class name.
This is the name of the table that contains the desired CI records, such as
cmdb_ci_linux_server or cmdb_ci_apache_web_server. Data type: String |
sys_id | Sys_id of the CI record to update. Data type: String |
Name | Description |
---|---|
None |
Name | Description |
---|---|
attributes | Data attributes to replace in the CI record. The available attributes depend on the specified CMDB class. You can locate the available attributes in the associated CMDB table which typically begins with "cmdb_ci", such as cmdb_ci_linux_server or cmdb_ci_mfp_printer. For information about attestation, see CIs attestation. Data type: Object |
source | Required. Entity that updated the information. This must
be one of the choice values specified in the discovery_source field in the
Configuration Item [cmdb_ci] table. Data type: String |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Example: Sample cURL request
On this page
- CMDB Instance - DELETE /now/cmdb/instance/{classname}/{sys_id}/relation/{rel_sys_id}
- CMDB Instance - GET /now/cmdb/instance/{classname}
- CMDB Instance - GET /now/cmdb/instance/{classname}/{sys_id}
- CMDB Instance - POST /now/cmdb/instance/{classname}
- CMDB Instance - PUT /now/cmdb/instance/{classname}/{sys_id}
- CMDB Instance - POST /now/cmdb/instance/{classname}/{sys_id}/relation
- CMDB Instance - PATCH /now/cmdb/instance/{classname}/{sys_id}