External Content Ingestion API
-
- UpdatedApr 22, 2025
- 14 minutes to read
- Yokohama
- API reference
The External Content Ingestion API provides endpoints that enable ingestion of content from sources outside of your ServiceNow® instance into the ServiceNow® AI Search application's index.
External Content Ingestion API – DELETE /ais/external_content/deleteByQuery/{schema_table_name}
Deletes all external documents that match the specified query from the AI Search index.
URL format
Versioned URL: /api/now/{api_version}/ais/external_content/deleteByQuery/{schema_table_name}?query={query}
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 |
schema_table_name | The name of the external content schema table that defines the schema for the indexed documents to delete. For example, u_ext_content. Data type: String |
Name | Description |
---|---|
query | A valid URL-escaped query for the schema table specified by schema_table_name. For example, title=Introduction to query for documents whose title is Introduction. 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. Only supports 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. |
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)
Example: cURL request
Delete documents with title field values Introduction and Report for 31 October 2020 from the u_ext_content schema table.
External Content Ingestion API – DELETE /ais/external_content/deleteDocument/{schema_table_name}/{document_id}
Deletes the external document with a specified unique identifier from the AI Search index.
URL format
Versioned URL: /api/now/{api_version}/ais/external_content/deleteDocument/{schema_table_name}/{document_id}
Supported request parameters
Parameter | 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 |
document_id | The unique identifier for the external document to delete. For example, ADMIN-2027858531-16. Data type: string |
schema_table_name | The name of the external content schema table that defines the schema for the indexed document to delete. For example, u_ext_content. 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. Only supports 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. |
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)
Example: cURL request
Delete the document with identifier ADMIN-2587918521-27 from the u_ext_content schema table.
External Content Ingestion API – POST /ais/external_content/ingestDocument/{schema_table_name}
Sends a list of external documents to the AI Search ingestion batcher for indexing. After indexing completes, content from the ingested documents becomes searchable.
You can use this endpoint to feed external documents with text content and metadata.
- Store the binary content in AI Search using the POST /ais/external_content/storeContent endpoint. Record the value of the result response body parameter.
- Send the external document to AI Search using this endpoint. Set the document's content_pointer request body parameter to match the recorded result response body parameter value.
URL format
Versioned URL: /api/now/{api_version}/ais/external_content/ingestDocument/{schema_table_name}
Supported request parameters
Parameter | 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 |
schema_table_name | The name of the external content schema table that defines the schema for external documents in the request. For example, u_ext_content. 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. Only supports application/json. |
Content-Type | Data format of the request body. Only supports 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)
Precedence order for principal permissions
Attribute value | Precedence order for principal permissions |
---|---|
true | From highest precedence to lowest:
Note: This is the default attribute value for external content indexed
sources. |
false | From highest precedence to lowest:
Note: For instructions on setting this attribute value, see Change the precedence of
user read and group deny permissions for an external content indexed
source. |
Example: cURL request
Feed two external documents (with content pointers to binary content objects previously stored using the POST /ais/external_content/storeContent endpoint) for indexing into the u_ext_content schema table.
External Content Ingestion API – POST ais/external_content/storeContent
Stores binary content as a content object in AI Search.
- Store the binary content using this endpoint. Record the value of the result response body parameter.
- Send the external document to AI Search using the POST /ais/external_content/ingestDocument/{schema_table_name} endpoint. Set the document's content_pointer request body parameter to match the recorded result response body parameter value.
URL format
Versioned URL: /api/now/{api_version}/ais/external_content/storeContent
Supported request parameters
Parameter | 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 |
Name | Description |
---|---|
None |
Element | Description |
---|---|
[binary data] | Required. Binary content to store as a content object in AI Search. |
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. Only supports application/json. |
Content-Type | Data format of the request body. Valid values:
|
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. |
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)
Example: cURL request
Store binary content for a PDF file as a content object.
The response body includes the unique identifier for the new content object.
On this page
- External Content Ingestion API – DELETE /ais/external_content/deleteByQuery/{schema_table_name}
- External Content Ingestion API – DELETE /ais/external_content/deleteDocument/{schema_table_name}/{document_id}
- External Content Ingestion API – POST /ais/external_content/ingestDocument/{schema_table_name}
- External Content Ingestion API – POST ais/external_content/storeContent