List annotation

async AsyncCogniteClient.annotations.list(
filter: AnnotationFilter | dict,
limit: int | None = 25,
) AnnotationList

List annotations.

Note

Passing a filter with both ‘annotated_resource_type’ and ‘annotated_resource_ids’ is always required.

Parameters:
  • filter (AnnotationFilter | dict) – Return annotations with parameter values that match what is specified.

  • limit (int | None) – Maximum number of annotations to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

Returns:

list of annotations

Return type:

AnnotationList

Example

List all annotations for the file with id=123:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes import AnnotationFilter
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> flt = AnnotationFilter(
...     annotated_resource_type="file", annotated_resource_ids=[{"id": 123}]
... )
>>> res = client.annotations.list(flt, limit=None)