Pages

List all documents.

Changed on

Returns 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.

get/api/v1/projects/{projectId}/pages

Request

Path parameters

projectIdinteger required
Example:1

The unique agent identifier.

Query parameters

pageinteger

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.

limitinteger

Limit the number of documents to return. Defaults to 20.

order'asc' | 'desc'

Sort direction for results.

searchstring
Example:annual-report

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.
crawl_status'all' | 'ok' | 'failed' | 'n/a' | 'queued' | 'limited'

Filter pages by crawl status.

index_status'all' | 'ok' | 'failed' | 'n/a' | 'queued' | 'limited'

Filter pages by index status.

Response

List of pages successfully retrieved.

status'error' | 'success'

The status of the response

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.00 enum value to the / response property for the response status

    • warning

      added the new 422.00 enum value to the / response property for the response status

    • warning

      added the new 422.00 enum value to the / response property for the response status

    • warning

      added the new 422.00 enum value to the / response property for the response status

    • info

      added the new optional query request parameter search

    • info

      added the non-success response with the status

    • info

      added the optional property // to the response with the status

    • breaking

      the //// response's property format changed from binary to no format for status

    • warning

      deleted the query request parameter duration

    • warning

      added the new Agent id is required enum value to the / response property for the response status

    • warning

      added the new Agent with id {projectId} not found enum value to the / response property for the response status

    • info

      added the new optional query request parameter crawl_status

    • info

      added the new optional query request parameter index_status

    • info

      added the new optional query request parameter limit

    • 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 required enum value from the / response property for the response status

    • info

      removed the Project with id {projectId} not found enum value from the / response property for the response status