Workspace for judicial operations, internal matters, and integration-ready APIs.
Docs API430 endpoints

Documentación API para developers

Explora endpoints públicos con navegación lateral, formularios tipados y snippets listos para integrar.

Primeros pasos Crea una llave, autentícate y haz tu primera llamada en 4 pasos. Ver guía
  1. 1.Crea una API key

    En Configuración → API de desarrolladores. Elige los scopes y el rol con que actuará la key.

    Ir a API de desarrolladores →
  2. 2.Autentica cada solicitud

    Envía la key en el header Authorization. Solo ves datos de la organización dueña de la key.

    Authorization: Bearer nxl_live_…
  3. 3.Llama una acción

    Las acciones son POST con un cuerpo {"args": [...]}. Cada endpoint trae su ejemplo listo para ejecutar.

    POST /api/actions/… {"args": [{ … }]}
  4. 4.Flujo típico de causas

    Lista tus causas, abre una, lee sus movimientos y descarga sus documentos:

Webhooks Recibe eventos en tu servidor: configuración paso a paso, verificación de firma con ejemplos en 7 lenguajes, reintentos y eventos. Ver guía

Recibe eventos de tu organización en tu propio servidor en vez de consultar la API. Nexulex envía un POST JSON firmado a cada endpoint suscrito. Administrar webhooks →

Configúralo paso a paso

  1. Prepara en tu servidor una URL https pública que acepte POST con JSON, por ejemplo https://tu-dominio.cl/webhooks/nexulex.
  2. En Nexulex, con un usuario ADMIN, elige la organización en la barra lateral y abre su menú → Webhooks (o ve a /settings/developer-webhooks).
  3. Pega la URL y elige los eventos (sin selección recibe todos). En "Secreto de firma propio" escribe tu secreto (24 a 256 caracteres ASCII, sin espacios) o déjalo vacío para que Nexulex genere uno. Pulsa Agregar.
  4. Si Nexulex generó el secreto (whsec_…), cópialo del diálogo: se muestra una sola vez. Guárdalo en tu servidor, por ejemplo como la variable de entorno NEXULEX_WEBHOOK_SECRET.
  5. En tu servidor, verifica la firma de cada POST con ese secreto (ver "Verifica la firma") y responde 2xx en menos de 10 segundos.
  6. Pulsa Enviar prueba: llega un evento webhook.test. En Entregas ves el código HTTP de tu respuesta y puedes reenviar cualquier entrega.
  7. Para cambiar el secreto usa Rotar secreto: puedes escribir uno nuevo o generar otro. El anterior deja de firmar al instante, así que actualiza tu servidor enseguida.
# Same setup through the API (key with the webhooks:write scope). # Omit "secret" to have Nexulex generate one and return it once. curl -X POST https://api.nexulex.com/api/developer/webhooks \ -H "Authorization: Bearer $NEXULEX_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://your-domain.com/webhooks/nexulex", "eventTypes":["causa.movement.created","task.assigned"], "secret":"'"$NEXULEX_WEBHOOK_SECRET"'"}'

Encabezados

Nexulex-Webhook-Id identifica el evento (igual en cada reintento: úsalo para deduplicar). Nexulex-Webhook-Event es el tipo, Nexulex-Webhook-Timestamp la hora Unix del envío y Nexulex-Webhook-Signature la firma.

Respuestas y reintentos

Responde 2xx en menos de 10 segundos. Cualquier otra respuesta se reintenta tras 1 min, 5 min, 30 min, 2 h, 6 h, 12 h y 24 h. No se siguen redirecciones. Un endpoint que falla de forma sostenida se desactiva y avisamos por correo a quien lo creó.

Verifica la firma

Calcula HMAC-SHA256 con tu secreto (el whsec_… generado o el tuyo) sobre "<timestamp>.<cuerpo sin modificar>" y compáralo en tiempo constante con el valor después de v1=. Rechaza timestamps con más de 5 minutos de diferencia.

import crypto from "node:crypto";

// rawBody: the request body exactly as received (a Buffer or string).
function verifyNexulexWebhook(rawBody, headers, secret) {
  const ts = headers["nexulex-webhook-timestamp"] || "";
  const sig = headers["nexulex-webhook-signature"] || "";
  if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const expected = "v1=" + crypto.createHmac("sha256", secret)
    .update(ts + ".").update(rawBody).digest("hex");
  return sig.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
}

Eventos

Cuerpo: {"id", "type", "createdAt", "orgId", "data"}. Los eventos de causas incluyen data.causa (id, rol, competencia, caratulado, tribunalId). Elige eventos por endpoint; sin selección recibe todos.

causa.movement.createdcausa.stage_changedcausa.addedcausa.removedrut_monitor.matchboletin.publication.createdplazo.createdtask.createdtask.assignedtask.due

