---
title: "MGS9023: invalid request"
description: A request to an /api/ route carried something the route cannot act on, such as a body that does not parse, a missing parameter or a name it does not know. Answered 400, or 413 and 422 where those name the refusal better.
tags: [MGS9023, api, request, validation, "400", "413", "422"]
---

# MGS9023: invalid request

The server answered `400 invalid argument` because the route could not act on
what the request carried. The message names the field or value to change.

```text
[MGS9023] unknown target "biuld"; run `magus describe targets` to list them
  see: .../MGS9023.md
```

## Why

Each `/api/v1/` route validates before it reads anything. The refusals share
this code because they share one fix, changing the request:

- **A body that does not parse.** The route takes JSON of one shape, and the
  message names it.
- **A missing or malformed parameter.** A path, a line range, a snapshot
  identity, a lens depth.
- **A name the workspace does not have.** A target, a figure focus, an op.
- **A file the route will not serve.** A path that escapes the workspace, is not
  a regular file, or is over the 1 MiB context cap (`413`).
- **A figure too large to draw.** The figure module refused it, and its own text
  names the lens to narrow (`422`).

## Resolution

Change the request as the message says and send it again. A route that names a
target points to `magus describe targets` for the list.

## What this is not

- **Not a state conflict.** A well-formed request that contradicts current state
  is [MGS9025](MGS9025.md).
- **Not a missing thing.** A well-formed request naming something the server
  does not hold is [MGS9024](MGS9024.md).
- **Not a token or share request.** Those are [MGS9021](MGS9021.md) and
  [MGS9020](MGS9020.md).
