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.
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.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.
401
Unauthorized. The user credentials are incorrect or have not been passed.
404
Not found. The requested item wasn't found.
405
Invalid method. The functionality is disabled.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
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: 10000
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 sysparm_offset=sysparm_offset+sysparm_limit, until you reach the end of all records.
Don't pass a negative number in the sysparm_offset parameter.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>. Column names, operators, and values are case-sensitive.
<col_name>: Name of the table column to filter on.
<operator>: Supports the following values:
=: <col_name> exactly matches <value>.
!=: <col_name> does not match <value>.
LIKE: <col_name> contains the specified string <value>. Only works for <col_name> fields whose data type is string.
STARTSWITH: <col_name> starts with the specified string <value>. Only works for <col_name> fields whose data type is string.
ENDSWITH: <col_name> ends with the specified string <value>. Only works for <col_name> fields whose data type is string.
^: AND operator to add an additional query condition. Records included in the result set match both conditions.
^OR: OR operator to add an additional query condition. Records included in the result set match at least one of the conditions.
Queries can contain multiple conditions. For example, the following query returns records where the caller is the current user and the record is active.
Encoded queries also support order by ascending and descending functionality. To sort responses based on certain fields, use the ORDERBY and ORDERBYDESC clauses in sysparm_query.
Syntax:
ORDERBY<col_name>
ORDERBYDESC<col_name>
For example, the following query gets all active records and orders the results in ascending order by number, and then in descending order by category.
By default, if part of a query is invalid, such as an invalid field name, the instance ignores the invalid part. It then returns rows using only the valid portion of the query. Set the property glide.invalid_query.returns_no_rows to true to instead 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.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.
401
Unauthorized. The user credentials are incorrect or have not been passed.
404
Not found. The requested item wasn't found.
405
Invalid method. The functionality is disabled.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
Response body parameters (JSON or XML)
Name
Description
name
Name of a CI within the specified class.Data type: String
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.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.
401
Unauthorized. The user credentials are incorrect or have not been passed.
404
Not found. The requested item wasn't found.
405
Invalid method. The functionality is disabled.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
Response body parameters (JSON or XML)
Name
Description
attributes
Data attributes currently 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.Data type: Object
error
Information on any errors encountered while processing the endpoint request. Data type: Object
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.
Note: If the CMDB class has a dependent identification rule defined, then the input payload must contain the sys_id of an existing CI. For example, for outbound_relations, the target parameter must contain the sys_id of an existing CI, which then becomes the child. For inbound_relations, it becomes the parent.
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
Name
Description
attributes
Data attributes to define 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.Data type: Object
inbound\_relations
List of objects that define the inbound relations to associate with the CI.Data type: Array
Required if inbound_relations is specified. Sys_id of the target inbound relation to associate with the specified CI. Located in the Configuration Item [cmdb_ci] table. Data type: String
inbound\_relations.type
Required if inbound_relations is specified. Sys_id of the type of inbound relationship. Located in the CI Relationship Type [cmdb_rel_type] table.Data type: String
outbound\_relations
List of objects that define the outbound relations to associate with the CI.Data type: Array ``` "outbound_relations": [ { "target": "String", "type": "String" } ]
</td></tr><tr><td>
outbound\_relations.target
</td><td id="entry-request-outbound_relations_target-cmdb">Required if <strong>outbound_relations</strong> is specified. Sys_id of the target outbound relation. Located in the Configuration Item [cmdb_ci] table.Data type: String</td></tr><tr><td>
outbound\_relations.type
</td><td id="entry-request-outbound_relations_type-cmdb">Required if <strong>outbound_relations</strong> is specified. Sys_id of the type of outbound relationship. Located in the CI Relationship Type [cmdb_rel_type] table.Data type: String</td></tr><tr><td>
source
</td><td id="entry-source-cmdb">
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
</td></tr></tbody>
</table>
### 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](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="accept-entry-RESTAPI">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr><tr><td>
Content-Type
</td><td id="content_type-entry-RESTAPI">Data format of the request body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr></tbody>
</table>
|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](../rest-api-explorer/c_RESTAPI.md).
|Status code|Description|
|-----------|-----------|
|200|Successful. The request was successfully processed.|
|400|Bad Request. A bad request type or malformed request was detected.|
|401|Unauthorized. The user credentials are incorrect or have not been passed.|
|404|Not found. The requested item wasn't found.|
|405|Invalid method. The functionality is disabled.|
|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|
### Response body parameters \(JSON or XML\)
<table id="table_ags_gn4_3mb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td>
Data attributes currently 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.Data type: Object
</td></tr><tr id="row-result-error-cmdb"><td>
error
</td><td id="entry-result-error-cmdb">
Information on any errors encountered while processing the endpoint request. Data type: Object
</td></tr><tr id="row-result-error_detail-cmdb"><td>
error.detail
</td><td id="entry-result-error_detail-cmdb">
Additional information about the error.Data type: String
</td></tr><tr id="row-result-error_message-cmdb"><td>
error.message
</td><td id="entry-result-error_message-cmdb">
Message that identifies the error.Data type: String
</td></tr><tr id="row-result-inbound_relations-cmdb"><td>
inbound\_relations
</td><td id="entry-result-inbound_relations-cmdb">
List of objects that define the inbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-inbound_relations_sys_id-cmdb"><td>
inbound\_relations.sys\_id
</td><td id="entry-result-inbound_relations_sys_id-cmdb">
Sys\_id of the inbound CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target-cmdb"><td>
inbound\_relations.target
</td><td id="entry-result-inbound_relations_target-cmdb">
Information that describes the target inbound relation.Data type: Object
</td></tr><tr id="row-result-inbound_relations_target_display_value-cmdb"><td>
inbound\_relations.target.display\_value
</td><td id="entry-result-inbound_relations_target_display_value-cmdb">
Name of the inbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_link-cmdb"><td>
inbound\_relations.target.link
</td><td id="entry-result-inbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the inbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_value-cmdb"><td>
inbound\_relations.target.value
</td><td id="entry-result-inbound_relations_target_value-cmdb">
Sys\_id of the inbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type-cmdb"><td>
inbound\_relations.type
</td><td id="entry-result-inbound_relations_type-cmdb">
Information about the type of inbound relationship. Data type: Object
</td></tr><tr id="row-result-inbound_relations_type_display_value-cmdb"><td>
inbound\_relations.type.display\_value
</td><td id="entry-result-inbound_relations_type_display_value-cmdb">
Name of the inbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_link-cmdb"><td>
inbound\_relations.type.link
</td><td id="entry-result-inbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the inbound relation type from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_value-cmdb"><td>
inbound\_relations.type.value
</td><td id="entry-result-inbound_relations_type_value-cmdb">
Sys\_id of the type of inbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations-cmdb"><td>
outbound\_relations
</td><td id="entry-result-outbound_relations-cmdb">
List of objects that define the outbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-outbound_relations_sys_id-cmdb"><td>
outbound\_relations.sys\_id
</td><td id="entry-result-outbound_relations_sys_id-cmdb">
Sys\_id of the outbount CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target-cmdb"><td>
outbound\_relations.target
</td><td id="entry-result-outbound_relations_target-cmdb">
Required. Information about the target outbound relation.Data type: Object
</td></tr><tr id="row-result-outbound_relations_target_display_value-cmdb"><td>
outbound\_relations.target.display\_value
</td><td id="entry-result-outbound_relations_target_display_value-cmdb">
Name of the outbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_link-cmdb"><td>
outbound\_relations.target.link
</td><td id="entry-result-outbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the outbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_value-cmdb"><td>
outbound\_relations.target.value
</td><td id="entry-result-outbound_relations_target_value-cmdb">
Sys\_id of the outbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type-cmdb"><td>
outbound\_relations.type
</td><td id="entry-result-outbound_relations_type-cmdb">
Information about the type of outbound relationship. Data type: Object
</td></tr><tr id="row-result-outbound_relations_type_display_value-cmdb"><td>
outbound\_relations.type.display\_value
</td><td id="entry-result-outbound_relations_type_display_value-cmdb">
Name of the outbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_link-cmdb"><td>
outbound\_relations.type.link
</td><td id="entry-result-outbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the outbound relation from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_value-cmdb"><td>
outbound\_relations.type.value
</td><td id="entry-result-outbound_relations_type_value-cmdb">
Sys\_id of the type of outbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-status-cmdb"><td>
status
</td><td id="entry-result-status-cmdb">
Only appears if an error is encountered. Status of the endpoint processing.Possible value: failure
Data type: String
</td></tr></tbody>
</table>
### cURL Request
The following code example shows how to call this endpoint.
### 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.
### 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.
{ "error": { "detail": "Exception while executing request: null Check logs for error trace or enable glide.rest.debug property to verify REST request processing", "message": "Exception while executing request: null" }, "status": "failure" }
## 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.
**Note:** This endpoint does not conform to the HTML specifications. Standard PUT endpoints are destructive in that they remove any elements that are not included in the request. This endpoint does not remove non-specified elements.
### URL format
Versioned URL: `/api/now/{api_version}/cmdb/instance/{className}/{sys_id}`
Default URL: `/api/now/cmdb/instance/{className}/{sys_id}`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
className
</td><td id="entry-className-cmdb">
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
</td></tr><tr><td>
sys\_id
</td><td id="entry-sys_id-cmdb">
Sys\_id of the CI record to update.Data type: String
</td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None||
<table class="rest_api_request_body"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="entry-attributes-cmdb">
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 <a href="../../../servicenow-platform/configuration-management-database-cmdb/attesting-cis/">CIs attestation</a>.
Data type: Object
</td></tr><tr><td>
source
</td><td id="entry-source-cmdb">
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
</td></tr></tbody>
</table>
### 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](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="accept-entry-RESTAPI">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr><tr><td>
Content-Type
</td><td id="content_type-entry-RESTAPI">Data format of the request body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr></tbody>
</table>
|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](../rest-api-explorer/c_RESTAPI.md).
|Status code|Description|
|-----------|-----------|
|200|Successful. The request was successfully processed.|
|400|Bad Request. A bad request type or malformed request was detected.|
|401|Unauthorized. The user credentials are incorrect or have not been passed.|
|404|Not found. The requested item wasn't found.|
|405|Invalid method. The functionality is disabled.|
|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|
### Response body parameters \(JSON or XML\)
<table id="table_ens_hq4_3mb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td>
Data attributes currently 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.Data type: Object
</td></tr><tr id="row-result-error-cmdb"><td>
error
</td><td id="entry-result-error-cmdb">
Information on any errors encountered while processing the endpoint request. Data type: Object
</td></tr><tr id="row-result-error_detail-cmdb"><td>
error.detail
</td><td id="entry-result-error_detail-cmdb">
Additional information about the error.Data type: String
</td></tr><tr id="row-result-error_message-cmdb"><td>
error.message
</td><td id="entry-result-error_message-cmdb">
Message that identifies the error.Data type: String
</td></tr><tr id="row-result-inbound_relations-cmdb"><td>
inbound\_relations
</td><td id="entry-result-inbound_relations-cmdb">
List of objects that define the inbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-inbound_relations_sys_id-cmdb"><td>
inbound\_relations.sys\_id
</td><td id="entry-result-inbound_relations_sys_id-cmdb">
Sys\_id of the inbound CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target-cmdb"><td>
inbound\_relations.target
</td><td id="entry-result-inbound_relations_target-cmdb">
Information that describes the target inbound relation.Data type: Object
</td></tr><tr id="row-result-inbound_relations_target_display_value-cmdb"><td>
inbound\_relations.target.display\_value
</td><td id="entry-result-inbound_relations_target_display_value-cmdb">
Name of the inbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_link-cmdb"><td>
inbound\_relations.target.link
</td><td id="entry-result-inbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the inbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_value-cmdb"><td>
inbound\_relations.target.value
</td><td id="entry-result-inbound_relations_target_value-cmdb">
Sys\_id of the inbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type-cmdb"><td>
inbound\_relations.type
</td><td id="entry-result-inbound_relations_type-cmdb">
Information about the type of inbound relationship. Data type: Object
</td></tr><tr id="row-result-inbound_relations_type_display_value-cmdb"><td>
inbound\_relations.type.display\_value
</td><td id="entry-result-inbound_relations_type_display_value-cmdb">
Name of the inbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_link-cmdb"><td>
inbound\_relations.type.link
</td><td id="entry-result-inbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the inbound relation type from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_value-cmdb"><td>
inbound\_relations.type.value
</td><td id="entry-result-inbound_relations_type_value-cmdb">
Sys\_id of the type of inbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations-cmdb"><td>
outbound\_relations
</td><td id="entry-result-outbound_relations-cmdb">
List of objects that define the outbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-outbound_relations_sys_id-cmdb"><td>
outbound\_relations.sys\_id
</td><td id="entry-result-outbound_relations_sys_id-cmdb">
Sys\_id of the outbount CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target-cmdb"><td>
outbound\_relations.target
</td><td id="entry-result-outbound_relations_target-cmdb">
Required. Information about the target outbound relation.Data type: Object
</td></tr><tr id="row-result-outbound_relations_target_display_value-cmdb"><td>
outbound\_relations.target.display\_value
</td><td id="entry-result-outbound_relations_target_display_value-cmdb">
Name of the outbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_link-cmdb"><td>
outbound\_relations.target.link
</td><td id="entry-result-outbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the outbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_value-cmdb"><td>
outbound\_relations.target.value
</td><td id="entry-result-outbound_relations_target_value-cmdb">
Sys\_id of the outbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type-cmdb"><td>
outbound\_relations.type
</td><td id="entry-result-outbound_relations_type-cmdb">
Information about the type of outbound relationship. Data type: Object
</td></tr><tr id="row-result-outbound_relations_type_display_value-cmdb"><td>
outbound\_relations.type.display\_value
</td><td id="entry-result-outbound_relations_type_display_value-cmdb">
Name of the outbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_link-cmdb"><td>
outbound\_relations.type.link
</td><td id="entry-result-outbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the outbound relation from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_value-cmdb"><td>
outbound\_relations.type.value
</td><td id="entry-result-outbound_relations_type_value-cmdb">
Sys\_id of the type of outbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-status-cmdb"><td>
status
</td><td id="entry-result-status-cmdb">
Only appears if an error is encountered. Status of the endpoint processing.Possible value: failure
Data type: String
</td></tr></tbody>
</table>
### 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`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
className
</td><td id="entry-className-cmdb">
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
</td></tr><tr><td>
sys\_id
</td><td id="entry-sys_id-cmdb">
Sys\_id of the CI record to update.Data type: String
</td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None||
<table class="rest_api_request_body"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
inbound\_relations
</td><td id="entry-inbound_relations-cmdb">
List of objects that define the inbound relations to associate with the CI.Data type: Array
</td></tr><tr><td>
inbound\_relations.target
</td><td id="entry-inbound_relations_target-cmdb">Required if <strong>inbound_relations</strong> is specified. Sys_id of the target inbound relation to associate with the specified CI. Located in the Configuration Item [cmdb_ci] table. Data type: String</td></tr><tr><td>
inbound\_relations.type
</td><td id="entry-inbound_relations_type-cmdb">Required if <strong>inbound_relations</strong> is specified. Sys_id of the type of inbound relationship. Located in the CI Relationship Type [cmdb_rel_type] table.Data type: String</td></tr><tr><td>
outbound\_relations
</td><td id="entry-outbound_relations-cmdb">
List of objects that define the outbound relations to associate with the CI.Data type: Array
</td></tr><tr><td>
outbound\_relations.target
</td><td id="entry-request-outbound_relations_target-cmdb">Required if <strong>outbound_relations</strong> is specified. Sys_id of the target outbound relation. Located in the Configuration Item [cmdb_ci] table.Data type: String</td></tr><tr><td>
outbound\_relations.type
</td><td id="entry-request-outbound_relations_type-cmdb">Required if <strong>outbound_relations</strong> is specified. Sys_id of the type of outbound relationship. Located in the CI Relationship Type [cmdb_rel_type] table.Data type: String</td></tr><tr><td>
source
</td><td id="entry-source-cmdb">
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
</td></tr></tbody>
</table>
### 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](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="accept-entry-RESTAPI">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr><tr><td>
Content-Type
</td><td id="content_type-entry-RESTAPI">Data format of the request body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr></tbody>
</table>
|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](../rest-api-explorer/c_RESTAPI.md).
|Status code|Description|
|-----------|-----------|
|200|Successful. The request was successfully processed.|
|400|Bad Request. A bad request type or malformed request was detected.|
|401|Unauthorized. The user credentials are incorrect or have not been passed.|
|404|Not found. The requested item wasn't found.|
|405|Invalid method. The functionality is disabled.|
|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|
### Response body parameters \(JSON or XML\)
<table id="table_hj2_qn4_3mb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td>
Data attributes currently 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.Data type: Object
</td></tr><tr id="row-result-error-cmdb"><td>
error
</td><td id="entry-result-error-cmdb">
Information on any errors encountered while processing the endpoint request. Data type: Object
</td></tr><tr id="row-result-error_detail-cmdb"><td>
error.detail
</td><td id="entry-result-error_detail-cmdb">
Additional information about the error.Data type: String
</td></tr><tr id="row-result-error_message-cmdb"><td>
error.message
</td><td id="entry-result-error_message-cmdb">
Message that identifies the error.Data type: String
</td></tr><tr id="row-result-inbound_relations-cmdb"><td>
inbound\_relations
</td><td id="entry-result-inbound_relations-cmdb">
List of objects that define the inbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-inbound_relations_sys_id-cmdb"><td>
inbound\_relations.sys\_id
</td><td id="entry-result-inbound_relations_sys_id-cmdb">
Sys\_id of the inbound CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target-cmdb"><td>
inbound\_relations.target
</td><td id="entry-result-inbound_relations_target-cmdb">
Information that describes the target inbound relation.Data type: Object
</td></tr><tr id="row-result-inbound_relations_target_display_value-cmdb"><td>
inbound\_relations.target.display\_value
</td><td id="entry-result-inbound_relations_target_display_value-cmdb">
Name of the inbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_link-cmdb"><td>
inbound\_relations.target.link
</td><td id="entry-result-inbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the inbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_value-cmdb"><td>
inbound\_relations.target.value
</td><td id="entry-result-inbound_relations_target_value-cmdb">
Sys\_id of the inbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type-cmdb"><td>
inbound\_relations.type
</td><td id="entry-result-inbound_relations_type-cmdb">
Information about the type of inbound relationship. Data type: Object
</td></tr><tr id="row-result-inbound_relations_type_display_value-cmdb"><td>
inbound\_relations.type.display\_value
</td><td id="entry-result-inbound_relations_type_display_value-cmdb">
Name of the inbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_link-cmdb"><td>
inbound\_relations.type.link
</td><td id="entry-result-inbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the inbound relation type from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_value-cmdb"><td>
inbound\_relations.type.value
</td><td id="entry-result-inbound_relations_type_value-cmdb">
Sys\_id of the type of inbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations-cmdb"><td>
outbound\_relations
</td><td id="entry-result-outbound_relations-cmdb">
List of objects that define the outbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-outbound_relations_sys_id-cmdb"><td>
outbound\_relations.sys\_id
</td><td id="entry-result-outbound_relations_sys_id-cmdb">
Sys\_id of the outbount CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target-cmdb"><td>
outbound\_relations.target
</td><td id="entry-result-outbound_relations_target-cmdb">
Required. Information about the target outbound relation.Data type: Object
</td></tr><tr id="row-result-outbound_relations_target_display_value-cmdb"><td>
outbound\_relations.target.display\_value
</td><td id="entry-result-outbound_relations_target_display_value-cmdb">
Name of the outbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_link-cmdb"><td>
outbound\_relations.target.link
</td><td id="entry-result-outbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the outbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_value-cmdb"><td>
outbound\_relations.target.value
</td><td id="entry-result-outbound_relations_target_value-cmdb">
Sys\_id of the outbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type-cmdb"><td>
outbound\_relations.type
</td><td id="entry-result-outbound_relations_type-cmdb">
Information about the type of outbound relationship. Data type: Object
</td></tr><tr id="row-result-outbound_relations_type_display_value-cmdb"><td>
outbound\_relations.type.display\_value
</td><td id="entry-result-outbound_relations_type_display_value-cmdb">
Name of the outbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_link-cmdb"><td>
outbound\_relations.type.link
</td><td id="entry-result-outbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the outbound relation from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_value-cmdb"><td>
outbound\_relations.type.value
</td><td id="entry-result-outbound_relations_type_value-cmdb">
Sys\_id of the type of outbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-status-cmdb"><td>
status
</td><td id="entry-result-status-cmdb">
Only appears if an error is encountered. Status of the endpoint processing.Possible value: failure
Data type: String
</td></tr></tbody>
</table>
### 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}`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
className
</td><td id="entry-className-cmdb">
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
</td></tr><tr><td>
sys\_id
</td><td id="entry-sys_id-cmdb">
Sys\_id of the CI record to update.Data type: String
</td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None||
<table class="rest_api_request_body"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="entry-attributes-cmdb">
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 <a href="../../../servicenow-platform/configuration-management-database-cmdb/attesting-cis/">CIs attestation</a>.
Data type: Object
</td></tr><tr><td>
source
</td><td id="entry-source-cmdb">
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
</td></tr></tbody>
</table>
### 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](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="accept-entry-RESTAPI">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr><tr><td>
Content-Type
</td><td id="content_type-entry-RESTAPI">Data format of the request body. Supported types: <strong>application/json</strong> or <strong>application/xml</strong>. Default: <strong>application/json</strong></td></tr></tbody>
</table>
|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](../rest-api-explorer/c_RESTAPI.md).
|Status code|Description|
|-----------|-----------|
|200|Successful. The request was successfully processed.|
|400|Bad Request. A bad request type or malformed request was detected.|
|401|Unauthorized. The user credentials are incorrect or have not been passed.|
|404|Not found. The requested item wasn't found.|
|405|Invalid method. The functionality is disabled.|
|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|
### Response body parameters \(JSON or XML\)
<table id="table_ojn_3n4_3mb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td>
Data attributes currently 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.Data type: Object
</td></tr><tr id="row-result-error-cmdb"><td>
error
</td><td id="entry-result-error-cmdb">
Information on any errors encountered while processing the endpoint request. Data type: Object
</td></tr><tr id="row-result-error_detail-cmdb"><td>
error.detail
</td><td id="entry-result-error_detail-cmdb">
Additional information about the error.Data type: String
</td></tr><tr id="row-result-error_message-cmdb"><td>
error.message
</td><td id="entry-result-error_message-cmdb">
Message that identifies the error.Data type: String
</td></tr><tr id="row-result-inbound_relations-cmdb"><td>
inbound\_relations
</td><td id="entry-result-inbound_relations-cmdb">
List of objects that define the inbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-inbound_relations_sys_id-cmdb"><td>
inbound\_relations.sys\_id
</td><td id="entry-result-inbound_relations_sys_id-cmdb">
Sys\_id of the inbound CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target-cmdb"><td>
inbound\_relations.target
</td><td id="entry-result-inbound_relations_target-cmdb">
Information that describes the target inbound relation.Data type: Object
</td></tr><tr id="row-result-inbound_relations_target_display_value-cmdb"><td>
inbound\_relations.target.display\_value
</td><td id="entry-result-inbound_relations_target_display_value-cmdb">
Name of the inbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_link-cmdb"><td>
inbound\_relations.target.link
</td><td id="entry-result-inbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the inbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_target_value-cmdb"><td>
inbound\_relations.target.value
</td><td id="entry-result-inbound_relations_target_value-cmdb">
Sys\_id of the inbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type-cmdb"><td>
inbound\_relations.type
</td><td id="entry-result-inbound_relations_type-cmdb">
Information about the type of inbound relationship. Data type: Object
</td></tr><tr id="row-result-inbound_relations_type_display_value-cmdb"><td>
inbound\_relations.type.display\_value
</td><td id="entry-result-inbound_relations_type_display_value-cmdb">
Name of the inbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_link-cmdb"><td>
inbound\_relations.type.link
</td><td id="entry-result-inbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the inbound relation type from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-inbound_relations_type_value-cmdb"><td>
inbound\_relations.type.value
</td><td id="entry-result-inbound_relations_type_value-cmdb">
Sys\_id of the type of inbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations-cmdb"><td>
outbound\_relations
</td><td id="entry-result-outbound_relations-cmdb">
List of objects that define the outbound relations associated with the CI.Data type: Array
</td></tr><tr id="row-result-outbound_relations_sys_id-cmdb"><td>
outbound\_relations.sys\_id
</td><td id="entry-result-outbound_relations_sys_id-cmdb">
Sys\_id of the outbount CI relationship. Located in the CI Relationship \[cmdb\_rel\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target-cmdb"><td>
outbound\_relations.target
</td><td id="entry-result-outbound_relations_target-cmdb">
Required. Information about the target outbound relation.Data type: Object
</td></tr><tr id="row-result-outbound_relations_target_display_value-cmdb"><td>
outbound\_relations.target.display\_value
</td><td id="entry-result-outbound_relations_target_display_value-cmdb">
Name of the outbound relation to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_link-cmdb"><td>
outbound\_relations.target.link
</td><td id="entry-result-outbound_relations_target_link-cmdb">
CMDB REST endpoint URL to use to retrieve the outbound relation from the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_target_value-cmdb"><td>
outbound\_relations.target.value
</td><td id="entry-result-outbound_relations_target_value-cmdb">
Sys\_id of the outbound CI. Located in the Configuration Item \[cmdb\_ci\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type-cmdb"><td>
outbound\_relations.type
</td><td id="entry-result-outbound_relations_type-cmdb">
Information about the type of outbound relationship. Data type: Object
</td></tr><tr id="row-result-outbound_relations_type_display_value-cmdb"><td>
outbound\_relations.type.display\_value
</td><td id="entry-result-outbound_relations_type_display_value-cmdb">
Name of the outbound type to display in a user interface.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_link-cmdb"><td>
outbound\_relations.type.link
</td><td id="entry-result-outbound_relations_type_link-cmdb">
Table REST endpoint URL to use to retrieve the outbound relation from the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-result-outbound_relations_type_value-cmdb"><td>
outbound\_relations.type.value
</td><td id="entry-result-outbound_relations_type_value-cmdb">
Sys\_id of the type of outbound relationship. Located in the CI Relationship Type \[cmdb\_rel\_type\] table.Data type: String
</td></tr><tr id="row-status-cmdb"><td>
status
</td><td id="entry-result-status-cmdb">
Only appears if an error is encountered. Status of the endpoint processing.Possible value: failure
Data type: String
</td></tr></tbody>
</table>
### Sample cURL request