Administración por API

Con los scopes webhooks:read y webhooks:write puedes listar, crear, probar, rotar y eliminar endpoints en /api/developer/webhooks*. Al crear o rotar, envía "secret" para usar tu propio secreto; sin él, la respuesta trae uno generado una sola vez. Los endpoints reciben eventos de toda la organización, sin importar el rol de la key.

Errores Un mismo formato para todos los errores: código estable, mensaje en inglés y español, y el estado HTTP correcto. Ver guía

Toda respuesta de error a una llave API trae el mismo sobre JSON. Compara errorCode (estable) y no el texto. Las acciones que fallan responden con su estado HTTP real (4xx/5xx), nunca 200.

Campos

errorCode: el motivo, legible por máquina. message / messageEs: qué pasó y qué hacer, en inglés y en español (messageEs suele traer el detalle más específico). status: el estado HTTP. docs: este enlace. error: valor heredado para integraciones antiguas. Según el caso: requiredScope (scope faltante) o retryAfter (segundos a esperar).

Qué hacer según el estado

4xx: corrige la solicitud o la llave; reintentar igual no sirve. 429: espera retryAfter segundos (o el encabezado Retry-After). 5xx: reintenta con espera creciente; UPSTREAM_ERROR significa que PJUD/OJV falló.

HTTP/1.1 403 Forbidden
{
  "error": "insufficient_scope",
  "errorCode": "INSUFFICIENT_SCOPE",
  "message": "This API key lacks the \"causas:read\" scope this route needs. Add it to the key under Settings → API keys (or create a key that has it).",
  "messageEs": "Esta llave API no tiene el scope \"causas:read\" que requiere esta ruta. Agrégalo a la llave en Configuración → Llaves API (o crea una llave que lo tenga).",
  "status": 403,
  "requiredScope": "causas:read",
  "docs": "https://www.nexulex.com/docs/api#errors"
}
INVALID_REQUEST 400 Falta un campo obligatorio o un valor no es aceptado; messageEs dice cuál.
API_KEY_MISSING 401 No se envió el encabezado Authorization: Bearer nxl_live_….
API_KEY_MALFORMED 401 El encabezado no contiene una llave de Nexulex con el formato nxl_live_….
API_KEY_INVALID 401 La llave no existe o está mal copiada.
API_KEY_REVOKED 401 La llave fue revocada; crea una nueva.
API_KEY_EXPIRED 401 La llave venció; crea una nueva.
KEY_OWNER_INACTIVE 401 Quien creó la llave ya no es miembro activo de la organización, o la organización está inactiva.
ROUTE_NOT_AVAILABLE 401 La ruta no es parte de la API pública; las llaves no pueden llamarla.
INSUFFICIENT_SCOPE 403 A la llave le falta el scope de la ruta (requiredScope lo indica).
FORBIDDEN 403 El rol de la llave no permite esta operación.
LIMIT_REACHED 403 Se alcanzó un límite del plan (también códigos como TRACKED_CASE_LIMIT_REACHED).
PAYMENT_METHOD_REQUIRED 402 La organización agotó la cuota de prueba gratuita; agrega un medio de pago en Facturación.
BILLING_SUSPENDED 402 El acceso a la API está pausado por una factura impaga o una organización desactivada; págala en Facturación.
NOT_FOUND 404 El recurso no existe en la organización de la llave (también códigos *_NOT_FOUND más específicos).
CONFLICT 409 Choca con el estado actual, por ejemplo un duplicado.
UNPROCESSABLE 422 La solicitud es válida pero la acción no se pudo completar; messageEs explica por qué.
RATE_LIMITED 429 Superaste el límite por minuto de la llave; espera retryAfter segundos.
QUOTA_EXCEEDED 429 La organización alcanzó su cuota diaria; se renueva a las 00:00 UTC (Retry-After indica cuánto falta).
INTERNAL_ERROR 500 Falla de Nexulex; reintenta más tarde.
UPSTREAM_ERROR 502 PJUD u OJV fallaron o no respondieron; reintenta más tarde.
SERVICE_UNAVAILABLE 503 Servicio no disponible temporalmente; reintenta más tarde.

Get tracked cases

POST /api/actions/case-tracking/queries/get-tracked-cases

List the organization's tracked causas (filters and pagination in args[0]).

API Key requeridaScope : causas:readRunnable

Authentication: developer API key. Required scope: `causas:read`. Action route. Body: `{"args": [...]}`; responses are the action's JSON payload.

Cuerpo de la solicitud

args

Obligatorio

array

Positional action arguments; most actions take one input object.

Expandir · 27 Campos de args
page

number

per_page

number

sort

string

from

string

to

string

operator

string

rol

string

caratulado

string

tribunalId

string

corteId

string

suspendedOrgs

