Ucotron Cortex
Guides by flow

Batch import

Load plots, policies, clients and claims through the API, with a per-row report.

POST /v1/import/{aois|policies|clients|claims} enqueues on /v1/jobs, the same async contract as the footprint computation. There is no second mechanism: two ways of asking "is it done?" guarantee you learn the wrong one half of the time.

Diagrama: Batch importFlujo del import por lote: subir el archivo, seguir el job por su id y leer el reporte por fila con aceptadas y rechazadas.

no

Archivo

Parseo por fila

¿validate_only?

200 · reporte, nada escrito

202 · job + preview

Worker aplica las filas aceptadas

GET /v1/jobs/id/result

Diagrama: Batch importFlujo del import por lote: subir el archivo, seguir el job por su id y leer el reporte por fila con aceptadas y rechazadas.

no

Archivo

Parseo por fila

¿validate_only?

200 · reporte, nada escrito

202 · job + preview

Worker aplica las filas aceptadas

GET /v1/jobs/id/result

Fuente del diagrama (mermaid)
flowchart TD
    F[Archivo] --> P[Parseo por fila]
    P --> V{¿validate_only?}
    V -- sí --> R1[200 · reporte, nada escrito]
    V -- no --> J[202 · job + preview]
    J --> W[Worker aplica las filas aceptadas]
    W --> R2[GET /v1/jobs/id/result]
bash
curl -sS "$SBOX/v1/import/clients?validate_only=true" -X POST \
  -H "authorization: Bearer $TOKEN" \
  -H "idempotency-key: import-clients-dryrun-1" \
  -H "content-type: application/json" \
  -d '{"format":"csv","columnMapping":{"displayName":"nombre","contactEmail":"mail"},"content":"nombre,mail\nCoop Uno,uno@sbox.invalid\nSin mail,\n"}'

Per row, not per file

An insurer uploads three hundred policies and three come in broken. Rejecting the whole file forces them to find those three by eye; accepting it whole puts invalid data into contracts that will later be adjusted. The 297 go in, and the 3 come back with their row number and their reason.

atomic: true exists for the opposite case and is opt-in: if it were the default, the frequent case — a large file with typos — would be the expensive case.

Formats

GeoJSON, KML and CSV-with-WKT for AOIs; CSV or JSON with columnMapping for the rest. The CSV supports what Spanish-language Excel actually writes: BOM, ; as delimiter, quotes with commas inside, and CRLF.

What breaks

codeWhat happened
missing_required_fieldA required field for the type is missing
invalid_field_valueMalformed email, non-positive number
invalid_geometrySays the evaluator shared with the console
duplicate_in_payloadThe row repeats within the same file
duplicate_in_tenantThat natural id already exists in the organization
unknown_referencePoints to a clientId/aoiId that does not exist
row_limit_exceededMore than 5,000 rows
atomic_batch_abortedThe row was valid but the atomic batch failed

Limits: 5,000 rows, 8 MiB (413 above that). The permission is decided by the type: importing policies requires underwriting:write, importing plots portfolio:write.

Endpoints in this guide

On this page