# New Features

CRCLA V2.1 introduces several improvements designed to make the API faster and more scalable.

## Key Highlights

* **Improved Performance:** Endpoints now return lighter responses by moving large related datasets to paginated URLs.
* **Versioning:** All v2.1 endpoints are available under the `/api/v2p1/` namespace.
* **Hyperlinked Relationships:** Instead of embedding large nested arrays, related records are now referenced by hyperlinks you can query separately.

***

## Changes to Related Endpoints

To speed up queries and improve response times, three fields that previously returned all records inline have been updated to provide paginated URLs instead.

| Field                | Type         | Documentation Link                                                                                     |
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------ |
| `case_documents_url` | string (URL) | [#case\_documents\_url](https://api.clearinghouse.net/objects/case/pagination-urls#case_documents_url) |
| `case_dockets_url`   | string (URL) | [#case\_dockets\_url](https://api.clearinghouse.net/objects/case/pagination-urls#case_dockets_url)     |
| `case_resources_url` | string (URL) | [#case\_resources\_url](https://api.clearinghouse.net/objects/case/pagination-urls#case_resources_url) |

These fields now return a link you can follow to retrieve related records in a paginated format.

To learn more about pagination behavior, see [Pagination](https://api.clearinghouse.net/api-reference-v2p1/new-features/pagination).

### Removed Fields

As part of this change, a few fields that previously contained large serialized data has been removed and replaced by the URL fields listed above:

* `case_documents`
* `case_dockets`
* `case_resources`

If your integration relied on these fields, you will now need to follow the corresponding URL to retrieve related records.

***

### Query Related Records Directly

In addition to using the `*_url` fields returned in each `Case` object, you can also **query related records directly by filtering on the `case` parameter**.

This allows you to retrieve all related resources for a case without relying only on hyperlinks.

#### Examples

* Retrieve all resources for a specific case: `/api/v2p1/resources/?case=15150`
* Retrieve all documents for a specific case: `/api/v2p1/documents/?case=15150`
* Retrieve all dockets for a specific case: `/api/v2p1/dockets/?case=15150`

To learn more about query behavior, see [Query Behavior](https://api.clearinghouse.net/api-reference-v2p1/new-features/query-behavior).

***

### Accessing Extracted Text from Documents

The documents endpoint returns a paginated list of document objects in results. Each document object now includes new `has_text` and `text_url` fields that provide access to extracted document text (OCR or transcription), when available.

To learn more about these fields, see [text-url](https://api.clearinghouse.net/api-reference-v2p1/objects/document/text-url "mention")
