# Submit visitor feedback

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

201 confirms a feedback record ID only, without regeneration. Omitting both message/task records conversation-level feedback. Mismatched targets are treated as publicly unavailable.


```http
POST https://api.moi.matrixorigin.cn/v5/public/webapp/feedback
```

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

[Prepare links and visitor identity in the same environment](identity-lifecycle.md#prepare). Do not supply a product PAT or Workspace request header.

## Request

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --request POST \
  "$BASE_URL/public/webapp/feedback?webapp=$AGENT_ID&t=$WEBAPP_TOKEN&s=$WEBAPP_SESSION" \
  --header "Content-Type: application/json" \
  --data @- <<JSON
{"conversation_id": "${CONVERSATION_ID}", "rating": "up", "comment": "回答有帮助"}
JSON
```

:::::
:::::{tab-item} Parameters

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `webapp` | Queries | string | Yes | Agent ID corresponding to the link. |
| `t` | Queries | string | Yes | Current valid publication token. For short-code links, resolve first and use the short code as t. |
| `s` | Queries | string | Yes | Visitor session credentials under the same publication. |
| `conversation_id` | Body | string | Yes | Current visitor's active conversation ID. |
| `rating` | Body | string | Yes | up/down/neutral。 |
| `comment` | Body | string | No | At most 2000 Unicode characters. |
| `message_id` | Body | string | No | Agent response message ID within this conversation. |
| `task_id` | Body | string | No | When supplied, identifies the canonical response for this task. If message_id is also supplied, it must match. |

:::::
::::::
:::::::

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": 0,
  "data": {
    "feedback_id": "feedback-example"
  }
}
```

:::::
:::::{tab-item} Fields

Success returns HTTP 201 with numeric code=0. Read data's [Object descriptions](objects.md) with the example; the conversation-creation example shows a field excerpt only.

:::::
::::::
:::::::

## Error responses

[Public errors and identity handling](identity-lifecycle.md#errors) distinguishes unavailable links, disablement, invalid sessions, parameters, and system failures.
