Delete Index (Azure AI Search REST API)
Important
This API reference is for a legacy version. See Data plane REST operations for updated reference documentation. Use the filter on the top left to select a version.
The Delete Index operation permanently removes an index and its contents from your Azure AI Search service. This operation is final, with no recovery option. Make sure you have a master copy of your index definition code, data ingestion code, and a backup of the external data source in case a rebuild is required.
DELETE https://[service name].search.windows.net/indexes/[index name]?api-version=[api-version]
Content-Type: application/json
api-key: [admin key]
If you attempt to delete an index that is currently mapped to an alias, the operation will fail with 400 (Bad Request) and an error message stating that the alias(es) that's mapped to that index must be deleted or mapped to a different index before the index can be deleted.
URI Parameters
Parameter | Description |
---|---|
service name | Required. Set this to the unique, user-defined name of your search service. |
index name | Required. The request URI specifies the name of the index to delete. |
api-version | Required. The current stable version is api-version=2020-06-30 . See API versions for more versions. |
Request Headers
The following table describes the required and optional request headers.
Fields | Description |
---|---|
Content-Type | Required. Set this to application/json |
api-key | Optional if you're using Azure roles and a bearer token is provided on the request, otherwise a key is required. An api-key is a unique, system-generated string that authenticates the request to your search service. Delete requests must include an api-key header set to your admin key (as opposed to a query key). See Connect to Azure AI Search using key authentication for details. |
Request Body
None.
Response
Status Code: 204 No Content is returned for a successful response.