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

# Corte Suprema de Justicia

> Search the jurisprudencia the Corte Suprema de Justicia de El Salvador publishes, about 200,000 resolutions since 1951 from the Corte Plena and the Salas to the Cámaras, Tribunales de Sentencia and Juzgados, and every law, decree, regulation and ordinance it keeps, consolidated with its amendments; read any one in full.

The Corte Suprema de Justicia de El Salvador publishes the jurisprudencia of the country's courts: about 200,000 resolutions since 1951 from the Corte Plena, the Salas de lo Constitucional, Civil, Penal and Contencioso Administrativo, the second-instance Cámaras, the Tribunales de Sentencia and a set of Juzgados. Each one here comes with its full text, the reference number, the court, the area of law, the kind of proceeding and of resolution, the decision, the crimes in criminal matters, the headnotes the court's documentation center wrote, the original document as the court published it, and links to the record and the document on the court's own site.

Search across all of them at once, by court or level of court, area of law, kind of proceeding or resolution, crime, reference number, year or date, or with free text that reaches into the body of every resolution.

The same documentation center keeps El Salvador's legislation: more than 10,000 legal texts published in the Diario Oficial since 1821, from the Constitution's amendments, the codes and the laws to executive decrees, regulations, agreements and municipal ordinances. Each comes with its consolidated text, whether it is in force, every amendment with its act and its own text, the rulings related to it, and every version of its document: the court rewrites a consolidated text when it incorporates an amendment, and each version stays available here.

<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 /sv/csj-sv/rulings-search/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

One search over the full text of every resolution since 1951, filtered by court, area of law, proceeding, kind of resolution, crime, reference number, year or date.

