---
orphan: true
---

# Query runtime task events

Query the events recorded by a runtime task.

```text
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-runtime-tasks/{task_id}/events
```

## Preparation before calling

Called using `$AI_STUDIO_API_KEY`, `$WORKSPACE_ID` and `$TASK_ID`.

## Request example

```bash
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-runtime-tasks/$TASK_ID/events" -H "X-API-Key: $AI_STUDIO_API_KEY" -H "X-Workspace-ID: $WORKSPACE_ID"
```

## Successful response

Returns `200` and the task event on success.

```json
{"code":0,"data":{"items":[]}}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `data.items` | array | Task events. |

## Error response

```json
{"code":5,"message":"task not found"}
```
