Skip to main content
POST
/
documents
/
list
Python SDK
from cognite.client.data_classes import filters
from cognite.client.data_classes.documents import DocumentProperty
is_pdf = filters.Equals(DocumentProperty.mime_type, "application/pdf")
pdf_documents = client.documents.list(filter=is_pdf)

from cognite.client.data_classes.documents import DocumentProperty
for document in client.documents:
   print(document.name)

from cognite.client.data_classes.documents import SortableDocumentProperty
documents = client.documents.list(sort=(SortableDocumentProperty.mime_type, "desc"))
{
  "items": [
    {
      "id": 2384,
      "createdTime": 1519862400000,
      "sourceFile": {
        "name": "hamlet.txt",
        "directory": "plays/shakespeare",
        "source": "SubsurfaceConnectors",
        "mimeType": "application/octet-stream",
        "size": 1000,
        "hash": "23203f9264161714cdb8d2f474b9b641e6a735f8cea4098c40a3cab8743bd749",
        "assetIds": [],
        "labels": [
          {
            "externalId": "play"
          },
          {
            "externalId": "tragedy"
          }
        ],
        "geoLocation": {
          "type": "Point",
          "coordinates": [
            10.74609,
            59.91273
          ]
        },
        "datasetId": 4503599627370496,
        "securityCategories": [],
        "metadata": {}
      },
      "externalId": "haml001",
      "instanceId": {
        "space": "<string>",
        "externalId": "<string>"
      },
      "title": "Hamlet",
      "author": "William Shakespeare",
      "producer": "<string>",
      "modifiedTime": 1519958703000,
      "lastIndexedTime": 1521062805000,
      "mimeType": "text/plain",
      "extension": "pdf",
      "pageCount": 2,
      "type": "Document",
      "language": "en",
      "truncatedContent": "ACT I\nSCENE I. Elsinore. A platform before the castle.\n  FRANCISCO at his post. Enter to him BERNARDO\nBERNARDO\n  Who's there?\n",
      "assetIds": [
        42,
        101
      ],
      "labels": [
        {
          "externalId": "my.known.id"
        }
      ],
      "geoLocation": {
        "type": "Point",
        "coordinates": [
          10.74609,
          59.91273
        ]
      }
    }
  ],
  "nextCursor": "<string>"
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Body

application/json

Fields to be set for the list request.

Filter with exact match

filter
and · object

A query that matches items matching boolean combinations of other queries. It is built using one or more boolean clauses, which can be of types: and, or or not

sort
object[]

List of properties to sort by. Currently only supports 1 property.

Required array length: 1 element
limit
integer<int32>
default:100

Maximum number of items per page. Use the cursor to get more pages.

Required range: 1 <= x <= 1000
cursor
string

Cursor for paging through results.

Response

One page of document list results.

items
object[]
required
nextCursor
string

The cursor to get the next page of results (if available).

Last modified on April 23, 2026