This endpoint registers a new second-instance appeal in the system. A single request captures the appeal metadata, the court of origin (penal) or community details (indígena), and at least one relación — a pairing of an offended party and a defendant, each linked to one or more offenses. On success the server returns a system-generated folio number and the assigned sala. The request body is a discriminated union onDocumentation 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.
idMateria:
idMateria: 5→ Penal appeal — requires court-of-origin fields (idApelacion,idTipoApelacion,idJuzgado,expedienteCausa,fechaAuto,idTipoEscrito).idMateria: 6→ Indígena appeal — requires community fields (idMunicipio,idLocalidad,idEtnia,lugarHechos).
Folio generation is handled server-side by the
PA_INS_PCF_FolioTramite stored procedure. The generated folio is returned in the response as folioOficialia and can be used immediately to look up the appeal via GET /api/apelaciones/detalle.POST /api/apelaciones
Authentication
Request Body
All fields marked required must be present. Conditionally required fields are only validated whenidMateria matches the indicated value.
Common fields (both materias)
Discriminator for the appeal type. Use
5 for penal and 6 for indígena. All other integers are rejected with a validation error.ID of the magistrate to assign to this appeal. Optional — the sala assignment procedure may set one automatically.
Set to
true if this appeal is a repositioning (reposición) rather than a first-time appeal. Defaults to false when omitted.Array of case relations. At least one relation is required. Each relation links an offended party to a defendant and one or more offenses.
Penal-only fields (idMateria: 5)
ID of the top-level appeal catalog entry (from
data.apelaciones).ID of the appeal sub-type (from
GET /:idApelacion/tipos-apelacion).Date of the originating court order in
YYYY-MM-DD format (e.g. "2024-01-15").Case file number from the court of origin (e.g.
"CAUSA-001").ID from the
tiposEscritos catalog — the type of written brief being filed.ID of the originating court (from
data.juzgados).Office folio reference string. Optional.
Accumulated case file identifier. Optional. Maximum 10 characters.
Number of pages in the submitted brief. Optional.
Free-text observations about the appeal. Optional.
Indígena-only fields (idMateria: 6)
ID from the
municipios catalog.ID from the
localidades catalog (obtained via GET /:idMunicipio/localidades).ID from the
etnias catalog.Free-text ethnic group description. Required when
idEtnia === 17 (“Otro”).Description of the location where the events occurred (e.g.
"Comunidad San Juan Copala").Brief description of the matter under appeal. Optional.
Response — 201 Created
"success""Apelación registrada correctamente"Internal database ID assigned to the newly created appeal record.
The system-generated folio number (e.g.
"2024-PCF-042"). Use this value to retrieve the full appeal detail via GET /api/apelaciones/detalle?folioOficialia=<folio>.The description of the assigned sala (courtroom), determined by the
PA_SEL_AsignacionTocaSala stored procedure.Error Responses
| HTTP Status | Reason | Description |
|---|---|---|
400 Bad Request | Validation failure | One or more required fields are missing or have the wrong type. The response body includes a errors object mapping field names to messages. |
400 Bad Request | No sala available | The sala-assignment stored procedure returned IdSala <= 0, meaning no courtroom could be assigned for the given parameters. |
401 Unauthorized | Missing or invalid JWT | Authentication failed. |
Example Request — Penal Appeal
Example Response
Example Request — Indígena Appeal
The folio number returned in
data.folioOficialia is generated by the [dbo].[PA_INS_PCF_FolioTramite] SQL Server stored procedure. The procedure writes an entry to the folio registry table and returns an NVARCHAR(10) output parameter. If the procedure returns an empty result the API responds with HTTP 500 and error code SP_FOLIO_TRAMITE_NO_RESULT.