# INVALID_LASTN

Canonical page: https://docs.ovok.com/errors/invalid-lastn

**HTTP 400.** Problem type: [`https://docs.ovok.com/errors/invalid-lastn`](https://docs.ovok.com/errors/invalid-lastn).

## What this means [#what-this-means]

`Observation/$lastn` refused the request before it read any data, because a parameter is missing, out of range or in conflict with another. `detail` names the parameter and the rule.

## Troubleshooting [#troubleshooting]

1. Say what to find. Send at least one `code` or `category`, as repeated or comma-separated values. A request names at most 50 codes.
2. Name exactly one patient with `patient` or `subject`, as `Patient/123` or the bare ID `123`. A patient session may leave it out and reads its own record. Every other caller must name one.
3. Set `max` to a whole number from 1 to 1000. It is the number of newest Observations per code, and it defaults to 1.
4. Set `withAlerts` to `true` or `false`, and nothing else.

## Retry safely [#retry-safely]

Fix the parameter and send the request again. The same request is refused again. It was refused before any read, and `$lastn` only reads, so nothing changed.

## If the problem persists [#if-the-problem-persists]

Share the HTTP status, problem `type`, request path, response timestamp and `traceId` with your administrator or support contact. Remove access tokens, provider secrets and patient data first. The [Error responses guide](/errors) explains the response fields, and the [machine-code registry](/errors/machine-codes) lists every endpoint-specific type.
