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

# Contraloría General de la República

> The dictámenes of Chile's Contraloría: search about 158,000 administrative-law opinions since 1949, and read any one in full with its status and the dictámenes it acts on.

The Contraloría General de la República de Chile issues dictámenes, binding opinions on how public bodies must apply administrative law: civil servants' pay, leave and pensions, procurement, municipal powers, public works. Its jurisprudence is published since 1949, about 158,000 dictámenes. Each one here comes with its number, year and date, the subject it decides, the Contraloría's descriptors and the legal sources it rests on, whether it sets or applies jurisprudence, its status flags (reconsidered, applied, clarified and the rest, which change when a later dictamen acts on it), the earlier dictámenes it acts on, who it is addressed to, the unit it comes from, its full text, and links to its page and its PDF at the Contraloría.

Search by number, year, date, criterion, status or the dictamen a later one acts on, or with free text that reaches into the subject and the body of every dictamen. Search first, then read one dictamen in full.

> [!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](https://docs.usecroma.com/datasets.md).

## Search the dictámenes

`POST /cl/contraloria-cl/dictamenes-search/v1` [Dataset](https://docs.usecroma.com/datasets.md)

One search over every dictamen the Contraloría publishes since 1949, filtered by number, year, date, criterion, status or the dictamen a later one acts on.

| Field | Type | Notes |
| - | - | - |
| `query` | string | Optional words matched against the number, subject, descriptors, legal sources and full text, e.g. `pensión de retiro` or `feriado legal`. Every word must appear. |
| `number` | string | Optional dictamen number with its letter prefix when it has one, e.g. `428`, `E152884`. Leading zeros are ignored. Add `year` to name one dictamen. |
| `year` | integer | Optional year of the dictamen. 0 searches every year. Default `0`. |
| `from_date` | string | Optional: only dictámenes issued on or after this date, `yyyy-mm-dd`. |
| `to_date` | string | Optional: only dictámenes issued on or before this date, `yyyy-mm-dd`. |
| `criterion` | enum | Optional: `generates` (sets new jurisprudence) or `applies` (applies existing jurisprudence). |
| `status` | enum | Optional status flag: `new`, `applied`, `reconsidered`, `partially_reconsidered`, `clarified`, `altered`, `confirmed`, `complemented` or `reactivated`. |
| `references` | string | Optional dictamen `id`, e.g. `022127N09`: only the dictámenes that act on it. |
| `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/cl/contraloria-cl/dictamenes-search/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "pensión de retiro", "criterion": "generates" }'
```

Returns `as_of` (how current the data is), the applied filters, `total` and `total_is_exact`, `page`, `per_page`, `total_pages`, `count` and `results[]`, most recent dictamen first. Every result carries `id` (the dictamen's permanent id, e.g. `E152884N21`), `number` (as the Contraloría cites it, e.g. `E152884`) and `year`, `issued_date`, `subject` (the materia), `descriptors`, `legal_sources`, `criterion` (`generates` or `applies` jurisprudence), `statuses` and `status_flags` (`new`, `applied`, `reconsidered`, `partially_reconsidered`, `clarified`, `altered`, `confirmed`, `complemented`, `reactivated`), `related` (the earlier dictámenes it acts on, each with its `action`, `dictamen_id`, `number` and `year`) and `action_text` (the Contraloría's own sentence on them), `recipients`, `attorneys`, `origin` and `origins` (the Contraloría's unit), `character`, `protection_appeal`, `topic`, `relevant`, `bulletin`, `official_url` (the dictamen's page at the Contraloría), `source_document_url` (its PDF at the Contraloría) and `document_url` (always null: the Contraloría publishes the dictamen as text, and the text is here). Fields the Contraloría does not state are null.

> [!NOTE]
>
> Search results leave out the text. `query` still matches against it, so a phrase from the body finds the dictamen; read the text itself with the Contraloría Chile Dictamen endpoint.

> [!NOTE]
>
> The status flags change when a later dictamen applies, reconsiders or clarifies an earlier one. Croma reads the dictámenes each new one acts on again the day it appears, and the whole collection once a month.

## One dictamen, in full

`POST /cl/contraloria-cl/dictamen/v1` [Dataset](https://docs.usecroma.com/datasets.md)

| Field | Type | Notes |
| - | - | - |
| `dictamen_id` | string | **Required.** The dictamen's `id` from a search result, e.g. `E152884N21`, its `official_url`, or its number and year, e.g. `E152884/2021`. |
| `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. Almost every dictamen fits in one response. Default `200000`. |

```bash theme={"dark"}
curl https://api.croma.run/cl/contraloria-cl/dictamen/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "dictamen_id": "E152884N21" }'
```

Returns `as_of`, `found`, `dictamen_id` and `dictamen`, which carries everything the search returns plus `content` (a window onto the full text, with `text`, `offset`, `total_length`, `has_more` and `next_offset`) and `referenced_by` (the later dictámenes that act on this one, each with its `id`, `number`, `year`, `issued_date` and `actions`, newest first). Every result carries `id` (the dictamen's permanent id, e.g. `E152884N21`), `number` (as the Contraloría cites it, e.g. `E152884`) and `year`, `issued_date`, `subject` (the materia), `descriptors`, `legal_sources`, `criterion` (`generates` or `applies` jurisprudence), `statuses` and `status_flags` (`new`, `applied`, `reconsidered`, `partially_reconsidered`, `clarified`, `altered`, `confirmed`, `complemented`, `reactivated`), `related` (the earlier dictámenes it acts on, each with its `action`, `dictamen_id`, `number` and `year`) and `action_text` (the Contraloría's own sentence on them), `recipients`, `attorneys`, `origin` and `origins` (the Contraloría's unit), `character`, `protection_appeal`, `topic`, `relevant`, `bulletin`, `official_url` (the dictamen's page at the Contraloría), `source_document_url` (its PDF at the Contraloría) and `document_url` (always null: the Contraloría publishes the dictamen as text, and the text is here). Fields the Contraloría does not state are null.

> [!NOTE]
>
> Long dictámenes 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.

> [!NOTE]
>
> An id the Contraloría has not published returns `found: false` with HTTP 200, not an error.

> **[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.