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.

Annexes (anexos) are the physical or digital documents submitted alongside an appeal — originals, certified copies, monetary values, and other supporting materials. The two endpoints on this page let client applications load the list of recognized annex types and then associate one or more of those types (with quantities and optional monetary values) to an existing appeal record. Both endpoints require authentication.

GET /api/apelaciones/anexos/catalogos

Returns the full catalog of available annex types. Fetch this list before showing the annex-addition form so the UI can render the correct labels for each idAnexo.

Authentication

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

Request Parameters

This endpoint takes no query or path parameters.

Response — 200 OK

status
string
"success"
message
string
"Catálogos de anexos obtenidos"
data
object
data.anexos
CatalogoBase[]
Array of annex type entries. Each item has:
  • id (number) — use this as idAnexo when posting annexes.
  • descripcion (string) — human-readable label (e.g. "Copias certificadas", "Originales").
The catalog may contain an entry for “Otro” (Other). When an “Otro” type is available, its id in the catalog is used as a positive integer in the catalog list. However, when posting annexes, passing a negative idAnexo signals a free-text “other” document — in that case otroAnexo becomes required. See the POST /api/apelaciones/anexos section below for details.

Error Responses

HTTP StatusReasonDescription
401 UnauthorizedMissing or invalid JWTAuthentication failed.

Example Request

curl 'http://localhost:4000/api/apelaciones/anexos/catalogos' \
  -H 'Authorization: Bearer <token>'

Example Response

{
  "status": "success",
  "message": "Catálogos de anexos obtenidos",
  "data": {
    "anexos": [
      { "id": 1, "descripcion": "Originales" },
      { "id": 2, "descripcion": "Copias simples" },
      { "id": 3, "descripcion": "Copias certificadas" },
      { "id": 4, "descripcion": "Valores" },
      { "id": 5, "descripcion": "Discos compactos" }
    ]
  }
}

POST /api/apelaciones/anexos

Attaches one or more annex items to an existing appeal. Each item specifies the annex type, quantity, whether it carries a monetary value, and optionally a free-text description for custom (“other”) document types. The endpoint validates that idApelacion and the anexos array are both present and non-empty before persisting.

Authentication

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

Request Body

idApelacion
integer
required
The internal database ID of the appeal to attach annexes to. This is the data.id value returned when the appeal was created — not the folio string.
anexos
AnexoItemDTO[]
required
Array of annex items to add. Must contain at least one item.

Response — 201 Created

status
string
"success"
message
string
"Anexos agregados correctamente"
data
AnexoRecord[]
Array of the newly created annex records, one entry per item in the submitted anexos array.
data[].id
integer
Internal ID of the created annex record.
data[].idApelacion
integer
ID of the appeal the annex was attached to.
data[].idAnexo
integer
Catalog ID used (or the negative integer for “other” types).
data[].cantidad
integer
Quantity of the document submitted.
data[].esValor
boolean
Whether this annex represents a monetary value.
data[].monto
string
The monetary amount, if applicable.

Error Responses

HTTP StatusReasonDescription
400 Bad RequestMissing idApelacionThe request body does not include idApelacion.
400 Bad RequestEmpty or missing anexos arrayanexos is absent, not an array, or has zero items.
400 Bad RequestValidation failureOne or more AnexoItemDTO fields failed class-validator rules (e.g. idAnexo is not an integer, otroAnexo missing when required).
401 UnauthorizedMissing or invalid JWTAuthentication failed.

Example Request — Standard Annexes

curl -X POST 'http://localhost:4000/api/apelaciones/anexos' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "idApelacion": 87,
    "anexos": [
      {
        "idAnexo": 1,
        "cantidad": 3,
        "esValor": false
      },
      {
        "idAnexo": 3,
        "cantidad": 1,
        "esValor": false
      }
    ]
  }'

Example Request — Annex with Monetary Value

curl -X POST 'http://localhost:4000/api/apelaciones/anexos' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "idApelacion": 87,
    "anexos": [
      {
        "idAnexo": 4,
        "cantidad": 1,
        "esValor": true,
        "monto": "5000.00"
      }
    ]
  }'

Example Request — Free-text “Other” Annex

curl -X POST 'http://localhost:4000/api/apelaciones/anexos' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "idApelacion": 87,
    "anexos": [
      {
        "idAnexo": -1,
        "otroAnexo": "Plano topográfico de la parcela en disputa",
        "cantidad": 2,
        "esValor": false
      }
    ]
  }'

Example Response

{
  "status": "success",
  "message": "Anexos agregados correctamente",
  "data": [
    {
      "id": 501,
      "idApelacion": 87,
      "idAnexo": 1,
      "cantidad": 3,
      "esValor": false,
      "monto": null
    },
    {
      "id": 502,
      "idApelacion": 87,
      "idAnexo": 3,
      "cantidad": 1,
      "esValor": false,
      "monto": null
    }
  ]
}
You can add annexes to an appeal in multiple batches by calling POST /api/apelaciones/anexos more than once with the same idApelacion. Each call appends new records — it does not replace existing ones. To review all annexes currently on file, use GET /api/apelaciones/detalle?folioOficialia=<folio> and inspect the full appeal detail.

Build docs developers (and LLMs) love