# Report whether one request worked

> Records a thumbs up or down on one of your own requests, keyed by the request id every response carries.

Source: https://docs.spicrawl.com/api-reference/feedback/feedback-create

## POST /v1/feedback

Operation ID: `feedbackCreate`. API key scope: `none`.

Records a thumbs up or down on one of your own requests, keyed by the request id every response
carries. Agents should send one report per task, with `intent`, when a request failed or the result
was wrong. Nothing is charged for it.

A new `down` report on a request that charged credits refunds those credits, in whole credits
rounded down, to the organization's balance, within a daily cap per organization (UTC day):
25 credits and 10 reports by default. The response says how much was refunded
(`credits_refunded`) and whether a cap held a refund back (`refund_cap_reached`). A repeat, an
`up` rating, a limit-refused request and another project's request are never refunded.

Reports are kept with a copy of the request's log fields, so they outlive the request log. The
console groups repeat failures by error code, engine and host.

One report per request and source: a second report on the same request answers 200 with
`already_submitted: true`. A request that failed with a rate or quota limit (`ERR::LIMIT::*`) is
refused with 409, since the fault is the limit, not the target.

The route accepts any API key and needs no scope. Free text is stored after API keys and bearer
tokens are removed.

### Example

```bash
curl -X POST "https://api.spicrawl.com/v1/feedback" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"request_id":"01M0FK1EP2E7FBMWAR7W10SMXW","rating":"down","kind":"broken","impact":"blocked","intent":"Get the price table from the product page","comment":"Page rendered empty; content loads after a cookie banner","agent":"claude-code/2.1"}'
```

### Request body

`application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `request_id` | string | yes | The request you are reporting on, from its `X-Request-Id` or the `request_id` of an error body. It must belong to this key's project, and be inside the retention window. |
| `rating` | string: `up`, `down` | yes | `up` if the result was right, `down` if it was not. |
| `kind` | string: `broken`, `wrong_result`, `missing`, `confusing`, `other` | no | What kind of problem it was. Optional. |
| `impact` | string: `blocked`, `worked_around`, `friction` | no | How much it cost you. Optional. |
| `intent` | string | no | What you were trying to do. Secrets (API keys, bearer tokens) are removed before storage. |
| `comment` | string | no | Free text. Secrets are removed before storage. |
| `agent` | string | no | Which agent or app is reporting. Defaults to the User-Agent of the request reported on. |
| `client` | object | no | Dashboard use only. Browser context, kept only when the User-Agent starts with `spicrawl-dashboard`; ignored otherwise. At most 4 KB as JSON. |

Example `broken`: A page that failed to render

```json
{
  "request_id": "01M0FK1EP2E7FBMWAR7W10SMXW",
  "rating": "down",
  "kind": "broken",
  "impact": "blocked",
  "intent": "Get the price table from the product page",
  "comment": "Page rendered empty; content loads after a cookie banner",
  "agent": "claude-code/2.1"
}
```

### Responses

#### 200

A report from this source already exists for this request. Nothing new was stored.

Headers: `X-Request-Id`.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `feedback_id` | string (uuid) | yes | The id of the stored report. |
| `already_submitted` | boolean | yes | `true` when this request already had a report from this source. The earlier report is kept; nothing new is stored. |
| `credits_refunded` | integer | yes | Whole credits returned to the organization's balance for this report, as a `refund` entry in the credit history. `0` when none. On a repeat (`already_submitted: true`) this is what the original report refunded. A refund is made only for a `down` rating on a request that charged at least one whole credit, within the daily caps (25 credits and 10 reports per organization per UTC day by default; the operator can change them). |
| `refund_cap_reached` | boolean | yes | `true` when a refund was due but the daily credit or report cap held it back, in whole or in part. |

#### 201

The report was stored.

Headers: `X-Request-Id`.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `feedback_id` | string (uuid) | yes | The id of the stored report. |
| `already_submitted` | boolean | yes | `true` when this request already had a report from this source. The earlier report is kept; nothing new is stored. |
| `credits_refunded` | integer | yes | Whole credits returned to the organization's balance for this report, as a `refund` entry in the credit history. `0` when none. On a repeat (`already_submitted: true`) this is what the original report refunded. A refund is made only for a `down` rating on a request that charged at least one whole credit, within the daily caps (25 credits and 10 reports per organization per UTC day by default; the operator can change them). |
| `refund_cap_reached` | boolean | yes | `true` when a refund was due but the daily credit or report cap held it back, in whole or in part. |

#### 400

The request is invalid. Not retryable; fix the request using `code` and `diagnostics.hint`.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 404

`ERR::REQUEST::NOT_FOUND`: no such request in this key's project, or it has passed the retention window. Not retryable.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 409

`ERR::REQUEST::CONFLICT`: the request failed with a rate or quota limit (`ERR::LIMIT::*`). Feedback is not accepted for it. Not retryable.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 429

`ERR::LIMIT::RATE_LIMITED`: more than 100 reports in the current hour for this key. The `detail` says do not retry this report. Not retryable.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
