> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# observed_states

# `prefect.server.api.observed_states`

Routes for discovering observed state types and names.

## Functions

### `read_observed_states` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/observed\_states.py#L18](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/observed_states.py#L18)</sup>

```python theme={null}
read_observed_states(db: Annotated[PrefectDBInterface, Depends(provide_database_interface)], query: Annotated[str | None, Query(max_length=100)] = None, order_by: ObservedStateSort = ObservedStateSort.LAST_SEEN_DESC, limit: Annotated[int, Query(ge=1, le=200)] = 200) -> list[ObservedState]
```

Discover exact state names and types from retained run transitions.

Search by case-insensitive name or type prefix. Timestamps describe retained
history; deleting runs can change them or remove a state from the results.
