Query Configuration Item

Query a configuration item by its unique identifier. This operation returns detailed information for a single configuration item.

Special Access Rules 

To query a configuration item, you must have the following user permissions:

  • IT Service Configuration Item Type Manager
  • IT Service Configuration Item Owner
  • IT Service Configuration Item Type Reader

Request 

JSON example 

1query CiById {
2  ciById(id: 345672) {
3    id
4
5    cnfgItemTypeDef {
6      component
7      developerName
8      name
9    }
10
11    discoveryInformation {
12      createdBySource
13      firstDiscoveredBy
14      firstDiscoveredOn
15      lastDiscoveredBy
16      lastDiscoveredOn
17
18      lastDiscoveredBySource {
19        date
20        source
21      }
22    }
23  }
24}

Properties 

NameTypeDescriptionRequired or OptionalAvailable Version
idIntegerThe unique identifier of the configuration item to retrieve.Required66.0

Response 

JSON example 

1{
2  "data": {
3    "ciById": {
4      "id": 6460947,
5      "ciTags": {
6        "totalElements": 1,
7        "ciTags": [
8          {
9            "type": "KEY_VALUE",
10            "key": "searchtags",
11            "keyId": 764952,
12            "valueId": 859952,
13            "value": "s1"
14          }
15        ]
16      },
17      "cnfgItemTypeDef": {
18        "component": false,
19        "developerName": "SD_AwEcIn",
20        "name": "AWS EC2 Instance"
21      },
22      "discoveryInformation": {
23        "createdBySource": "Aws",
24        "firstDiscoveredBy": "Aws",
25        "firstDiscoveredOn": 1765929600000,
26        "lastDiscoveredBy": "Aws",
27        "lastDiscoveredOn": 1765929600000,
28        "lastDiscoveredBySource": [
29          {
30            "date": 1765929600000,
31            "source": "Aws"
32          }
33        ]
34      }
35    }
36  }
37}

Properties 

NameTypeDescriptionAvailable Version
idIntegerThe unique integer identifier of the configuration item.66.0
nameStringThe descriptive name of the Configuration Item.66.0
createdOnStringThe date and time the record was created.66.0
cnfgItemTypeDefCnfgItemTypeDefThe configuration item type definition.66.0
ciTagsCiTagsThe tags associated with the configuration item.67.0
discoveryInformationDiscoveryInformationInformation about sources that have discovered this configuration item and when.66.0
lastModifiedOnStringThe date and time the record was last updated.66.0
Attribute (by developer name)StringAny configuration item attribute you request in the query is returned with its developer name as the key (for example, SD_OpSy—Operating system). The response includes only the attributes you request.66.0

CnfgItemTypeDef 

Configuration item type definition returned when requested in the query.

Properties 

NameTypeDescriptionAvailable Version
componentBooleanIndicates whether the configuration item type is a component type.66.0
developerNameStringThe developer name of the configuration item type. To retrieve the list of available CI type developer names programmatically, query the CnfgItemTypeDef object.66.0
nameStringThe display name of the configuration item type.66.0

CiTags 

Configuration item type tags returned when requested in the query.

Properties 

NameTypeDescriptionAvailable Version
keyBigIntegerThe tag key or name.67.0
keyIdBigIntegerThe unique identifier of the tag key.67.0
typeStringThe tag type: KEY_VALUE (key-value pair) or KEY_ONLY (key only).67.0
valueStringThe tag value. This field is null for KEY_ONLY tags.67.0
valueIdStringThe unique identifier of the tag value. This field is null for KEY_ONLY tags.67.0

DiscoveryInformation 

Contains information about sources that have discovered this configuration item, along with the date and time of discovery.

Properties 

NameTypeDescriptionAvailable Version
createdBySourceStringThe source that created the configuration item.66.0
firstDiscoveredByStringThe source that first discovered the configuration item.66.0
firstDiscoveredOnIntegerThe date and time when the configuration item was first discovered (milliseconds since epoch).66.0
lastDiscoveredByStringThe source that last discovered the configuration item.66.0
lastDiscoveredOnIntegerThe date and time when the configuration item was last discovered (milliseconds since epoch).66.0
lastDiscoveredBySourceArray of LastDiscoveredBySourceList of discovery events with date and source.66.0

LastDiscoveredBySource 

Each element in the lastDiscoveredBySource array contains the following fields.

Properties 

NameTypeDescriptionAvailable Version
dateIntegerThe date and time when the configuration item was last discovered by this source (milliseconds since epoch).66.0
sourceStringThe source that performed the discovery.66.0

When using the ciById operation, you can request any available attribute to be included in the response. The attributes you can include:

  • Standard Attributes: Many attributes are available out-of-the-box.
  • Custom Attributes: You can create and include custom attributes using the sObject API.

Add any attribute using its Developer Name (for example, SD_AsNa—Asset Name) to specify exactly which information you want to receive for your Configuration Items (CIs).