> ## 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.

# CJF Sentencias

> Full-text search over the public-version rulings of Mexico's federal courts, the full record of any case by its NEUN, and each ruling's document and text.

Mexico's federal judiciary publishes public versions of its rulings. Search
them by full text, with four match modes (exact phrase, at least one word,
except a word, or a range of words apart) and optional date bounds, and pull
any ruling's record by its NEUN: issuing court, subject matter, topic and
summary, and the record section by section.

## Search rulings

`POST /mx/cjf-sentencias/search/v1` [Live](https://docs.usecroma.com/live-lookups.md)

| Field | Type | Notes |
| - | - | - |
| `query` | string | **Required.** Words or a phrase to search for in the rulings' text and summaries. |
| `match_mode` | enum | How to match: `exact_phrase`, `any_word`, `except_word` or `word_range`. Default `exact_phrase`. |
| `word_range` | integer | For `word_range`: how many words apart the terms may be (1-100). Default `1`. |
| `from_date` | string | Only rulings on or after this date (yyyy-mm-dd). |
| `to_date` | string | Only rulings on or before this date (yyyy-mm-dd). |
| `page` | integer | 1-based page number. Default `1`. |
| `per_page` | integer | Cases per page (1-50). A case with several rulings returns one result per ruling, so a page can hold more results than this. Default `20`. |

```bash theme={"dark"}
curl https://api.croma.run/mx/cjf-sentencias/search/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "amparo" }'
```

Returns `query`, `match_mode`, the applied date bounds, `results`, and `pagination` (`total`, `page`, `page_size`, `total_pages`).

| Field | Notes |
| - | - |
| `neun` | The id of the ruling's case; rulings of the same case share it. Pass it to `cjf-sentencia` for the full record. |
| `ruling_id` | The id of this one ruling. Pass it to the ruling endpoint for its document and text. |
| `case_number` | Expediente number. |
| `court`, `court_type`, `circuit`, `specialty` | The issuing court and where it sits. |
| `subject_matter`, `case_type` | Materia and tipo de asunto. |
| `ruling_date` | The ruling date as published (kept verbatim). |
| `topic`, `summary` | Tema and síntesis of the ruling. |
| `has_document` | Whether a public-version document is on file. |

## Ruling detail

`POST /mx/cjf-sentencias/sentencia/v1` [Live](https://docs.usecroma.com/live-lookups.md)

| Field | Type | Notes |
| - | - | - |
| `neun` | string | **Required.** The `neun` from the search above. |

```bash theme={"dark"}
curl https://api.croma.run/mx/cjf-sentencias/sentencia/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "neun": "11675036" }'
```

Returns `found`, `restricted`, `neun`, and `sentencia` (null when the NEUN is unknown). `restricted` is true when the source withholds the case's record for legal reasons, as it does for some criminal matters; its rulings can still be read one by one by `ruling_id`.

| Field | Notes |
| - | - |
| `case_number` | Expediente number. |
| `internal_number` | Número OCC, the court's internal control number. |
| `court`, `case_type` | Issuing court and tipo de asunto. |
| `sections` | The ruling record section by section; each section is a list of label/value rows as the source presents them. |
| `rulings`, `rulings_total` | The rulings published in the case (up to 200), each with its `ruling_id`, `entered_date`, `topic` and `has_document`. |

## Ruling document and text

`POST /mx/cjf-sentencias/ruling/v1` [Live](https://docs.usecroma.com/live-lookups.md)

| Field | Type | Notes |
| - | - | - |
| `ruling_id` | string | **Required.** The `ruling_id` from the search or from the case record's `rulings`. |
| `query` | string | Words or a phrase to locate in the ruling's text. Each place it appears comes back in `matches`. |
| `offset` | integer | First character of the text to return. Pass the previous `next_offset` to read on. Default `0`. |
| `limit` | integer | Maximum characters of text to return (1000-1000000). Default `200000`. |

```bash theme={"dark"}
curl https://api.croma.run/mx/cjf-sentencias/ruling/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ruling_id": "27146301-89-85", "query": "arrendamiento financiero" }'
```

Returns `found`, `ruling_id`, `query`, and `ruling` (null when the source has no document for the ruling).

| Field | Notes |
| - | - |
| `title`, `case_number`, `court`, `case_type`, `entered_date`, `topic` | What the case says of the ruling. Null when the source withholds the case's record. |
| `document_url` | Croma's copy of the public-version document, byte for byte. |
| `source_document_url` | The document's own link at the source. |
| `viewer_url` | Opens the document in Croma Viewer, for a signed-in Croma user. |
| `text_url`, `text_length` | The ruling's whole text as one file, and its length. The electronic-signature evidence the source appends after the ruling is left out. |
| `content` | The range of the text asked for with `offset` and `limit`; pass `next_offset` back as `offset` to read on. |
| `matches`, `matches_total` | Where the words in `query` appear in the text, at most 10, each with `text`, `start`, `end` and a `viewer_url` that opens the document on that passage, highlighted. |

The first request for a ruling reads its document from the source and keeps it; later requests are answered from Croma's copy.

> [!NOTE]
>
> These are public-version rulings (versiones públicas) of Mexico's federal
> courts: personal data is redacted by the publisher before release.

> [!NOTE]
>
> These lookups can take longer than a typical request. They are
> [async jobs](https://docs.usecroma.com/async-jobs.md). By default the request waits inline and returns
> `{ data }`, or you can poll / use a `callback_url`.

> [card] [Full reference](https://docs.usecroma.com/api-reference/overview.md)
>
> Schemas, all response fields, and an interactive playground.


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