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

# Tribunal Constitucional

> Search every resolution Peru's Constitutional Court has published since 1996, sentencias, autos and interlocutory sentencias, and read any one's full text.

The Tribunal Constitucional del Perú has published more than 150,000 resolutions since 1996: sentencias, autos and sentencias interlocutorias in amparo, hábeas corpus, hábeas data, cumplimiento, inconstitucionalidad and competencial proceedings. Each one here comes with its full text, the case file number, the kind of proceeding, the chamber, the publication date, and a link to the document on the court's own site.

Search across all of them at once, by kind of resolution, kind of proceeding, chamber, case file, year or date, or with free text that reaches into the body of every resolution.

<Note>
  The whole source, organized and ready to query: every endpoint on this page answers in milliseconds. Every response carries `as_of`: how current the data is. [How datasets work](/datasets).
</Note>

## Search the resolutions

`POST /pe/tribunal-constitucional/rulings-search/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

One search over the full text of every resolution since 1996, filtered by kind, proceeding, chamber, case file, year or date.

| Field                 | Type    | Notes                                                                                                                                                                                              |
| --------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`               | string  | Optional words matched against the case file number, the resolution number and the full text.                                                                                                      |
| `type`                | enum    | Optional kind of resolution: `sentencia`, `auto` (autos and decretos) or `sentencia_interlocutoria`.                                                                                               |
| `proceeding_type`     | string  | Optional kind of proceeding, by code or name: `AA` (amparo), `HC` (hábeas corpus), `HD` (hábeas data), `AC` (cumplimiento), `AI` or `PI` (inconstitucionalidad), `CC` (competencial), `Q` (queja). |
| `chamber`             | string  | Optional chamber: `Pleno`, `Sala Primera` or `Sala Segunda`. Case and accents are ignored.                                                                                                         |
| `registration_number` | string  | Optional case file number (expediente) as the court writes it, e.g. `05005-2025-HC`. Returns every document of that case. Case and spaces are ignored.                                             |
| `year`                | integer | Optional year of publication. 0 searches every year. Default `0`.                                                                                                                                  |
| `from_date`           | string  | Optional: only resolutions published on or after this date, `yyyy-mm-dd`.                                                                                                                          |
| `to_date`             | string  | Optional: only resolutions published on or before this date, `yyyy-mm-dd`.                                                                                                                         |
| `page`                | integer | 1-based page number. Default `1`.                                                                                                                                                                  |
| `per_page`            | integer | Results per page (1-50). Default `20`.                                                                                                                                                             |

```bash theme={"dark"}
curl https://api.croma.run/pe/tribunal-constitucional/rulings-search/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "debido proceso", "proceeding_type": "HC" }'
```

Returns `as_of` (how current the data is), the applied filters, `total` (matches across every page), `page`, `per_page`, `total_pages`, `count` and `results[]`, most recently published first. Every result carries `id` (the document's permanent identifier, e.g. `2026/05005-2025-HC.pdf`), `registration_number` (the expediente), `proceeding_type_code` and `proceeding_type` (e.g. `HC`, `Hábeas corpus`), `type` (`sentencia`, `auto` or `sentencia_interlocutoria`), `number` (the resolution number of a sentencia, e.g. `181/2026`), `publication_date`, `year`, `chamber` (`Pleno`, `Sala Primera` or `Sala Segunda`), `judicial_district`, `case_id`, `text_status` (`ok`, `scanned` or `missing`), `official_url` (the document on the court's own site) and `case_url` (the case's page there).

<Note>
  Search results leave out the text: a single resolution can run to hundreds of thousands of characters. `query` still matches against it, so a phrase from the body finds the resolution; read the text itself with the Tribunal Constitucional Ruling endpoint.
</Note>

## One resolution, in full

`POST /pe/tribunal-constitucional/ruling/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

| Field       | Type    | Notes                                                                                                           |
| ----------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| `ruling_id` | string  | **Required.** The resolution's `id` from a search result, e.g. `2026/05005-2025-HC.pdf`, or its `official_url`. |
| `offset`    | integer | First character of the text to return. Pass the previous response's `next_offset` to read on. Default `0`.      |
| `limit`     | integer | How many characters of the text to return. Most resolutions fit in one response. Default `200000`.              |

```bash theme={"dark"}
curl https://api.croma.run/pe/tribunal-constitucional/ruling/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ruling_id": "2026/05005-2025-HC.pdf" }'
```

Returns `as_of`, `found`, `ruling_id` and `ruling`, which carries everything the search returns plus `content`: a window onto the resolution's full text, with `text`, `offset`, `total_length`, `has_more` and `next_offset`. Every result carries `id` (the document's permanent identifier, e.g. `2026/05005-2025-HC.pdf`), `registration_number` (the expediente), `proceeding_type_code` and `proceeding_type` (e.g. `HC`, `Hábeas corpus`), `type` (`sentencia`, `auto` or `sentencia_interlocutoria`), `number` (the resolution number of a sentencia, e.g. `181/2026`), `publication_date`, `year`, `chamber` (`Pleno`, `Sala Primera` or `Sala Segunda`), `judicial_district`, `case_id`, `text_status` (`ok`, `scanned` or `missing`), `official_url` (the document on the court's own site) and `case_url` (the case's page there).

<Note>
  Long resolutions are read a range at a time: send `offset` and `limit`, then pass the response's `next_offset` back as `offset` until `has_more` is false. `content` is null when `text_status` is `scanned` (the court published the resolution as an image) or `missing`; `official_url` still links the document.
</Note>

<Note>
  An `id` the court has not published returns `found: false` with HTTP 200, not an error.
</Note>

<Card title="Full reference" icon="code" href="/api-reference/overview">
  Schemas, all response fields, and an interactive playground.
</Card>
