Retrieve an event by id
- async AsyncCogniteClient.events.retrieve(
- id: int | None = None,
- external_id: str | None = None,
Retrieve a single event by id.
Deprecated since version 8.23.0: The Events API is deprecated and is scheduled for removal on 2027-12-31. Move events to records, CogniteActivity or CogniteMaintenanceOrder in the core data model. See https://docs.cognite.com/cdf/deprecated for details and migration guidance.
- Parameters:
id (int | None) – ID
external_id (str | None) – External ID
- Returns:
Requested event or None if it does not exist.
- Return type:
Event | None
Examples
Get event by id:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.events.retrieve(id=1)
Get event by external id:
>>> res = client.events.retrieve(external_id="1")