# SEARCH_REFUSED

Canonical page: https://docs.ovok.com/errors/search-refused

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

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

The FHIR store refused one of the searches that `Observation/$lastn` runs. `$lastn` passes every parameter it does not own to each search, so one parameter the store does not know, or one value it cannot read, refuses the whole request. `status` is the store's own: usually 400, but 403 or 404 when you cannot read the patient.

## Troubleshooting [#troubleshooting]

1. Read `detail`. It quotes the store's reason, such as an unknown search parameter or a value in the wrong format.
2. Check the extra parameters you send. Remove any that Observation does not define, and fix the values. Dates, tokens such as `system|code`, and quantity prefixes must follow the FHIR search rules.
3. Check the patient when `status` is 403 or 404. The patient may not exist, or may be outside your project or access. Use a patient ID from your project, from an account that can read it.

## Retry safely [#retry-safely]

Fix the search and send it again. The same search is refused again. `$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.
