Knowledge Sources - Delete File
Deletes a file from a File knowledge source and removes all indexed content derived from it.
DELETE {endpoint}/knowledgesources('{sourceName}')/files('{fileId}')?api-version=2026-05-01-preview
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
The endpoint URL of the search service. |
|
file
|
path | True |
string |
The unique identifier of the file to delete. |
|
source
|
path | True |
string |
The name of the knowledge source. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| Accept |
The Accept header. |
||
| x-ms-client-request-id |
string (uuid) |
An opaque, globally-unique, client-generated string identifier for the request. |
Responses
| Name | Type | Description |
|---|---|---|
| 204 No Content |
There is no content to send for this request, but the headers may be useful. |
|
| 404 Not Found |
The server cannot find the requested resource. |
|
| Other Status Codes |
An unexpected error response. |
Security
api-key
Type:
apiKey
In:
header
OAuth2Auth
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Scopes
| Name | Description |
|---|---|
| https://search.azure.com/.default |
Examples
SearchServiceDeleteKnowledgeSourceFile
Sample request
DELETE https://previewexampleservice.search.windows.net/knowledgesources('ks-file-test')/files('00000000-0000-0000-0000-000000000001')?api-version=2026-05-01-preview
Sample response
Definitions
| Name | Description |
|---|---|
| Accept |
The Accept header. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
Accept
The Accept header.
| Value | Description |
|---|---|
| application/json;odata.metadata=minimal |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
searchservice.knowledgesources.deletefile |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
| Name | Type | Description |
|---|---|---|
| error |
The error object. |