<!-- source: https://www.secondlayer.tools/docs/report-a-problem -->

# Report a Problem

Send one line on what you were trying to do, with the `request_id` of a failed call, and the server attaches its own record of that call.

```bash wrap
curl -X POST "$SECONDLAYER_API_URL/v1/feedback" \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"request_id":"req_3f9a1c0b7d2e4a6f8b1c2d3e","intent":"list aeUSDC swaps for one sender since block 165000"}'
```

## Fields

| Optional field | Holds |
| --- | --- |
| `kind_hint` | `missing_capability`, `bug`, `schema_gap`, `docs_mismatch` or `perf` |
| `expected` | What you wanted back, as a sentence or JSON |
| `evidence` | An object with only `tx_id`, `block_height`, `contract_id`, `event_type`, `subgraph`, `table` |

- The server keeps its record of the call for 24 hours.
- Any other field is a `400` naming the allowed ones.
- An `Idempotency-Key` header makes retries safe.
- Every JSON error carries `request_id` and `feedback.url`: [Cursors and Pages](https://www.secondlayer.tools/docs/cursors.md#errors).

## Read next

- [Cursors and Pages](https://www.secondlayer.tools/docs/cursors.md)

## Notes for agents

- On any failed call, POST /v1/feedback with the request_id from the error and a one-line intent. Fields beyond request_id, intent, kind_hint, expected, evidence are a 400.
- The server's record of the call lives 24 hours: report promptly. Send an Idempotency-Key when retrying.

## Setup

Ensure setup once, skipping any step already done:
- CLI: `bun add -g @secondlayer/cli`
- Instance: `secondlayer init` writes `INSTANCE_TOKEN`. Loopback `/v1` reads need no key.
- Hosted reads: export `SECONDLAYER_API_KEY` (`sk-sl_*`) or buy credits with `secondlayer credits buy` (`balance`, `refill`), then `secondlayer whoami`
