Method: corpora.documents.list

Lists all Documents in a Corpus.

HTTP request

GET https://generativelanguage.googleapis.com/v1beta/{parent=corpora/*}/documents

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The name of the Corpus containing Documents. Example: corpora/my-corpus-123

Query parameters

Parameters
pageSize

integer

Optional. The maximum number of Documents to return (per page). The service may return fewer Documents.

If unspecified, at most 10 Documents will be returned. The maximum size limit is 20 Documents per page.

pageToken

string

Optional. A page token, received from a previous documents.list call.

Provide the nextPageToken returned in the response as an argument to the next request to retrieve the next page.

When paginating, all other parameters provided to documents.list must match the call that provided the page token.

Request body

The request body must be empty.

Response body

Response from documents.list containing a paginated list of Documents. The Documents are sorted by ascending document.create_time.

If successful, the response body contains data with the following structure:

JSON representation
{
  "documents": [
    {
      object (Document)
    }
  ],
  "nextPageToken": string
}
Fields
documents[]

object (Document)

The returned Documents.

nextPageToken

string

A token, which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no more pages.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/generative-language.retriever
  • https://www.googleapis.com/auth/generative-language.retriever.readonly

For more information, see the Authentication Overview.