Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/gcapella0/agente-inteligente-expedientes/llms.txt

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

The export endpoint streams a complete academic dossier as a downloadable file in your choice of JSON, XML, or CSV format. The response is delivered as a StreamingResponse with a Content-Disposition: attachment header, so browsers and HTTP clients save it directly to disk without buffering the entire payload in memory first.

GET /expedientes//exportar

Export a full dossier to a structured file. All three formats include the docente profile, institutional link, formation data, completeness metrics, and — when enabled — document metadata and raw OCR text.
No authentication is required for this endpoint.

Path Parameters

cedula
string
required
Venezuelan ID number of the docente to export (digits only), e.g. 12345678.

Query Parameters

formato
string
default:"json"
Output format. Accepted values: json, xml, csv. Passing any other value returns HTTP 415 Unsupported Media Type.
incluir_documentos
boolean
default:"true"
When true, the export includes a documentos array with the metadata for every document in the dossier (type, name, validation state, basic OCR fields). Set to false to export only the docente record.
incluir_ocr
boolean
default:"false"
When true, each document entry in the documentos array also includes ocr.texto_completo — the full raw text extracted by the OCR engine. This can significantly increase file size for multi-page documents. Ignored when incluir_documentos=false.
Use incluir_ocr=false (the default) for compact exports intended for archiving or display. Enable incluir_ocr=true only when you need the raw extracted text for external processing such as indexing, NLP pipelines, or compliance audits.

Response Headers

HeaderValue
Content-Dispositionattachment; filename=expediente_{cedula}.{formato}
Content-Typeapplication/json / application/xml / text/csv

JSON Response Structure

The JSON export is a single object with the following top-level keys:
{
  "numero_expediente": "EXP-2024-0042",
  "docente": {
    "cedula": "12345678",
    "nombres": "Ana",
    "apellidos": "Martinez",
    "fecha_nacimiento": "1985-03-12"
  },
  "formacion_academica": [
    {
      "titulo": "Licenciada en Matematicas",
      "institucion": "Universidad Central de Venezuela",
      "ano_graduacion": 2008
    }
  ],
  "vinculacion_institucional": {
    "departamento": "Matematicas",
    "sede": "Caracas",
    "cargo_actual": "Profesora Agregada",
    "categoria": "Agregado",
    "dedicacion": "Tiempo Completo",
    "tipo_contratacion": "ordinario"
  },
  "completitud": {
    "porcentaje": 70,
    "documentos_faltantes": ["titulo_universitario", "fondo_negro_titulo", "acta_grado"]
  },
  "status": "activo",
  "created_at": "2024-01-15 08:30:00",
  "updated_at": "2024-06-01 14:32:00",
  "documentos": [
    {
      "_id": "649ab8d3e4b7c200123456cc",
      "tipo": "cedula_identidad",
      "nombre": "Cédula de Identidad - Ana Martinez",
      "validacion": {
        "estado": "aprobado",
        "observaciones": null
      },
      "ocr": {
        "procesado": true,
        "confianza_promedio": 0.94
      }
    }
  ]
}
numero_expediente
string | null
The dossier’s assigned reference number (e.g. EXP-2024-0042), or null if not yet assigned.
docente
object
Core identity fields: cedula, nombres, apellidos, and fecha_nacimiento (serialized as a string).
formacion_academica
array
Academic formation entries from the docente record. Each item typically includes titulo, institucion, and ano_graduacion.
vinculacion_institucional
object
Institutional affiliation: department, campus, current role, academic category, dedication, and contract type.
completitud
object
Dossier completeness summary: porcentaje (integer 0–100) and documentos_faltantes (list of missing required types).
documentos
array
Present only when incluir_documentos=true. Each entry contains _id, tipo, nombre, validacion, and ocr (summary). When incluir_ocr=true, each ocr object additionally includes texto_completo.

XML Format

When formato=xml, the endpoint returns a well-formed XML document that mirrors the JSON structure. The root element is <expediente>. Dicts become named XML elements; arrays become <{key}> wrappers with <item> children.
<?xml version="1.0" encoding="UTF-8"?>
<expediente>
  <numero_expediente>EXP-2024-0042</numero_expediente>
  <docente>
    <cedula>12345678</cedula>
    <nombres>Ana</nombres>
    <apellidos>Martinez</apellidos>
    <fecha_nacimiento>1985-03-12</fecha_nacimiento>
  </docente>
  <vinculacion_institucional>
    <departamento>Matematicas</departamento>
    <sede>Caracas</sede>
  </vinculacion_institucional>
  <completitud>
    <porcentaje>70</porcentaje>
    <documentos_faltantes>
      <item>titulo_universitario</item>
      <item>fondo_negro_titulo</item>
    </documentos_faltantes>
  </completitud>
  <status>activo</status>
  <documentos>
    <item>
      <tipo>cedula_identidad</tipo>
      <nombre>Cédula de Identidad - Ana Martinez</nombre>
    </item>
  </documentos>
</expediente>

CSV Format

When formato=csv, the dossier is exported as a two-column key/value file with dotted-path keys derived by flattening the JSON structure. List fields are represented by a count of their items rather than individual rows.
campo,valor
numero_expediente,EXP-2024-0042
docente.cedula,12345678
docente.nombres,Ana
docente.apellidos,Martinez
docente.fecha_nacimiento,1985-03-12
vinculacion_institucional.departamento,Matematicas
vinculacion_institucional.sede,Caracas
completitud.porcentaje,70
status,activo
created_at,2024-01-15 08:30:00
updated_at,2024-06-01 14:32:00
documentos,7
In CSV format, nested arrays (such as documentos or formacion_academica) are collapsed to a single row containing the item count, not individual entries. Use JSON or XML if you need per-document rows.

Error Responses

StatusDetail
404"Docente no encontrado"
415"Formato no soportado. Use json, xml o csv."
500"Error en exportación"

curl Examples

# JSON — default format, includes document metadata
curl -o expediente_12345678.json \
  "http://localhost:8000/expedientes/12345678/exportar?formato=json"

# XML with full OCR text included
curl -o expediente_12345678.xml \
  "http://localhost:8000/expedientes/12345678/exportar?formato=xml&incluir_ocr=true"

# CSV — docente fields only, no document metadata
curl -o expediente_12345678.csv \
  "http://localhost:8000/expedientes/12345678/exportar?formato=csv&incluir_documentos=false"

# JSON — complete export with OCR text, saved with timestamped filename
curl -o "expediente_12345678_$(date +%Y%m%d).json" \
  "http://localhost:8000/expedientes/12345678/exportar?formato=json&incluir_documentos=true&incluir_ocr=true"

Build docs developers (and LLMs) love