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

# Announcing Litigation & Bankruptcy Search

> March 4, 2024

Users can now use the `business_id` of any business to initiate a search for litigations & bankruptcies using our new APIs!

## 1) Initial Docket Search

[To start a litigation & bankruptcy search](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/start-docket-search.md), simply make a `POST` request to `/docket_searches` using the business's UUID.  We will search for and return up to 50 recent Litigations & Bankruptcies.   Additionally, we often find Trademarks and Patent Application history.

After initializing the search, we emit a `DocketSearch.submitted` webhook event. to indicate that a Litigation & Bankruptcy search has commenced.  Upon completion, we emit a `DocketSearch.completed` webhook event.

In addition to the webhooks, one can also retrieve all Litigations and Bankruptcies through a variety of other methods:

* By `business_id`
  * Litigations: `GET /businesses/\{business\_id}/litigations`
  * Bankruptcies: `GET /businesses/\{business\_id}/bankruptcies`
* By `search_request_id`
  * Litigations: `GET /docket\_searches/\{search\_request\_id}/litigations`
  * Bankruptcies: `GET /docket\_searches/\{search\_request\_id}/bankruptcies`
  * Both: [GET /docket\_searches/\{search\_request\_id}](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/get-all-dockets-by-search-request-id.md)

## 2) Retrieving Docket Details

After the initial dockets are retrieved, you may want to learn more about a specific docket, such as viewing docket case history.   To see details for a given docket, you must order them explicitly.  This can be done using the `docket_id` and ordering the details with [PUT /dockets/\{docket\_id}/details](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/order-docket-details.md).   The response from ordering docket details will return results from our cache by default.  However, if you wish to get the most up-to-date details, you will need to order docket details from the court system itself by setting the param `from_court` to `true`.

Initializing a request for docket details will emit a `DocketDetailsSearch.submitted` webhook event.  Once the search for docket details completes, a `DocketDetailsSearch.completed` webhook event will be emitted.

To retrieve the results, there are three options.  You can either:

* Retrieve the entire array of dockets using the one of the options in Part 1
* Use [GET /dockets/\{docket\_id}/details](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/get-docket-details.md) to retrieve the specifics for an individual `docket_id`.
* Or use [GET /docket\_searches/details/\{docket\_details\_request\_id}](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/get-docket-details-by-request-id.md) to retrieve the specifics for an individual docket by the docket details request id.

Docket details sometimes include documents which may or may not be available for download.  To retrieve a document with `is_available = False` you must also order the document explicitly from the court system.

If a docket exhibit is available `is_available = True` the document can downloaded using [GET /dockets/exhibits/\{docket\_exhibit\_id}](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/get-docket-exhibit-document.md)

## 3) Ordering from Court Directly

Both [PUT /dockets/\{docket\_id}/details](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/order-docket-details.md) and [PUT /dockets/exhibits/\{docket\_exhibit\_id}](https://docs.baselayer.com/api-reference/litigation-&-bankruptcy/order-docket-exhibit.md) allow you to order update for docket details and docket exhibits from the court system directly using the boolean parameter `from_court`.  Depending on the court system, this may involve extra PACER fees, which are passed through directly.

Smaller court systems often have fairly brittle APIs, so ordering from the court system directly can be prone to failure.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.