Knowledge Sources - List Files
Lists all files in a File knowledge source.
GET {endpoint}/knowledgesources('{sourceName}')/files?api-version=2026-10-01
GET {endpoint}/knowledgesources('{sourceName}')/files?api-version=2026-10-01&prefix={prefix}&search={search}&pageSize={pageSize}&searchType=prefix
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
The endpoint URL of the search service. |
|
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. |
|
page
|
query |
integer (int32) minimum: 1maximum: 3000 |
The maximum number of items to return in a single page. The server enforces a maximum; if omitted, the server determines a suitable default. |
|
|
prefix
|
query |
string |
Optional prefix to filter files by their directory-like path. |
|
|
search
|
query |
string |
A string used to narrow down the listing so that fewer results need to be paged through. If omitted or an empty string is passed, no narrowing is applied. |
|
|
search
|
query |
Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. |
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| x-ms-client-request-id |
string (uuid) |
An opaque, globally-unique, client-generated string identifier for the request. |
|
| Accept |
The Accept header. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
The request has succeeded. |
|
| 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
SearchServiceListKnowledgeSourceFiles
Sample request
GET https://typespecstableexampleservice.search.windows.net/knowledgesources('ks-stable-test')/files?api-version=2026-10-01&prefix=&search=&pageSize=&searchType=prefix
Sample response
{
"value": [
{
"fileId": "00000000-0000-0000-0000-000000000001",
"fileName": "notes/build26/kr-features.md",
"fileSizeBytes": 1184,
"createdAt": "2026-08-03T17:04:22Z",
"lastUpdatedAt": "2026-08-03T17:04:22Z",
"prefix": "notes/build26/",
"parsingMode": "markdown",
"extractionMode": "minimal",
"metadata": {
"team": "kr",
"source": "build26-notes"
}
}
]
}
Definitions
| Name | Description |
|---|---|
| Accept |
The Accept header. |
|
Blob |
Represents the parsing mode for indexing from an Azure blob data source. |
|
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.). |
|
File |
The extraction effort applied to an individual file. 'minimal' (the default) uses built-in extraction; 'standard' uses Content Understanding. |
|
Knowledge |
Metadata for a file uploaded to a File knowledge source. |
|
Listing |
Specifies how the search parameter is interpreted when narrowing down a listing result set. Currently only 'prefix' is supported. |
|
List |
Response from a List Files request. |
Accept
The Accept header.
| Value | Description |
|---|---|
| application/json;odata.metadata=minimal |
BlobIndexerParsingMode
Represents the parsing mode for indexing from an Azure blob data source.
| Value | Description |
|---|---|
| default |
Set to default for normal file processing. |
| text |
Set to text to improve indexing performance on plain text files in blob storage. |
| delimitedText |
Set to delimitedText when blobs are plain CSV files. |
| json |
Set to json to extract structured content from JSON files. |
| jsonArray |
Set to jsonArray to extract individual elements of a JSON array as separate documents. |
| jsonLines |
Set to jsonLines to extract individual JSON entities, separated by a new line, as separate documents. |
| markdown |
Set to markdown to extract content from markdown files. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
searchservice.knowledgesources.listfiles |
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. |
FileKnowledgeSourceExtractionMode
The extraction effort applied to an individual file. 'minimal' (the default) uses built-in extraction; 'standard' uses Content Understanding.
| Value | Description |
|---|---|
| minimal |
Built-in extraction was performed. |
| standard |
Content Understanding extraction was performed. |
KnowledgeSourceFile
Metadata for a file uploaded to a File knowledge source.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp when the file was created. |
| errorMessage |
string |
The error message if file processing failed, null otherwise. |
| extractionMode |
The extraction mode applied to the file. |
|
| fileId |
string |
The unique identifier for the file. |
| fileName |
string |
The original file name. |
| fileSizeBytes |
integer (int64) |
The file size in bytes. |
| lastUpdatedAt |
string (date-time) |
The timestamp when the file was last updated. |
| metadata |
object |
Custom key/value metadata stored with the file. Returned but not searchable or filterable. |
| parsingMode |
The parsing mode applied to the file (auto-detected from the file). |
|
| prefix |
string |
The prefix (directory-like path) derived from the full file name. |
ListingSearchType
Specifies how the search parameter is interpreted when narrowing down a listing result set. Currently only 'prefix' is supported.
| Value | Description |
|---|---|
| prefix |
Matches items whose name starts with the value of the search parameter. |
ListKnowledgeSourceFilesResult
Response from a List Files request.
| Name | Type | Description |
|---|---|---|
| @odata.nextLink |
string |
The URL that can be used to fetch the next set of results. |
| value |
The list of files. |