# Feedback

> POST /feedback tells us whether a solve's result worked on the site.

Source: https://docs.peak.fo/docs/api/feedback

`POST https://api.peak.fo/feedback`

Tells us whether the token or cookies from a solve worked on the site. Reports go to the Peak Solutions team, who use them to find and fix problems with a site or a solver. They don't change your balance.

Every solve that was tried returns a `task_id`. Send it back here within 24 hours, from any key on the same account. A later report on the same solve replaces the earlier one.

## Request [#request]

| Header         | Value              |
| -------------- | ------------------ |
| `X-API-Key`    | Your API key.      |
| `Content-Type` | `application/json` |

| Field     | Type      | Required | Description                                                         |
| --------- | --------- | -------- | ------------------------------------------------------------------- |
| `task_id` | `string`  | Yes      | The `task_id` from the [`/solve`](/docs/api/solve#response) response. |
| `correct` | `boolean` | Yes      | `false` if the result didn't work on the site, `true` if it did.    |
| `reason`  | `string`  | No       | What happened, such as the site's response. Up to 500 characters.   |

```bash title="Terminal"
curl https://api.peak.fo/feedback \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "task_id": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90",
    "correct": false,
    "reason": "login returned 403 with the token"
  }'
```

## Response [#response]

```json tab="Saved"
{
  "success": true
}
```

```json tab="Not found"
{
  "success": false,
  "error": "Task not found",
  "error_code": "task_not_found"
}
```

## Errors [#errors]

| `error_code`           | HTTP  | What to do                                                                                                   |
| ---------------------- | ----- | ------------------------------------------------------------------------------------------------------------ |
| `missing_fields`       | `400` | Send both `task_id` and `correct`.                                                                           |
| `invalid_request_body` | `400` | Send valid JSON.                                                                                             |
| `task_not_found`       | `404` | Check the `task_id`. It must be from your account and under 24 hours old. A solve from the last few seconds may not be found yet: retry shortly. |
| `rate_limited`         | `429` | Reports count toward your key's [rate limit](/docs/api#rate-limits). Wait for `Retry-After`, then retry.     |

A package key that has expired or run out can still report on the solves it paid for. For authentication errors, see [Balance](/docs/api/balance#errors).
