{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":514,"path":"api-reference/rest-apis/external-content-ingestion-api.md","title":"External Content Ingestion API","bundle":null,"doc_type":null,"release":"australia","body":"\n# External Content Ingestion API\n\nThe 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.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## External Content Ingestion API – DELETE /ais/external\\_content/deleteByQuery/\\{schema\\_table\\_name\\}\n\nDeletes all external documents that match the specified query from the AI Search index.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/ais/external_content/deleteByQuery/{schema_table_name}?query={query}`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr><tr><td>\n\nschema\\_table\\_name\n\n</td><td>\n\nThe name of the external content schema table that defines the schema for the indexed documents to delete. For example, `u_ext_content`.\n\n Data type: String\n\n</td></tr></tbody>\n</table><table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nquery\n\n</td><td>\n\nA 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`.\n\n Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nObject describing the error encountered during processing of the request.\n\n Data type: Object\n\n ```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nDetails of the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nMessage for the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult\n\n</td><td>\n\nResult from a successfully processed request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of an unsuccessful request.\n\n Valid values:\n\n-   **failure**\n\n Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nDelete documents with title field values `Introduction` and `Report for 31 October 2020` from the u\\_ext\\_content schema table.\n\n```\ncurl \"https://instance.service-now.com/api/now/v2/ais/external_content/deleteByQuery/u_ext_content?query=title%3DIntroduction%20OR%20title%3DReport%20for%2031%20October%202020\" \\\n--request DELETE \\\n--user \"username\":\"password\" \\\n--header \"Accept: application/json\"\n```\n\n```\n{\n  \"result\": \"Delete By Query Successfully Executed\"\n}\n```\n\n## External Content Ingestion API – DELETE /ais/external\\_content/deleteDocument/\\{schema\\_table\\_name\\}/\\{document\\_id\\}\n\nDeletes the external document with a specified unique identifier from the AI Search index.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/ais/external_content/deleteDocument/{schema_table_name}/{document_id}`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr><tr><td>\n\ndocument\\_id\n\n</td><td>\n\nThe unique identifier for the external document to delete. For example, `ADMIN-2027858531-16`.\n\n Data type: string\n\n</td></tr><tr><td>\n\nschema\\_table\\_name\n\n</td><td>\n\nThe name of the external content schema table that defines the schema for the indexed document to delete. For example, `u_ext_content`.\n\n Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nObject describing the error encountered during processing of the request.\n\n Data type: Object\n\n ```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nDetails of the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nMessage for the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult\n\n</td><td>\n\nResult from a successfully processed request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of an unsuccessful request.\n\n Valid values:\n\n-   **failure**\n\n Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nDelete the document with identifier `ADMIN-2587918521-27` from the u\\_ext\\_content schema table.\n\n```\ncurl 'https://instance.service-now.com/api/now/v2/ais/external_content/deleteDocument/u_ext_content/ADMIN-2587918521-27' \\\n--request DELETE \\\n--user 'username':'password' \\\n--header 'Accept: application/json'\n```\n\n```\n{\n  \"result\":\"Document removed\"\n}\n```\n\n## External Content Ingestion API – POST /ais/external\\_content/ingestDocument/\\{schema\\_table\\_name\\}\n\nSends a list of external documents to the AI Search ingestion batcher for indexing. After indexing completes, content from the ingested documents becomes searchable.\n\nYou can use this endpoint to feed external documents with text content and metadata.\n\nIf you need to associate searchable binary content and metadata with an external document, follow these steps:\n\n1.  Store the binary content in AI Search using the [POST /ais/external\\_content/storeContent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/external-content-ingestion-api.md) endpoint. Record the value of the **result** response body parameter.\n2.  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.\n\nDuring ingestion, AI Search parses the binary content and adds its searchable content to the indexed record that represents the external document. Parsing removes the stored content object.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/ais/external_content/ingestDocument/{schema_table_name}`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr><tr><td>\n\nschema\\_table\\_name\n\n</td><td>\n\nThe name of the external content schema table that defines the schema for external documents in the request. For example, `u_ext_content`.\n\n Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n\\[array\\]\n\n</td><td>\n\nRequired. Unnamed array of objects in which each object represents an external document to ingest for indexing.\n\n Data type: Array\n\n ```\n[\n  {\n    \"content_pointer\": \"String\",\n    \"document_id\": \"String\",\n    \"principals\": {Object},\n    \"properties\": {Object}\n  }\n]\n```\n\n</td></tr><tr><td>\n\n\\[array\\].content\\_pointer\n\n</td><td>\n\nIdentifier for an instance of binary content stored using the [POST /ais/external\\_content/storeContent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/external-content-ingestion-api.md) endpoint. During ingestion, AI Search parses the binary content and adds its searchable content to the indexed record that represents the external document. Parsing removes the stored content object.\n\n**Note:** This identifier should match the **result** response body element returned by the storeContent endpoint.\n\n Data type: String\n\n</td></tr><tr><td>\n\n\\[array\\].document\\_id\n\n</td><td>\n\nRequired. Unique identifier for the external document in the external content schema table specified by the **schema\\_table\\_name** path parameter.\n\n **Note:** When you ingest a document, it overwrites any existing document in the same external content schema table that has the same **document\\_id**. If two or more documents in the same ingestion request have the same **document\\_id**, the request fails.\n\n Data type: String\n\n</td></tr><tr><td>\n\n\\[array\\].principals\n\n</td><td>\n\nObject containing key-value pairs that describe the external document's access permissions for externally defined security principals \\(users and groups\\).\n\n**Note:**\n\nIf you omit this parameter for a document, the request succeeds, but AI Search rejects the document with the ingestion feedback message `The principal of the document is missing`.\n\nIf this parameter object does not include any key-value pairs that grant access to a document, the request succeeds, but AI Search rejects the document with the ingestion feedback message `The principal of the document is invalid`.\n\n Data type: Object\n\n ```\n\"principals\": {\n  \"everyone\": Boolean,\n  \"groups.deny\": [Array],\n  \"groups.read\": [Array],\n  \"none\": Boolean,\n  \"users.deny\": [Array],\n  \"users.read\": [Array]\n}\n```\n\n Versions supported: Available starting in v2 of the API.\n\n</td></tr><tr><td>\n\n\\[array\\].principals.everyone\n\n</td><td>\n\nFlag that indicates whether access to the external document is allowed for all users. When this parameter is set to **true**, all ServiceNow AI Platform users can view the indexed record created from the document.\n\n**Note:** If you set both this parameter and **\\[array\\].principals.none** to **true** for a document, the request succeeds, but AI Search rejects the document with ingestion feedback message `The principal of the document is invalid`. You can only set one of these two parameters to **true** in a request.\n\n Valid values:\n\n-   **true**: Allow access to the document for all users. AI Search ignores all **\\[array\\].principals.groups.\\*** and **\\[array\\].principals.users.\\*** parameter settings for the document.\n-   **false**: Do not allow all users to access the external document. Users can only access the document if **\\[array\\].principals.none** is set to false and if allowed by the interaction of their user mappings and the **\\[array\\].principals.groups.\\*** and **\\[array\\].principals.users.\\*** parameters.\n\n Data type: Boolean\n\n Default: **true**\n\n Versions supported: Available starting in v2 of the API.\n\n</td></tr><tr><td>\n\n\\[array\\].principals.groups.deny\n\n</td><td>\n\nArray of strings where each string is the name of an externally defined group that is denied access to the external document. ServiceNow AI Platform users mapped to any of these external groups cannot view the indexed search result record created from the document.\n\n If either **\\[array\\].principals.everyone** or **\\[array\\].principals.none** is set to **true**, this parameter has no effect.\n\n This parameter takes precedence over **\\[array\\].principals.groups.read**. If the same user is mapped to external groups with both read and deny access permissions for a document, AI Search denies that user access to the indexed record.\n\n By default, **\\[array\\].principals.users.read** takes precedence over this parameter. To reverse this precedence order for an indexed source, see [Change the precedence of user read and group deny permissions for an external content indexed source.](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/defining-access-perms-ext-docs-ais.md).\n\n Data type: Array\n\n Values can be in any format, depending on the names of the externally defined groups specified. Examples include:\n\n ```\n\"groups.deny\": [\n  \"hr-admin\",\n  \"legal\"\n]\n```\n\n Versions supported: Available starting in v2 of the API.\n\n</td></tr><tr><td>\n\n\\[array\\].principals.groups.read\n\n</td><td>\n\nArray of strings where each string is the name of an externally defined group that is allowed to access the external document. ServiceNow AI Platform users mapped to any of these external groups can view the indexed search result record created from the document.\n\n If either **\\[array\\].principals.everyone** or **\\[array\\].principals.none** is set to **true**, this parameter has no effect.\n\n **\\[array\\].principals.groups.deny** takes precedence over this parameter. If the same user is mapped to external groups with both read and deny access permissions for a document, AI Search denies that user access to the indexed record.\n\n Data type: Array\n\n Values can be in any format, depending on the names of the externally defined groups specified. Examples include:\n\n ```\n\"groups.read\": [\n  \"devops\",\n  \"it\",\n  \"report-admins\"\n]\n```\n\n Versions supported: Available starting in v2 of the API.\n\n</td></tr><tr><td>\n\n\\[array\\].principals.none\n\n</td><td>\n\nBoolean option indicating whether access to the external document is denied for all users. When this parameter is set to **true**, only ServiceNow AI Platform users with the ais\\_high\\_security\\_admin elevated privilege role can view the indexed record created from the document.\n\n**Note:** If you set both this parameter and **\\[array\\].principals.everyone** to **true** for a document, AI Search rejects the document during ingestion with error message `The principal of the document is invalid`. You can only set one of these two parameters to **true** in a request.\n\n Valid values:\n\n-   **true**: Deny access to the document for all users except those with the ais\\_high\\_security\\_admin elevated privilege role. AI Search ignores all **\\[array\\].principals.groups.\\*** and **\\[array\\].principals.users.\\*** parameter settings for the document.\n-   **false**: Do not deny access to the document for all users. Users can access the document if **\\[array\\].principals.everyone** is set to **true**, or if allowed by the interaction of their user mappings and the **\\[array\\].principals.groups.read** and **\\[array\\].principals.users.read** parameters.\n\n Data type: Boolean\n\n Default: **false**\n\n Versions supported: Available starting in v2 of the API.\n\n</td></tr><tr><td>\n\n\\[array\\].principals.users.deny\n\n</td><td>\n\nArray of strings where each string is the name of an externally defined user that is denied access to the external document. ServiceNow AI Platform users mapped to any of these external users cannot view the indexed search result record created from the document.\n\n If either **\\[array\\].principals.everyone** or **\\[array\\].principals.none** is set to **true**, this parameter has no effect.\n\n This parameter takes precedence over **\\[array\\].principals.users.read**. If the same user is mapped to external users with both read and deny access permissions for a document, AI Search denies that user access to the indexed record.\n\n Data type: Array\n\n Values can be in any format, depending on the names of the externally defined users specified. Examples include:\n\n ```\n\"users.deny\": [\n  \"ad\\bow-ruggeri\",\n  \"abel-tuter@sharepoint\"\n]\n```\n\n Versions supported: Available starting in v2 of the API.\n\n</td></tr><tr><td>\n\n\\[array\\].principals.users.read\n\n</td><td>\n\nArray of strings where each string is the name of an externally defined user that is allowed to access the external document. ServiceNow AI Platform users mapped to any of these external users can view the indexed search result record created from the document.\n\n If either **\\[array\\].principals.everyone** or **\\[array\\].principals.none** is set to **true**, this parameter has no effect.\n\n **\\[array\\].principals.users.deny** takes precedence over this parameter. If the same user is mapped to external users with both read and deny access permissions for a document, AI Search denies that user access to the indexed record.\n\n By default, this parameter takes precedence over **\\[array\\].principals.groups.deny**. To reverse this precedence order for an indexed source, see [Change the precedence of user read and group deny permissions for an external content indexed source.](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/defining-access-perms-ext-docs-ais.md).\n\n Data type: Array\n\n Values can be in any format, depending on the names of the externally defined users specified. Examples include:\n\n ```\n\"users.read\": [\n  \"ad\\abel-tuter\",\n  \"beth-anglin@sharepoint\"\n]\n```\n\n Versions supported: Available starting in v2 of the API.\n\n</td></tr><tr><td>\n\n\\[array\\].properties\n\n</td><td>\n\nObject containing name-value pairs where each pair represents a field name and value to ingest for the document. All field names and values must be specified as strings.\n\n After ingestion, these document field values are accessible through the indexed source defined for the external content schema table specified by the **schema\\_table\\_name** path parameter. Users can search for these field values in search sources derived from this indexed source.\n\n Data type: Object\n\n Field names can only contain lowercase letters and underscores. Values can include any characters. Value length is limited by the **max\\_length** attribute defined for the field in the external content schema table. Examples of field name-value pairs include:\n\n ```\n\"properties\": {\n  \"creation_date\": \"2020-11-03 12:27:43\",\n  \"file_size\": \"10285\",\n  \"title\": \"Introduction\",\n  \"url\": \"file:///myhost/reports/Introduction.pdf\"\n}\n```\n\n</td></tr></tbody>\n</table>### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|202|Partial Success. The request was processed. Some documents have ingestion feedback warning or error messages.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nObject describing the error encountered during processing of the request.\n\n Data type: Object\n\n ```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nDetails of the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nMessage for the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult\n\n</td><td>\n\nJSON-formatted string representing the result object for the ingestion request.\n\n Data type: String\n\n ```\n\"result\": \"{\\\"duration_in_ms\\\": Number, \\\"feedback\\\": [Array] }\"\n```\n\n</td></tr><tr><td>\n\nresult.duration\\_in\\_ms\n\n</td><td>\n\nTime spent ingesting the external documents.\n\n Data type: Number\n\n Unit: Milliseconds\n\n</td></tr><tr><td>\n\nresult.feedback\n\n</td><td>\n\nArray of objects in which each object represents feedback for a document ingested from the request body.\n\n Data type: Array\n\n ```\n\"feedback\": [\n  {\n    \"document_id\": \"String\",\n    \"messages\": [Array]\n  }\n]\n```\n\n</td></tr><tr><td>\n\nresult.feedback.document\\_id\n\n</td><td>\n\nUnique identifier for the external document as specified in the request body.\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult.feedback.messages\n\n</td><td>\n\nArray of unnamed objects in which each object represents an ingestion feedback message logged during indexing of the external document.\n\n Data type: Array\n\n ```\n\"messages\": [\n  {\n    \"code\": \"String\",\n    \"component\": \"String\",\n    \"level\": \"String\",\n    \"message\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nresult.feedback.messages.code\n\n</td><td>\n\nCode for an exception thrown by the indexing workflow component that logged the ingestion feedback message.\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult.feedback.messages.component\n\n</td><td>\n\nIdentifier for the indexing workflow component that logged the ingestion feedback message.\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult.feedback.messages.level\n\n</td><td>\n\nLogging level for the ingestion feedback message.\n\n Valid values:\n\n-   **ERROR**\n-   **INFO**\n-   **MINOR\\_ERROR**\n-   **WARN**\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult.feedback.messages.message\n\n</td><td>\n\nText logged for the ingestion feedback message.\n\n Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of an unsuccessful request.\n\n Valid values:\n\n-   **failure**\n\n Data type: String\n\n</td></tr></tbody>\n</table>### Precedence order for principal permissions\n\nThe precedence order for **\\[array\\].principals** permissions depends on the value of the **user\\_read\\_takes\\_precedence\\_over\\_group\\_deny** attribute for the indexed source used to ingest an external document.\n\n<table id=\"table_vlm_d2t_vpb\"><thead><tr><th>\n\nAttribute value\n\n</th><th>\n\nPrecedence order for principal permissions\n\n</th></tr></thead><tbody><tr><td>\n\ntrue\n\n</td><td>\n\nFrom highest precedence to lowest:\n\n1.  **\\[array\\].principals.everyone**, **\\[array\\].principals.none**\n2.  **\\[array\\].principals.users.deny**\n3.  **\\[array\\].principals.users.read**\n4.  **\\[array\\].principals.groups.deny**\n5.  **\\[array\\].principals.groups.read**\n\n**Note:** This is the default attribute value for external content indexed sources.\n\n</td></tr><tr><td>\n\nfalse\n\n</td><td>\n\nFrom highest precedence to lowest:\n\n1.  **\\[array\\].principals.everyone**, **\\[array\\].principals.none**\n2.  **\\[array\\].principals.users.deny**, **\\[array\\].principals.groups.deny**\n3.  **\\[array\\].principals.users.read**, **\\[array\\].principals.groups.read**\n\n**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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/defining-access-perms-ext-docs-ais.md).\n\n</td></tr></tbody>\n</table>### cURL request\n\nFeed two external documents \\(with content pointers to binary content objects previously stored using the [POST /ais/external\\_content/storeContent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/external-content-ingestion-api.md) endpoint\\) for indexing into the u\\_ext\\_content schema table.\n\n```\ncurl 'https://instance.servicenow.com/api/now/v2/ais/external_content/ingestDocument/u_ext_content' \\\n  --request POST \\\n  --user 'username':'password' \\\n  --header 'Accept: application/json' \\\n  --header 'Content-Type: application/json' \\\n  --data '[\n  {\n    \"document_id\": \"ADMIN-2027858531-16\",\n    \"content_pointer\": \"749b52a1-baa8-4556-a4f3-00404c95e6a8\",\n    \"properties\": {\n      \"title\": \"Introduction\",\n      \"url\": \"file:///myhost/reports/Introduction.pdf\",\n      \"file_name\": \"Introduction.pdf\",\n      \"file_size\": \"10285\",\n      \"creation_date\": \"2020-11-01 12:27:43\"\n    },\n    \"principals\": {\n      \"everyone\": false,\n      \"groups.read\": [\n        \"report-users\",\n        \"report-admins\"\n      ],\n      \"users.deny\": [\n        \"ad\\abel-tuter\"\n      ]\n    }\n  },\n  {\n    \"document_id\": \"ADMIN-2587918521-27\",\n    \"content_pointer\": \"bd605435-268b-464f-a7c3-0c5ea894a5c2\",\n    \"properties\": {\n      \"title\": \"Report for 31 August 2020\",\n      \"url\": \"file:///myhost/reports/Report-2020-08-31.pdf\",\n      \"file_size\": \"27597\",\n      \"creation_date\": \"2020-09-01 12:48:13\"\n    },\n    \"principals\": {\n      \"everyone\": false,\n      \"groups.read\": [\n        \"report-users\",\n        \"report-admins\"\n      ],\n      \"users.read\": [\n        \"ad\\beth-anglin\"\n      ]\n    }\n  }\n]'\n```\n\n```\n{\n  \"result\":\"{\\\"duration_in_ms\\\":3822,\\\"feedback\\\":[{\\\"messages\\\":[{\\\"level\\\":\\\"INFO\\\",\\\"message\\\":\\\"CREATED\\\",\\\"component\\\":\\\"init\\\"},{\\\"level\\\":\\\"INFO\\\",\\\"message\\\":\\\"OK\\\",\\\"component\\\":\\\"index-886de18e750030108b23bcd69cdc2dd3-indexer.index-886de18e750030108b23bcd69cdc2dd3-content-dispatcher\\\"},{\\\"level\\\":\\\"INFO\\\",\\\"message\\\":\\\"COMPLETED\\\",\\\"component\\\":\\\"sink.sink\\\"}],\\\"document_id\\\":\\\"ADMIN-2027858531-16\\\"},{\\\"messages\\\":[{\\\"level\\\":\\\"INFO\\\",\\\"message\\\":\\\"CREATED\\\",\\\"component\\\":\\\"init\\\"},{\\\"level\\\":\\\"WARN\\\",\\\"message\\\":\\\"field \\\\u0027text\\\\u0027 tokens exceed index.maxTokens\\\",\\\"code\\\":\\\"INDEX_ENGINE-32\\\",\\\"component\\\":\\\"ingestGlideDocument.standardAnalyzer\\\"},{\\\"level\\\":\\\"INFO\\\",\\\"message\\\":\\\"OK\\\",\\\"component\\\":\\\"index-886de18e750030108b23bcd69cdc2dd3-indexer.index-886de18e750030108b23bcd69cdc2dd3-content-dispatcher\\\"},{\\\"level\\\":\\\"INFO\\\",\\\"message\\\":\\\"COMPLETED\\\",\\\"component\\\":\\\"sink.sink\\\"}],\\\"document_id\\\":\\\"ADMIN-2587918521-27\\\"}]}\"\n}\n```\n\n## External Content Ingestion API – POST ais/external\\_content/storeContent\n\nStores binary content as a content object in AI Search.\n\nYou can associate stored binary content with an external document by following these steps:\n\n1.  Store the binary content using this endpoint. Record the value of the **result** response body parameter.\n2.  Send the external document to AI Search using the [POST /ais/external\\_content/ingestDocument/\\{schema\\_table\\_name\\}](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/external-content-ingestion-api.md) endpoint. Set the document's **content\\_pointer** request body parameter to match the recorded **result** response body parameter value.\n\nDuring ingestion, AI Search parses the binary content and adds its searchable content to the indexed record that represents the external document. Parsing removes the stored content object.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/ais/external_content/storeContent`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n|Element|Description|\n|-------|-----------|\n|\\[binary data\\]|Required. Binary content to store as a content object in AI Search.|\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-JSON-only-entry-RESTAPI\">\n\nData format of the response body. Only supports **application/json**.\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td>\n\nData format of the request body.\n\n Valid values:\n\n-   **application/msword**\n-   **application/octet-stream**\n-   **application/pdf**\n-   **application/vnd.ms-excel**\n-   **application/vnd.ms-powerpoint**\n-   **application/vnd.ms-powerpoint.presentation.macroenabled.12**\n-   **application/vnd.openxmlformats-officedocument.presentationml.presentation**\n-   **application/vnd.openxmlformats-officedocument.presentationml.template**\n-   **application/vnd.openxmlformats-officedocument.spreadsheetml.sheet**\n-   **application/vnd.openxmlformats-officedocument.wordprocessingml.document**\n-   **application/vnd.openxmlformats-officedocument.wordprocessingml.template**\n-   **text/html**\n-   **text/plain**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nObject describing the error encountered during processing of the request.\n\n Data type: Object\n\n ```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nDetails of the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nMessage for the error encountered during processing of the request.\n\n Data type: String\n\n</td></tr><tr><td>\n\nresult\n\n</td><td>\n\nIdentifier for the binary content object stored by successful request.\n\n Data type: String\n\n ```\n\"result\" : \"91841766-2a5f-4c64-a20a-27ca485eca21\"\n```\n\n **Note:** To attach the stored content to an ingested external document, specify this identifier as the **content\\_pointer** request body element for a request to the ingestDocument endpoint.\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of an unsuccessful request.\n\n Valid values:\n\n-   **failure**\n\n Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nStore binary content for a PDF file as a content object.\n\n```\ncurl 'https://instance.servicenow.com/api/now/v2/ais/external_content/storeContent' \\\n--request POST \\\n--user 'username':'password' \\\n--header 'Content-Type: application/pdf' \\\n--data-binary '@Report-2020-08-31.pdf'\n```\n\nThe response body includes the unique identifier for the new content object.\n\n```\n{\n  \"result\" : \"fb439a4f-62ad-4dab-9654-5088d99a6ff9\"\n}\n```\n\n"}}