---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# CMDB Data Ingestion API

# CMDB Data Ingestion API {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read

The CMDB Data Ingestion API provides endpoints that enable the batch
ingestion of an array of objects into an Import Set table.  
Warning:  
This API is no longer recommended. For the same functionality with improved scalability and stability, use the [Import Set - POST /now/import/{stagingTableName}/insertMultiple](https://servicenow-prod.fluidtopics.net/8OjV6Ev9ECkRnDeW~GItkQ#import-POST-insertMultiple "Inserts multiple records into a specified staging table and triggers transformation based on predefined transform maps or Robust Transform Engine (RTE) configurations in a single request.") endpoint. From the Quebec release onward, any usage of the CMDB Data Ingestion API should be migrated to use the Import Set -- insertMultiple endpoint instead.

In addition, this API will not
work by default for zbooted instances.

This API is activated through the Configuration Management Database (CMDB) (com.snc.cmdb)
plugin and requires the cmdb_import_api_admin role.

## CMDB Data Ingestion - POST
/cmdb/ingest/{data_source_sys_id} {#ariaid-title2}

Inserts records into the Import Set table associated with the data source record
identified by the passed-in sys_id.
Warning:  
This API is no longer recommended. For the same functionality with improved scalability and stability, use the [Import Set - POST /now/import/{stagingTableName}/insertMultiple](https://servicenow-prod.fluidtopics.net/8OjV6Ev9ECkRnDeW~GItkQ#import-POST-insertMultiple "Inserts multiple records into a specified staging table and triggers transformation based on predefined transform maps or Robust Transform Engine (RTE) configurations in a single request.") endpoint. From the Quebec release onward, any usage of the CMDB Data Ingestion API should be migrated to use the Import Set -- insertMultiple endpoint instead.

In addition, this API will not
work by default for zbooted instances.

The request body must contain the JSON array of objects (payload) to insert in the Import
Set table. Each object equates to a row in the table, each name-value pair equates to a
column. The JSON payload must leverage the field names from the import set without the "u_"
prefix. For example, the field name "u_matching_record" should be "matching_record" in the
request body payload. If the Import Set table exists, the endpoint appends the rows
(objects) to the existing Import Set table. No checking for duplicates or updating of
existing records is performed.

If you are initially building an application, you must first create the associated data
source record in your instance before calling this endpoint. If you are just using this
endpoint to add records to an existing Import Set table, you do not need to create the data
source record, but you must know its sys_id. The data source record describes the Import Set
table in which to insert the specified payload. This table must extend the Import Set Rows
\[sys_import_set_row\] table. Also, the data source must be set to
<kbd class="ph userinput">Attachment</kbd> and the format set to <kbd class="ph userinput">JSON</kbd>. For
more information on data sources, see [Data sources](https://www.servicenow.com/docs/access?context=c_DataSources&version=xanadu&pubname=xanadu-integrate-applications&ft:locale=en-US).

If the Import Set table defined in the data source record does not exist, the endpoint
attaches the passed-in payload to the data source record. To create the initial Import Set
table, you must manually import the data into the Import Set table. To import the data, on
the associated Data Source form, click the Test Load 20 Records or
Load All Records link in the Related Links section. Once the Import
Set table is created, you cannot add columns to the table using this endpoint. If name-value
pairs are later passed in that do not exist in the Import Set table, they are ignored
without warning. If you need to modify the columns within the Import Set table, you can
manually add them to the table. You can also delete or rename the Import Set table, and call
the endpoint again using the new payload.

You must have the cmdb_import_api_admin role to access this endpoint.

### URL format {#cmdb-POST-ingest__section_dxb_tlr_cmb}

Versioned URL:
/api/now/{api_version}/cmdb/ingest/{data_source_sys_id}

Default URL:
/api/now/cmdb/ingest/{data_source_sys_id}

### Supported request parameters

{#cmdb-POST-ingest__entry__2}{#cmdb-POST-ingest__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| data_source_sys_id | Sys_id of the data source record. |
[Table 1. Path parameters]

{#cmdb-POST-ingest__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 2. Query parameters]

{#cmdb-POST-ingest__entry__12}

| Name | Description |
|-|-|
| Array | Free-form array of objects that describe the data to append to the associated Import Set table. Each object in the array defines a row in the Import Sets table; each name-value pair a column. Note: This array must be named, such as `"{\"records\":[{\"hostname\": \"Hostname1\", \"serialnumber\": \"2acd3873-7fc5-454c-8844-e7769e4d6cfc\", \"model\": \"Model Id"},{\"vendor\": \"ABC Co\"}]}"`. |
[Table 3. Request body parameters (XML or JSON)]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cmdb-POST-ingest__entry__16}{#cmdb-POST-ingest__accept-RESTAPI}{#cmdb-POST-ingest__content_type-RESTAPI}

| 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 |
[Table 4. Request headers]

{#cmdb-POST-ingest__entry__22}

| Header | Description |
|-|-|
| None |   |
[Table 5. Response headers]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cmdb-POST-ingest__entry__26}{#cmdb-POST-ingest__entry-400-status-code}{#cmdb-POST-ingest__entry-404-status-code}{#cmdb-POST-ingest__entry-500-status-code}

| Status code | Description |
|-|-|
| 201 | Created. An attachment was added to the data source. |
| 202 | Accepted. Rows were added to the Import Set table. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
| 409 | Conflict. Attachment already exists on the data source. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
| 501 | Not Implemented. Request format is not supported. |
[Table 6. Status codes]

### Response body parameters (JSON or XML)

{#cmdb-POST-ingest__entry__42}

| Name | Description |
|-|-|
| error | Describes an encountered error. Data type: Object "error": { "details": "String", "message": "String" } |
| error.details | Additional information about the error. Data type: String |
| error.message | Message describing the error. Data type: String |
| import_set | Name of the Import Set table to which the payload was appended. Data type: String |
| staged_row_count | Number of rows appended to the Import Set table. Data type: Number |
| staging_table | Name of the data source record used to stage the payload. Data type: String |
| status | Error status. Data type: String |
[ ]

### Sample cURL request

    curl "instance.service-now.com/api/now/cmdb/ingest/4dd9686d1b9800103d374087bc4bcb3d" \
    --request POST \
    --header "Accept: application/json" \
    --header "Content-Type:application/json" \
    --data "{\"records\":[{\"hostname\": \"Hostname1\", \"serialnumber\": \"2acd3873-7fc5-454c-8844-e7769e4d6cfc\", \"model\": \"Model 5100"},{\"vendor\": \"ABC Co\"},
    {\"hostname\": \"Hostname2\", \"serialnumber\": \"3adb3873-7fc5-564d-8844-e7769e4d6ded\", \"model\": \"Model 5200"},{\"vendor\": \"ACME Co\"}]}"
    --user "username":"password"

Successful response:

    {
      "result": {
        "staged_row_count": 2,
        "import_set": "ISET0010010",
        "staging_table": "sn_my_demo_integra_demo_data_source_01"
      }
    }