| Field                 | Type    | Notes                                                                                                                                                                                                |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`               | string  | Optional words matched against the reference number, the court, the decision, the facts, the headnotes and the full text.                                                                            |
| `court_type`          | enum    | Optional level of the court: `corte_plena`, `sala` (the Salas of the Corte Suprema), `camara` (the second-instance Cámaras), `tribunal_de_sentencia` or `juzgado`.                                   |
| `court`               | string  | Optional court as `court` names it, e.g. `Sala de lo Constitucional` or `Cámara Segunda de lo Laboral`, matched from the start of the name. Case and accents are ignored.                            |
| `subject`             | string  | Optional area of law as `subject` names it: `Penal`, `Familia`, `Civil y Mercantil`, `Constitucional`, `Laboral`, `Medio Ambiente` and others, matched from the start. Case and accents are ignored. |
| `proceeding_type`     | string  | Optional kind of proceeding as `proceeding_type` names it, e.g. `Amparo`, `Hábeas corpus`, `Inconstitucionalidad`, matched from the start. Case and accents are ignored.                             |
| `type`                | string  | Optional kind of resolution as `type` names it, e.g. `Sentencias definitivas`, `Interlocutorias`, `Improcedencias`, matched from the start. Case and accents are ignored.                            |
| `crime`               | string  | Optional crime as it appears in `crimes`, e.g. `Homicidio agravado`, matched in full. Case and accents are ignored.                                                                                  |
| `registration_number` | string  | Optional reference number (N°) as the court prints it, e.g. `49COMP2026` or `86-CAC-2026`. Returns every resolution of that reference. Case, spaces and punctuation are ignored.                     |
| `year`                | integer | Optional year of the resolution. 0 searches every year. Default `0`.                                                                                                                                 |
| `from_date`           | string  | Optional: only resolutions handed down on or after this date, `yyyy-mm-dd`.                                                                                                                          |
| `to_date`             | string  | Optional: only resolutions handed down 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/sv/csj-sv/rulings-search/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "query": "debido proceso",
        "court_type": "sala",
        "subject": "constitucional"
      }'
```

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 recent resolution first. Every result carries `id` (the resolution's permanent number, e.g. `1138697`), `registration_number` (the reference number, e.g. `49COMP2026`), `ruling_date`, `year`, `court_type` (`corte_plena`, `sala`, `camara`, `tribunal_de_sentencia` or `juzgado`), `court`, `subject` (the area of law), `proceeding_type`, `type` (the kind of resolution), `appeal_type`, `lawsuit_type`, `decision`, `facts`, `crimes`, `lower_courts`, `courts_in_conflict`, `challenged_act`, `rights_invoked`, `grounds`, `applied_law`, `other_fields`, `descriptors` and `extracts` (the headnotes, each a topic with its holdings), `text_status` (`ok`, `scanned` or `missing`), `official_url` (the resolution's record at the court), `document_url` (Croma's copy of the original document, byte for byte as the court published it, which stays available whatever happens to the court's link) and `source_document_url` (the document on the court's own site). Fields the court's record leaves empty are null or empty lists; party names are never included.

<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 Corte Suprema de Justicia de El Salvador Ruling endpoint.
</Note>

## One resolution, in full

`POST /sv/csj-sv/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. `1138697`, 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/sv/csj-sv/ruling/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ruling_id": "1138697" }'
```

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 resolution's permanent number, e.g. `1138697`), `registration_number` (the reference number, e.g. `49COMP2026`), `ruling_date`, `year`, `court_type` (`corte_plena`, `sala`, `camara`, `tribunal_de_sentencia` or `juzgado`), `court`, `subject` (the area of law), `proceeding_type`, `type` (the kind of resolution), `appeal_type`, `lawsuit_type`, `decision`, `facts`, `crimes`, `lower_courts`, `courts_in_conflict`, `challenged_act`, `rights_invoked`, `grounds`, `applied_law`, `other_fields`, `descriptors` and `extracts` (the headnotes, each a topic with its holdings), `text_status` (`ok`, `scanned` or `missing`), `official_url` (the resolution's record at the court), `document_url` (Croma's copy of the original document, byte for byte as the court published it, which stays available whatever happens to the court's link) and `source_document_url` (the document on the court's own site). Fields the court's record leaves empty are null or empty lists; party names are never included.

<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`; `document_url` still gives the original document when the court published one.
</Note>

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

## Search the legislation

`POST /sv/csj-sv/laws-search/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

One search over the consolidated text of every legal text since 1821, filtered by kind, status, area of law, number, municipality, department, year or date.

| Field          | Type    | Notes                                                                                                                                                                                                                                       |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`        | string  | Optional words matched against the name, the documentation center's summary and the consolidated text.                                                                                                                                      |
| `type`         | string  | Optional kind of document: `Decretos Legislativos`, `Decretos Ejecutivos`, `Decretos Institucionales`, `Acuerdos`, `Reglamentos`, `Ordenanzas Municipales` or `Documentos Generales`, matched from the start. Case and accents are ignored. |
| `status`       | enum    | Optional status: `vigente` (in force), `caducada` (expired) or `derogada` (repealed).                                                                                                                                                       |
| `subject`      | string  | Optional area of law, e.g. `Penal`, `Tributaria`, `Laboral`, matched from the start. Case and accents are ignored.                                                                                                                          |
| `number`       | string  | Optional decree or agreement number, e.g. `1030`. Case, spaces and punctuation are ignored.                                                                                                                                                 |
| `municipality` | string  | Optional municipality of an ordinance, e.g. `San Salvador Centro`, matched from the start. Case and accents are ignored.                                                                                                                    |
| `department`   | string  | Optional department of an ordinance, e.g. `La Libertad`, matched from the start. Case and accents are ignored.                                                                                                                              |
| `year`         | integer | Optional year of publication in the Diario Oficial. 0 searches every year. Default `0`.                                                                                                                                                     |
| `from_date`    | string  | Optional: only acts published on or after this date, `yyyy-mm-dd`.                                                                                                                                                                          |
| `to_date`      | string  | Optional: only acts 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/sv/csj-sv/laws-search/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "código penal", "status": "vigente" }'
```

Returns `as_of`, the applied filters, `total`, `page`, `per_page`, `total_pages`, `count` and `results[]`, most recently published first. Every result carries `id` (the act's permanent number, e.g. `558819`), `title`, `type` (`Decretos Legislativos`, `Decretos Ejecutivos`, `Decretos Institucionales`, `Acuerdos`, `Reglamentos`, `Ordenanzas Municipales` or `Documentos Generales`), `nature`, `number` (the decree or agreement number), `status` (`vigente`, `caducada` or `derogada`), `subject` (the area of law), `issuing_body`, `state_organ`, `municipality` and `department` (ordinances), `issue_date`, `publication_date` (in the Diario Oficial), `year`, `gazette_number`, `gazette_volume`, `considerations` (the documentation center's summary), `reform_count`, `related_rulings` (ids for the ruling endpoint), `other_fields`, `text_status`, `official_url` (the act's record at the court), `document_url` (Croma's copy of the current version of the document, byte for byte as the court published it), `source_document_url` (the document on the court's own site) and `document_modified_at`.

<Note>
  Search results leave out the text, the amendments and the document's versions; `query` still matches the text. Read them with the Corte Suprema de Justicia de El Salvador Law endpoint.
</Note>

## One legal text, in full

`POST /sv/csj-sv/law/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

| Field    | Type    | Notes                                                                                                      |
| -------- | ------- | ---------------------------------------------------------------------------------------------------------- |
| `law_id` | string  | **Required.** The act's `id` from a search result, e.g. `558819`, 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. A long code takes several responses. Default `200000`.          |

```bash theme={"dark"}
curl https://api.croma.run/sv/csj-sv/law/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "law_id": "558819" }'
```

Returns `as_of`, `found`, `law_id` and `law`, which carries everything the search returns plus `reforms[]` (each amendment in order: `decree`, `decree_number`, `issuing_body`, `decree_date`, `publication_date`, `gazette_number`, `gazette_volume`, and `document_url` with Croma's copy of the amendment's own text next to its `source_document_url`), `document_versions[]` (every version of the act's document Croma has kept, oldest first, each with `document_url`, `modified_at` and `bytes`) and `content`: a window onto the consolidated text, with `text`, `offset`, `total_length`, `has_more` and `next_offset`. Every result carries `id` (the act's permanent number, e.g. `558819`), `title`, `type` (`Decretos Legislativos`, `Decretos Ejecutivos`, `Decretos Institucionales`, `Acuerdos`, `Reglamentos`, `Ordenanzas Municipales` or `Documentos Generales`), `nature`, `number` (the decree or agreement number), `status` (`vigente`, `caducada` or `derogada`), `subject` (the area of law), `issuing_body`, `state_organ`, `municipality` and `department` (ordinances), `issue_date`, `publication_date` (in the Diario Oficial), `year`, `gazette_number`, `gazette_volume`, `considerations` (the documentation center's summary), `reform_count`, `related_rulings` (ids for the ruling endpoint), `other_fields`, `text_status`, `official_url` (the act's record at the court), `document_url` (Croma's copy of the current version of the document, byte for byte as the court published it), `source_document_url` (the document on the court's own site) and `document_modified_at`.

<Note>
  The court rewrites a consolidated text when it incorporates an amendment. Croma keeps every version it has seen: `document_url` is the newest, `document_versions` lists them all.
</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>
