Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/BladimirGS/judicial-backend/llms.txt

Use this file to discover all available pages before exploring further.

Once an appeal has been registered, this endpoint retrieves its complete record by folio number. The response is a fully hydrated object that includes every scalar field on the appeal, all associated catalog lookups (materia, juzgado, magistrado, etc.), and the nested relaciones array which carries the parties and offenses for each case relation. Use the folioOficialia value returned by POST /api/apelaciones to construct the query string.

GET /api/apelaciones/detalle

Authentication

A valid Bearer JWT is required. Requests without an Authorization: Bearer <token> header return 401 Unauthorized.

Query Parameters

folioOficialia
string
required
The official folio number of the appeal to retrieve (e.g. "2024-PCF-001"). This is the value returned as data.folioOficialia when the appeal was created. Omitting this parameter returns a 400 error.

Response — 200 OK

The response data object maps directly to the ApelacionDetailDTO interface. All catalog reference fields follow the CatalogoBase shape: { id: number, descripcion: string }. Fields that are not applicable to the appeal’s matter type (e.g. catJuzgado for an indígena appeal) will be null.
status
string
"success"
data
object
The full appeal record.

Error Responses

HTTP StatusReasonDescription
400 Bad RequestfolioOficialia not providedThe query string is missing the folioOficialia parameter.
401 UnauthorizedMissing or invalid JWTAuthentication failed.
404 Not FoundAppeal not foundNo appeal with the given folio exists in the database.

Example Request

curl 'http://localhost:4000/api/apelaciones/detalle?folioOficialia=2024-PCF-001' \
  -H 'Authorization: Bearer <token>'

Example Response

{
  "status": "success",
  "data": {
    "id": 87,
    "folioOficialia": "2024-PCF-001",
    "folioApelacion": "TOCA-2024-012",
    "folioOficio": "OF-2024-001",
    "expedienteCausa": "CAUSA-001",
    "expedienteAcumulado": null,
    "fojas": 15,
    "esReposicion": false,
    "fechaAuto": "2024-03-10T00:00:00.000Z",
    "observaciones": null,
    "asunto": null,
    "lugarHechos": null,
    "catMateria": { "id": 5, "descripcion": "Penal" },
    "catApelacion": { "id": 1, "descripcion": "Apelación de sentencia" },
    "tipoApelacion": { "id": 1, "descripcion": "Apelación principal" },
    "tipoEscrito": { "id": 1, "descripcion": "Escrito de apelación" },
    "catJuzgado": { "id": 2, "descripcion": "Juzgado Segundo Penal" },
    "catMunicipio": null,
    "catLocalidad": null,
    "catEtnia": null,
    "catMagistrado": { "id": 1, "descripcion": "Lic. Martínez Ruiz" },
    "relaciones": [
      {
        "id": 201,
        "ofendido": {
          "id": 301,
          "nombre": "María López",
          "direccion": null,
          "menorEdad": false,
          "sexo": { "id": 2, "descripcion": "Femenino" },
          "tipoParte": { "id": 1, "descripcion": "Ofendido" }
        },
        "procesado": {
          "id": 302,
          "nombre": "Juan Pérez",
          "direccion": "Calle Reforma 123",
          "menorEdad": false,
          "sexo": { "id": 1, "descripcion": "Masculino" },
          "tipoParte": { "id": 2, "descripcion": "Procesado" }
        },
        "delitosRelacion": [
          {
            "id": 401,
            "delito": { "id": 4, "descripcion": "Robo con violencia" }
          }
        ]
      }
    ]
  }
}
The folioApelacion (toca docket number) differs from folioOficialia. folioOficialia is generated immediately on registration; folioApelacion is assigned later during the formal docket-opening step and may be null for newly created appeals.

Build docs developers (and LLMs) love