# INVALID_REQUEST

> HTTP 400. The request was malformed: a field is missing, has the wrong type or format, or the values contradict each other (for example from and to naming the same asset).

The request was malformed: a field is missing, has the wrong type or format, or the values
contradict each other (for example `from` and `to` naming the same asset).


Every endpoint validates its body, query and path against the schema in `/v0/openapi.json` before
it does anything, so nothing was created, quoted or charged. `details.field` names the first
offending field, and `details.issues` lists every problem the validator found.

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Request validation failed",
    "details": { "field": "amount", "issues": [{ "path": ["amount"], "message": "Required" }] }
  }
}
```

A protocol that rejects the request's values during a quote can also report this code, for that
protocol only, in the quote response's `errors`.

## What to do

- Fix the field `details.field` names and send the request again. The message is written for a
  person, so it is safe to log.
- Amounts are integer strings in base units (`"1000000"` for 1 USDC), never decimals or numbers.
- Build requests with `@intents-fi/sdk`, whose types are generated from the same OpenAPI document,
  and most of these never reach the API.


## Example response

```json
{ "error": { "code": "INVALID_REQUEST", "message": "…" } }
```

---

Source: https://intents.fi/docs/errors/INVALID_REQUEST · The whole corpus: https://intents.fi/docs/llms-full.txt
