# Query feedback

Filter run feedback reviewable by the current user by Agent, Context, Task, Message, or Rating.

```text
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/feedback
```

## Preparation before calling

Prepare a personal access token and target workspace ID that has access to the target workspace. If you need to filter by agent, first obtain the agent ID.

The example below uses:

- `$AI_STUDIO_API_KEY`: The actual personal access token, passed through the `X-API-Key` Header.
- `$WORKSPACE_ID`: Target workspace ID, passed through `X-Workspace-ID` Header.
- `$AGENT_ID`: Optional agent filter ID.

## Request example

```bash
curl --get "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/feedback" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --data-urlencode "agent_id=$AGENT_ID" \
  --data-urlencode "rating=positive" \
  --data-urlencode "limit=20"
```

## Path parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | Yes | The current workspace ID. |

## Query parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | No | Filter by agent ID. |
| `agent_workspace_id` | string | No | The workspace to which the agent belongs. |
| `context_id` | string | No | Filter by A2A context ID. |
| `task_id` | string | No | Filter by task ID. |
| `message_id` | string | No | Filter by message ID. |
| `rating` | string | No | Filter by rating. |
| `limit` | integer | No | Returns the upper limit of quantity. |
| `offset` | integer | No | Returns the offset. |

## Successful response

Returns `200` on success.

```json
{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "fb_01",
        "workspace_id": "ws_01",
        "agent_id": "agent_01",
        "context_id": "ctx_01",
        "task_id": "task_01",
        "message_id": "msg_01",
        "rating": "up",
        "intent": "quality",
        "labels": [],
        "created_by": "user_01",
        "created_at": "2026-01-02T15:04:05Z"
      }
    ],
    "total": 1,
    "limit": 20,
    "offset": 0
  }
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | `0` on success. |
| `data.items[]` | array | Feedback record list. |
| `data.items[].id` | string | Feedback ID. |
| `data.items[].workspace_id` | string | Belonging workspace and agent ID. |
| `data.items[].agent_id` | string | Belonging workspace and agent ID. |
| `data.items[].context_id` | string | The associated context, task, and message ID. |
| `data.items[].task_id` | string | The associated context, task, and message ID. |
| `data.items[].message_id` | string | The associated context, task, and message ID. |
| `data.items[].artifact_id` | string | Associated product or tool call ID. |
| `data.items[].tool_call_id` | string | Associated product or tool call ID. |
| `data.items[].part_index` | integer | Message fragment index; only returned if there is a value. |
| `data.items[].rating` | string | Rating and feedback intent. |
| `data.items[].intent` | string | Rating and feedback intent. |
| `data.items[].comment` | string | Feedback description; only returned if there is a value. |
| `data.items[].labels` | string[] | Feedback tag; only returned if there is a value. |
| `data.items[].created_by` | string | Creator and creation time. |
| `data.items[].created_at` | string | Creator and creation time. |
| `data.total` | integer | The total number of filter results, the current return upper limit and offset. |
| `data.limit` | integer | The total number of filter results, the current return upper limit and offset. |
| `data.offset` | integer | The total number of filter results, the current return upper limit and offset. |

`[]` after a type denotes an array. `[]` in a field path denotes each item in an array.

## Error response

```json
{
  "code": 2,
  "message": "反馈筛选条件无效"
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 22 32 34

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - `2`（`INVALID_ARGUMENT`）
  - The resource ID, rating, or paging parameters are invalid.
  - Check path and query parameters.
* - `401`
  - `6`（`UNAUTHENTICATED`）
  - Credentials are missing or invalid.
  - Check API Key.
* - `403`
  - `5`（`PERMISSION_DENIED`）
  - Current identity cannot read workspace feedback.
  - Use valid credentials, or contact your administrator for authorization.
* - `503`
  - `15`（`UNAVAILABLE`）
  - Feedback review service is unavailable.
  - Try again later.
```

## Follow-up operations

Use the same filter condition [Query feedback statistics](get-feedback-statistics.md).
