# Send your first feedback in 5 minutes

One POST. No SDK, no API key. Works from any language, any platform.

## Step 1: Get your clientId

Your clientId identifies your project. It starts with `client_`.

- Logged in? Every snippet on this page already shows your real clientId.
- No account yet? [Sign up free](/signup) and your clientId is on the first screen. Until then, snippets show the placeholder
  `YOUR_CLIENT_ID`, swap it for your own before sending.

More detail: [Find your clientId](/docs/find-your-client-id).

## Step 2: Send a POST

```bash title=curl
curl -X POST https://usero.io/api/feedback \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "YOUR_CLIENT_ID",
    "rating": 4,
    "comment": "First feedback from the quickstart"
  }'
```

```javascript title=JavaScript
const res = await fetch('https://usero.io/api/feedback', {
	method: 'POST',
	headers: { 'Content-Type': 'application/json' },
	body: JSON.stringify({
		clientId: 'YOUR_CLIENT_ID',
		rating: 4,
		comment: 'First feedback from the quickstart',
	}),
})
console.log(await res.json()) // { success: true, feedbackId: "..." }
```

```swift title=Swift
var request = URLRequest(url: URL(string: "https://usero.io/api/feedback")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONSerialization.data(withJSONObject: [
    "clientId": "YOUR_CLIENT_ID",
    "rating": 4,
    "comment": "First feedback from my Mac app",
])
let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8)!) // {"success":true,"feedbackId":"..."}
```

```python title=Python
import requests

res = requests.post(
    "https://usero.io/api/feedback",
    json={
        "clientId": "YOUR_CLIENT_ID",
        "rating": 4,
        "comment": "First feedback from the quickstart",
    },
)
print(res.json())  # {'success': True, 'feedbackId': '...'}
```

A successful response is:

```json
{ "success": true, "feedbackId": "abc123" }
```

`rating` is 1 to 4 (1 Terrible, 2 Bad, 3 Good, 4 Amazing). Every submission needs a `rating`, a non-empty `comment`, or both. Full
field list: [POST /api/feedback reference](/docs/api/feedback).

> [!WARNING] **Omit `environment` for your default environment.** Do not send a placeholder like `"no-env"` or `"default"`. The
> dashboard treats an absent environment as the default; a literal placeholder string creates a separate environment and your
> feedback will not appear in the default inbox.

## Step 3: See it land

Open your [dashboard](/) and check the feedback inbox. Your POST shows up within a second or two. If you sent an `environment`
value, switch the environment picker to that value to see it.

<!-- usero:see-it-land -->

## Or let your coding agent do it

Paste this prompt into Cursor, Claude Code, or any coding agent and it will build a feedback form wired to your account.

```text title=Agent prompt
# Task: Add Feedback Collection to This Project

Build a feedback UI that submits to Usero's API. The goal is to collect user satisfaction ratings and optional comments.

## What to build
A feedback form or prompt with:
- A 4-level rating (1 = Terrible, 2 = Bad, 3 = Good, 4 = Amazing)
- An optional comment text field
- A submit button that POSTs to the Usero API

## API Details
POST https://usero.io/api/feedback
Content-Type: application/json

### Request body
{
  "clientId": "YOUR_CLIENT_ID",   // required — your client ID
  "rating": 3,                      // required — 1 to 4
  "comment": "User's feedback",     // optional
  "environment": "production",      // optional — helps filter by env in dashboard
  "pageUrl": "https://...",         // optional — auto-detect from window.location
  "pageTitle": "...",               // optional — auto-detect from document.title
  "userEmail": "user@example.com"   // optional
}

### Response
200: { "success": true, "feedbackId": "abc123" }

## Working example
curl -X POST https://usero.io/api/feedback \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "YOUR_CLIENT_ID",
    "rating": 3,
    "comment": "Love the new dashboard!",
    "pageUrl": "https://yourapp.com/page",
    "environment": "production"
  }'

## Tips
- Auto-detect pageUrl and pageTitle from the browser so you get per-page feedback tracking.
- Set environment to distinguish production feedback from staging/dev.
- Show a success message after submission. Only clientId and rating are required.
```

## Next steps

- [POST /api/feedback reference](/docs/api/feedback): every field, response shape, and error code
- [Screenshot uploads](/docs/api/screenshots): attach images to feedback
- [Drop-in widget](/docs/widget): React, vanilla JS, or a script tag, no form to build
- [Integrations](/docs/integrations): GitHub, Slack, email, WordPress, and more
