---
title: "User Feedback"
description: "Learn how to view user feedback submissions which, paired with the original event, give you additional insight into issues."
url: https://docs.sentry.io/platforms/native/user-feedback/
---

# Set Up User Feedback | Sentry for Native

Sentry makes it possible to collect additional feedback when a user experiences an error. You can collect feedback according to the method supported by your SDK of choice.

## [User Feedback API](https://docs.sentry.io/platforms/native/user-feedback.md#user-feedback-api)

The user feedback API allows you to collect user feedback using your own UI. You can use the same programming language you have in your app to then send the feedback. In this case, the SDK creates the HTTP request so you don't have to deal with posting data via HTTP.

Sentry pairs the feedback with the original event, giving you additional insight into issues. In order to do this, Sentry needs the `eventId`. For example, to get the `eventId`, you can use [`before_send`](https://docs.sentry.io/platforms/native/configuration/options.md#before-send)or the return value of the method capturing an event.

```cpp
#include <sentry.h>

sentry_value_t event = sentry_value_new_message_event(
    SENTRY_LEVEL_INFO, "my-logger", "Hello user feedback!");
sentry_uuid_t event_id = sentry_capture_event(event);

sentry_value_t user_feedback = sentry_value_new_feedback(
    "Feedback message", "jane.doe@example.com", "Jane", &event_id);
sentry_capture_feedback(user_feedback);
```

`sentry_value_new_user_feedback` and `sentry_capture_user_feedback` are deprecated. They produce the older User Report envelope item, which doesn't carry scope data or attachments. Use `sentry_value_new_feedback` and `sentry_capture_feedback` instead.

### [What Gets Sent With Feedback](https://docs.sentry.io/platforms/native/user-feedback.md#what-gets-sent-with-feedback)

Available since: `v0.16.0`

Feedback carries the global scope's data: release, environment, tags, user, and contexts including the trace, along with any attachments set on the scope. Feedback from a session therefore lands on the same trace as that session's errors. The SDK deliberately leaves off breadcrumbs, modules, and stack traces.

Feedback does **not** go through `before_send`. To filter or enrich it, use [`before_send_feedback`](https://docs.sentry.io/platforms/native/configuration/options.md#before_send_feedback).

### [Attaching Files to Feedback](https://docs.sentry.io/platforms/native/user-feedback.md#attaching-files-to-feedback)

Use a hint to send files alongside a single feedback, such as a screenshot or a diagnostic log the user agreed to share:

```c
sentry_hint_t *hint = sentry_hint_new();
sentry_hint_attach_file(hint, "/var/log/last-session.log");

// Takes ownership of both the feedback and the hint.
sentry_capture_feedback_with_hint(user_feedback, hint);
```

### [Capturing Feedback With a Scope](https://docs.sentry.io/platforms/native/user-feedback.md#capturing-feedback-with-a-scope)

Available since: `v0.16.0`

`sentry_scope_capture_feedback()` applies a scope on top of the global scope, so tags and other context stay on that one feedback. It takes the same hint as `sentry_capture_feedback_with_hint()` and returns the feedback event ID.

```c
sentry_scope_t *scope = sentry_local_scope_new();
sentry_scope_set_tag(scope, "feedback.source", "diagnostics-export");

sentry_uuid_t feedback_id
    = sentry_scope_capture_feedback(scope, user_feedback, hint);
```

Pass `NULL` for the hint when there's nothing to attach. The scope constructor determines who frees the scope; see [Scopes](https://docs.sentry.io/platforms/native/enriching-events/scopes.md#creating-a-scope).
