Delete assets

async AsyncCogniteClient.assets.delete(
id: int | Sequence[int] | None = None,
external_id: str | SequenceNotStr[str] | None = None,
recursive: bool = False,
ignore_unknown_ids: bool = False,
) None

Delete one or more assets.

Parameters:
  • id (int | Sequence[int] | None) – Id or list of ids

  • external_id (str | SequenceNotStr[str] | None) – External ID or list of external ids

  • recursive (bool) – Recursively delete whole asset subtrees under given ids. Defaults to False.

  • ignore_unknown_ids (bool) – Ignore IDs and external IDs that are not found rather than throw an exception.

Examples

Delete assets by id or external id:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> client.assets.delete(id=[1, 2, 3], external_id="3")