# Query Behavior

API v2.1 supports flexible query parameters so you can filter and retrieve exactly the records you need.

## Filtering

You can retrieve resources, documents, and dockets associated with a specific case by including the case parameter in your request. You may also retreive dockets via their RECAP ID. For example:

* **Filter cases by type:** `/api/v2p1/cases/?case_type=5039`
* **Filter resources associated with a specific case:** `/api/v2p1/cases/11085/resources`
* **Filter dockets associated with a specific case:** `/api/v2p1/cases/11085/dockets`
* **Filter dockets associated with a recap\_id:** `/api/v2p1/dockets/?recap_id=72085714`
* **Filter documents associated with a specific case:** `/api/v2p1/cases/11085/documents`

{% hint style="warning" %}
You cannot filter `document`, `resources`, and `dockets` without specifying a case (with the exception of searching for recap\_id via dockets. See note above.)

**For example:** `/api/v2p1/documents/?document_status=Approved` Will return

```
{
  "detail": "Not found."
}
```

{% endhint %}

When accessing the URL endpoints for resources, documents, or dockets, please refer to these pages for detailed response examples:

* [Documents](/api-reference-v2p1/objects/document.md)
* [Resources](/api-reference-v2p1/objects/resource.md)
* [Dockets](/api-reference-v2p1/objects/docket.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.clearinghouse.net/api-reference-v2p1/new-features/query-behavior.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
