> ## Documentation Index
> Fetch the complete documentation index at: https://langwatch.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Thumbs Up/Down

> Track thumbs up/down user feedback in LangWatch to evaluate LLM quality and guide AI agent testing improvements.

Thumbs up/down events are used to capture user feedback on specific messages or interactions with your chatbot or LLM application, with an optional textual feedback.

You can use those user provided inputs in combination with the automatic sentiment analysis provided by LangWatch to gauge how satisfied your users are with the generated responses, and use this information to get insights, debug, iterate and improve your product.

To use the thumbs\_up\_down event it's important that you have used an explicit `trace_id` defined on your side when doing the integration. Read more about it on [concepts](../concepts).

## REST API Specification

### Endpoint

`POST /api/track_event`

### Headers

* `X-Auth-Token`: Your LangWatch API key.

### Request Body

```javascript theme={null}
{
  "trace_id": "id of the message the user gave the feedback on",
  "event_type": "thumbs_up_down",
  "metrics": {
    "vote": 1 // Use 1 for thumbs up, 0 for neutral or undo feedback, and -1 for thumbs down
  },
  "event_details": {
    "feedback": "Optional user feedback text"
  },
  "timestamp": 1617981376000 // Unix timestamp in milliseconds
}
```

### Example

```bash theme={null}
curl -X POST "https://app.langwatch.ai/api/track_event" \\
     -H "X-Auth-Token: your_api_key" \\
     -H "Content-Type: application/json" \\
     -d '{
       "trace_id": "trace_Yy0XWu6BOwwnrkLtQh9Ji",
       "event_type": "thumbs_up_down",
       "metrics": {
         "vote": 1
       },
       "event_details": {
         "feedback": "This response was helpful!"
       },
       "timestamp": 1617981376000
     }'
```

The `vote` metric is mandatory and must be either `1` or `-1`. The `feedback` field in `event_details` is optional and can be used to provide additional context or comments from the user.
