> For the complete documentation index, see [llms.txt](https://docs.cedana.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cedana.ai/references/api/events.md).

# Events

Cedana API for events

## List events

> Returns events within the specified time window, optionally filtered by operation or resource type.\
> The metadata field contains structured information about the event that can be used for filtering and display.

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Events","description":"Cedana API for events"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"Event":{"type":"object","description":"A single Event record with structured metadata","required":["id","status","operation","resource_type","message","metadata","source","timestamp"],"properties":{"id":{"type":"integer","format":"int64"},"message":{"type":"string"},"metadata":{},"operation":{"type":"string"},"resource_type":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"timestamp":{"type":"integer","minimum":0}}},"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/events":{"get":{"tags":["Events"],"summary":"List events","description":"Returns events within the specified time window, optionally filtered by operation or resource type.\nThe metadata field contains structured information about the event that can be used for filtering and display.","operationId":"list_events","parameters":[{"name":"time","in":"query","description":"Time window in seconds (default: 3600 = 1 hour)","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"operation","in":"query","description":"Filter by operation (e.g., \"checkpoint\", \"restore\")","required":false,"schema":{"type":["string","null"]}},{"name":"resource_type","in":"query","description":"Filter by resource type (e.g., \"pod\", \"action\", \"checkpoint\")","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Returns list of events","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}},"500":{"description":"Failed to fetch events from database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```