string

clientIds

string

folio

string

tramite

string

nombre

string

competence

string

boletinConcursal

string

archived

string

teamId

string

assigneeUserId

string

assigneeRole

string

unassigned

string

hideAutoRelated

string

changedWithinDays

string

createdWithinDays

string

noClient

string

unchangedForDays

string

Respuestas

Esquema de respuesta: application/json

data

Obligatorio

object

The action's result.

Expandir · 3
causes

Obligatorio

object[]

Causas.

Expandir · 27
id

Obligatorio

string

Unique identifier.

createdAt

Obligatorio

string (date-time)

When the record was created (ISO 8601).

rol

Obligatorio

string

Causa rol (e.g. C-1234-2024).

caratulado

Obligatorio

string

Causa caption (the parties as PJUD lists them).

competence

Obligatorio

string

PJUD competencia: civil, laboral, cobranza, familia, penal, corte suprema or corte de apelaciones.

SUPREMAAPELACIONESCIVILLABORALPENALCOBRANZAFAMILIA
corteId

Obligatorio

integer | null

PJUD court of appeals id.

tribunalId

Obligatorio

integer | null

PJUD court id.

active

Obligatorio

boolean

Whether the record is active.

archived

Obligatorio

boolean

Whether the record is archived.

archivedAt

Obligatorio

string (date-time) | null

isPrivate

Obligatorio

boolean

Whether only its members can see it.

status

Obligatorio

string

Current status.

SUCCESSIN_PROGRESSERRORWAITINGNOT_PRESENTPJUD_WITH_ERRORAPPROVEDPENDINGBACKGROUND_CHECKWAITING_FOR_DOCUMENTSREJECTED
fechaIng

Obligatorio

string (date-time) | null

Date the causa was filed (ISO 8601).

lastUpdate

Obligatorio

string (date-time) | null

Last time the causa was refreshed from PJUD (ISO 8601).

lastChangeAt

Obligatorio

string (date-time)

When PJUD last showed a change (ISO 8601).

daysWithNoChanges

Obligatorio

integer

Days since PJUD last showed a change.

successValidUntil

Obligatorio

string (date-time) | null

Until when the last successful refresh is considered current (ISO 8601).

errorCategory

Obligatorio

string

Category of the last scraping error.

OTHERDOWNLOADSNO_VALID_CUBLOCKEDTIMEOUT
textErrorDesc

Obligatorio

string | null

Detail of the last scraping error.

orgIds

Obligatorio

string[]

Ids of the organizations that can see it.

teamIds

Obligatorio

string[]

Ids of the teams it is assigned to.

clients

Obligatorio

object[]

Client credentials linked to the causa, as stored (long keys and their compact aliases).

Expandir · 8
clientId

string

Client id.

cId

string

Compact alias of clientId.

orgId

string

Organization id.

oId

string

Compact alias of orgId.

accessGranted

boolean

aG

boolean

Compact alias of accessGranted.

lastCheck

string (date-time) | null

Last time access was checked (ISO 8601).

lc

string (date-time) | null

Compact alias of lastCheck.

suspendedOrgs

Obligatorio

object[]

Per-organization tracking state of the causa, for every organization that tracks it.

Expandir · 7
orgId

string

Organization id.

oId

string

Legacy spelling of orgId.

addedAt

string (date-time) | null

suspendedAt

string (date-time) | null

Set while this org's tracking is suspended.

archivedAt

string (date-time) | null

archivedReason

string | null

manual, bulk or bc-estado.

archivedById

string | null

estadosProcesal

Obligatorio

object[]

Estado procesal history, oldest first.

Expandir · 3
changedAt

Obligatorio

string (date-time)

When this value was first seen.

value

Obligatorio

string

Value.

counter

Obligatorio

integer

How many times this value has been seen in a row.

cuadernoCount

Obligatorio

integer

Number of cuadernos (case-file notebooks).

autoTracked

Obligatorio

boolean

Whether Nexulex started tracking it automatically (e.g. an exhorto of a tracked causa).

relation

Obligatorio

object | null

How this causa relates to its parent causa; null when it has none.

Expandir · 3
kind

Obligatorio

string

Record subtype.

parentRol

Obligatorio

string

En Laboral, Penal, Cobranza es RIT

parentCausaId

Obligatorio

string

Id of the parent causa.

pageCount

Obligatorio

integer

Number of pages at the requested page size.

total

Obligatorio

integer

Total number of matching records across all pages.

Probar este endpoint Ejecuta la solicitud desde tu navegador con tu API key; la key nunca sale de este navegador.

API Base URL

Definido por entorno. No editable desde el portal público.

Developer API Key

Se envía en Authorization: Bearer <API_KEY>.

Parámetros Body

Ingresa una API key para ejecutar requests protegidas.