List Files In Source

Select a knowledge base

Register a Knowledge with contents_db on AgentOS, an Agent or a Team. Read the actual generated ID from GET /config under knowledge.knowledge_instances; use that knowledge_id in the request's selector. It is not an arbitrary Knowledge.id. A selector is required when multiple instances make the request ambiguous (400); no configured knowledge base returns 503. If both selectors are supplied, knowledge_id takes precedence over db_id.

Ingestion and search also require suitable readers, vector storage, an embedder where needed, and their dependencies and credentials. See Knowledge.

S3 file browser

This endpoint currently supports S3Config only. Other registered source types return 400; RemoteKnowledge returns 501. S3 listing requires the AWS SDK, credentials and permission to list the configured bucket/prefix. Use a source_id from the selected knowledge base's source list.

Page numbers start at 1 and limit must be between 1 and 1000. prefix and delimiter control folder navigation. Registering or ingesting a GCS, SharePoint, GitHub or Azure Blob source does not make it browsable through this endpoint.

GET/knowledge/{knowledge_id}/sources/{source_id}/files

List available files and folders in a specific content source. Supports pagination and folder navigation.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

knowledge_id*Knowledge Id

ID of the knowledge base

source_id*Source Id

ID of the content source

Query Parameters

prefix?|

Path prefix to filter files

limit?Limit

Number of files per page

Range1 <= value <= 1000
Default100
page?Page

Page number (1-indexed)

Range1 <= value
Default1
delimiter?Delimiter

Folder delimiter (enables folder grouping)

Default"/"
db_id?|

The ID of the database to use

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl --request GET 'https://example.com/knowledge/string/sources/string/files'
{  "source_id": "company-s3",  "source_name": "Company Documents",  "prefix": "reports/",  "folders": [    {      "prefix": "reports/2024/",      "name": "2024",      "is_empty": false    }  ],  "files": [    {      "key": "reports/annual-summary.pdf",      "name": "annual-summary.pdf",      "size": 102400,      "last_modified": "2024-01-15T10:30:00Z",      "content_type": "application/pdf"    }  ],  "meta": {    "page": 1,    "limit": 100,    "total_pages": 1,    "total_count": 1  }}