# Events

Workload events that occurred while the workload was running. Use to diagnose issue around workload scheduling.

## Get the workload events.

> Retrieve all the workload events using a workload id.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.19"},"tags":[{"name":"Events","description":"Workload events that occurred while the workload was running. Use to diagnose issue around workload scheduling."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"WorkloadId":{"name":"workloadId","in":"path","required":true,"description":"The  Universally Unique Identifier (UUID) of the workload.","schema":{"type":"string","format":"uuid"}},"Offset":{"name":"offset","in":"query","required":false,"description":"The offset of the first item returned in the collection.","schema":{"type":"integer","format":"int32"}},"Limit":{"name":"limit","in":"query","required":false,"description":"The maximum number of entries to return.","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":500}}},"schemas":{"Events":{"type":"array","items":{"$ref":"#/components/schemas/Event1"}},"Event1":{"type":"object","nullable":true,"required":["createdAt","type","clusterId","message"],"properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"message":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string"},"involvedObject":{"$ref":"#/components/schemas/InvolvedObject"}}},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"InvolvedObject":{"type":"object","required":["uid","kind","name","namespace"],"properties":{"uid":{"type":"string","format":"uuid"},"kind":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/workloads/{workloadId}/events":{"get":{"summary":"Get the workload events.","description":"Retrieve all the workload events using a workload id.","operationId":"get_workload_events","tags":["Events"],"parameters":[{"$ref":"#/components/parameters/WorkloadId"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"next":{"type":"integer"},"events":{"$ref":"#/components/schemas/Events"}}}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get the workload history.

> Retrieve workload history details, including events, using a workload id.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.19"},"tags":[{"name":"Events","description":"Workload events that occurred while the workload was running. Use to diagnose issue around workload scheduling."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"WorkloadId":{"name":"workloadId","in":"path","required":true,"description":"The  Universally Unique Identifier (UUID) of the workload.","schema":{"type":"string","format":"uuid"}},"Offset":{"name":"offset","in":"query","required":false,"description":"The offset of the first item returned in the collection.","schema":{"type":"integer","format":"int32"}},"Limit":{"name":"limit","in":"query","required":false,"description":"The maximum number of entries to return.","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":500}}},"schemas":{"HistoryRecords":{"type":"array","items":{"$ref":"#/components/schemas/HistoryRecord"}},"HistoryRecord":{"type":"object","required":["meta","spec"],"properties":{"meta":{"$ref":"#/components/schemas/HistoryRecordMeta"},"spec":{"type":"object","properties":{"event":{"$ref":"#/components/schemas/Event1"},"phaseUpdate":{"$ref":"#/components/schemas/PhaseUpdate"}}}}},"HistoryRecordMeta":{"type":"object","required":["creationTimestamp","type"],"properties":{"creationTimestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/HistoryRecordType"}}},"HistoryRecordType":{"type":"string","enum":["Event","PhaseUpdate"]},"Event1":{"type":"object","nullable":true,"required":["createdAt","type","clusterId","message"],"properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"message":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string"},"involvedObject":{"$ref":"#/components/schemas/InvolvedObject"}}},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"InvolvedObject":{"type":"object","required":["uid","kind","name","namespace"],"properties":{"uid":{"type":"string","format":"uuid"},"kind":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"}}},"PhaseUpdate":{"type":"object","nullable":true,"required":["phase","phaseMessage"],"properties":{"phase":{"$ref":"#/components/schemas/Phase"},"phaseMessage":{"type":"string"}}},"Phase":{"type":"string","enum":["Creating","Initializing","Resuming","Pending","Deleting","Running","Updating","Stopped","Stopping","Degraded","Failed","Completed","Terminating","Unknown"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/workloads/{workloadId}/history":{"get":{"summary":"Get the workload history.","description":"Retrieve workload history details, including events, using a workload id.","operationId":"get_workload_history","tags":["Events"],"parameters":[{"$ref":"#/components/parameters/WorkloadId"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"type":"object","required":["records"],"properties":{"next":{"type":"integer"},"records":{"$ref":"#/components/schemas/HistoryRecords"}}}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://run-ai-docs.nvidia.com/api/2.19/workloads/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
