List all documents.
Changed onReturns all indexed documents in an agent's knowledge base. Each document represents a piece of content (webpage, PDF, uploaded file) that the agent can reference when answering questions. Results are paginated.
You can use the optional search parameter to filter results by document URL or filename.
Notes: In the API, documents are called "pages" for backward compatibility.
Request
- Base URLhttps://app.customgpt.ai
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The unique agent identifier.
Query parameters
Page number to retrieve. Page numbering starts at 1.
Increment until the response's last_page value is reached to paginate through all results. Default: 1.
Limit the number of documents to return. Defaults to 20.
Sort direction for results.
Filter documents by a search term. Performs a case-insensitive substring match against the document URL and filename.
For example, `search=annual-report` matches both `https://example.com/annual-report-2024.pdf` and `annual-report-summary.pdf`.
Supports wildcards:
- `*` matches any sequence of characters (e.g., `search=annual*report` matches `annual-sales-report.pdf` and `annual-lease-report.pdf`)
- `?` matches a single character (e.g., `search=v?-report` matches `v1-report`, `v2-report`, `v3-report`)
When omitted, all documents are returned.
Filter pages by crawl status.
Filter pages by index status.
Response
List of pages successfully retrieved.
Example response
{
"status": "success",
"data": {
"project": {
"id": 1,
"project_name": "My Agent",
"sitemap_path": "https://www.example.com/sitemap.xml",
"is_chat_active": true,
"user_id": 1,
"team_id": 1,
"created_at": "2021-01-01 00:00:00",
"updated_at": "2021-01-01 00:00:00",
"deleted_at": "2021-01-01 00:00:00",
"type": "SITEMAP",
"is_shared": true,
"shareable_slug": "1234567890abcdef1234567890abcdef",
"are_licenses_allowed": true
},
"pages": {
"current_page": 1,
"data": [
{
"id": 1,
"page_url": "https://example.com",
"page_url_hash": "d41d8cd98f00b204e9800998ecf8427e",
"project_id": 1,
"s3_path": "project-1/page-1/file.pdf",
"crawl_status": "queued",
"index_status": "queued",
"is_file": true,
"is_refreshable": true,
"is_file_kept": true,
"filename": "file.pdf",
"filesize": 100,
"created_at": "2021-01-01 00:00:00",
"updated_at": "2021-01-01 00:00:00",
"deleted_at": "2021-01-01 00:00:00"
}
],
"first_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
"next_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
"path": "https://app.customgpt.ai/api/v1/users?page=1",
"per_page": 10,
"prev_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
"to": 1,
"total": 1
}
}
}Changes
- warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
422.00enum value to the/response property for the response status - info
added the new optional
queryrequest parametersearch - info
added the non-success response with the status
- info
added the optional property
//to the response with the status
- warning
- breaking
the
////response's property format changed frombinaryto no format for status - warning
deleted the
queryrequest parameterduration - warning
added the new
Agent id is requiredenum value to the/response property for the response status - warning
added the new
Agent with id {projectId} not foundenum value to the/response property for the response status - info
added the new optional
queryrequest parametercrawl_status - info
added the new optional
queryrequest parameterindex_status - info
added the new optional
queryrequest parameterlimit - info
added the optional property
////to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
removed the
Project id is requiredenum value from the/response property for the response status - info
removed the
Project with id {projectId} not foundenum value from the/response property for the response status
- breaking