Skip to content

Ingest Endpoints

Endpoints under /v1/ingest/ for the full case analysis workflow: from PDF upload through automated phase analysis to human-reviewed legal analysis. Many endpoints have dual paths (/workflow/... and /processo/full-analysis/...) for backward compatibility.

Start a full case analysis workflow. Upload a PDF file for asynchronous processing. This is the primary entry point for new case analysis.

Alias: POST /v1/ingest/processo/full-analysis (legacy, same handler).

Content-Type: multipart/form-data

ParameterTypeDefaultDescription
fileUploadFilerequiredPDF file of the legal case
source_systemstring"projudi"Upstream source system label
rules_versionstringnullRuleset version override
min_precedent_scorenumbernullMinimum precedent score threshold (0-100)
max_matches_per_phaseintegernullCap on precedent matches per phase (1-10)
reasonstringnullOperator note for audit traceability
strict_infra_requiredbooleantrueFail if required infra dependencies are unavailable

Returns: 202 Accepted with workflow_id and initial status.

Terminal window
curl -X POST http://localhost:8000/v1/ingest/workflow \
-H "Authorization: Bearer $API_KEY" \
-F "file=@caso-12345.pdf" \
-F "source_system=projudi"

Check current state and progress of a workflow.

Alias: GET /v1/ingest/processo/full-analysis/{workflow_id}

ParameterTypeDescription
workflow_idstring (path)Workflow ID returned by the creation endpoint

Returns the current state, progress details, phases, and any errors.

Terminal window
curl http://localhost:8000/v1/ingest/workflow/wf-abc123 \
-H "Authorization: Bearer $API_KEY"

GET /v1/ingest/workflow/{workflow_id}/result

Section titled “GET /v1/ingest/workflow/{workflow_id}/result”

Retrieve the consolidated result of a completed workflow.

Alias: GET /v1/ingest/processo/full-analysis/{workflow_id}/result

Returns the full analysis result when the workflow is complete, or a not-ready/error payload while still running.

Terminal window
curl http://localhost:8000/v1/ingest/workflow/wf-abc123/result \
-H "Authorization: Bearer $API_KEY"

Start a process extraction workflow (legacy pipeline, predates the full-analysis workflow).

Returns: 202 Accepted with extraction_id.

Check status and result of a legacy process extraction.

POST /v1/ingest/processo/{extraction_id}/validate

Section titled “POST /v1/ingest/processo/{extraction_id}/validate”

Validate (approve/reject) a legacy extraction with an optional reason.

Convert a full legal process PDF to relevant Markdown. Standalone utility that does not create a workflow.

ParameterTypeDescription
fileUploadFilePDF file to convert

Returns converted Markdown with highlighted relevant sections.

POST /v1/ingest/processo/{extraction_id}/phase-analysis

Section titled “POST /v1/ingest/processo/{extraction_id}/phase-analysis”

Run phase analysis on an extraction. Identifies procedural phases in the legal case and matches each to relevant jurisprudence.

Returns: 202 Accepted with analysis_id.

GET /v1/ingest/processo/{extraction_id}/phase-analysis/{analysis_id}

Section titled “GET /v1/ingest/processo/{extraction_id}/phase-analysis/{analysis_id}”

Check status and results of a phase analysis.

POST /v1/ingest/processo/{extraction_id}/phase-analysis/reprocess

Section titled “POST /v1/ingest/processo/{extraction_id}/phase-analysis/reprocess”

Reprocess phase analysis for an extraction. Creates a new immutable analysis run without modifying the previous one.

Returns: 202 Accepted with new analysis_id.

POST /v1/ingest/processo/{extraction_id}/phase-analysis/{analysis_id}/review

Section titled “POST /v1/ingest/processo/{extraction_id}/phase-analysis/{analysis_id}/review”

Submit human review for phases in a legacy phase analysis. Approve or reject individual phases with reviewer notes.

ParameterTypeDescription
phase_labelstringPhase identifier to review
approvedbooleanApproval decision
reviewerstringReviewer identity for audit trail
notesstringReview notes

POST /v1/ingest/workflow/{workflow_id}/review

Section titled “POST /v1/ingest/workflow/{workflow_id}/review”

Submit human review for a full-analysis workflow. Supports per-phase and final review.

Alias: POST /v1/ingest/processo/full-analysis/{workflow_id}/review

ParameterTypeDescription
phase_labelstringPhase to review (omit for final review)
approvedbooleanReview decision
reviewerstringReviewer identity
notesstringReview notes

POST /v1/ingest/workflow/{workflow_id}/reprocess

Section titled “POST /v1/ingest/workflow/{workflow_id}/reprocess”

Start a new immutable execution for an existing workflow. Does not mutate prior executions.

Alias: POST /v1/ingest/processo/full-analysis/{workflow_id}/reprocess

Returns: 202 Accepted with new workflow run information.

ParameterTypeDefaultDescription
rules_versionstringnullRuleset version override for the new run
min_precedent_scorenumbernullMinimum precedent score threshold
max_matches_per_phaseintegernullCap on precedent matches per phase
reasonstringnullOperator reason for audit trail
strict_infra_requiredbooleannullOverride strict infrastructure requirement

GET /v1/ingest/workflow/{workflow_id}/events

Section titled “GET /v1/ingest/workflow/{workflow_id}/events”

List auditable events for a workflow. Returns timestamped events for all state transitions, phase completions, errors, and review actions.

Terminal window
curl http://localhost:8000/v1/ingest/workflow/wf-abc123/events \
-H "Authorization: Bearer $API_KEY"

GET /v1/ingest/workflow/{workflow_id}/interactions

Section titled “GET /v1/ingest/workflow/{workflow_id}/interactions”

List the domain interaction trail for a workflow. Includes human reviews, system decisions, and operator notes.

Terminal window
curl http://localhost:8000/v1/ingest/workflow/wf-abc123/interactions \
-H "Authorization: Bearer $API_KEY"

GET /v1/ingest/workflow/{workflow_id}/artifacts

Section titled “GET /v1/ingest/workflow/{workflow_id}/artifacts”

List all versioned artifacts generated by a workflow (PDFs, JSONs, Markdown reports, logs).

Terminal window
curl http://localhost:8000/v1/ingest/workflow/wf-abc123/artifacts \
-H "Authorization: Bearer $API_KEY"

POST /v1/ingest/workflow/{workflow_id}/artifacts/{artifact_id}/signed-url

Section titled “POST /v1/ingest/workflow/{workflow_id}/artifacts/{artifact_id}/signed-url”

Generate a time-limited signed URL for downloading a specific workflow artifact.

ParameterTypeDescription
workflow_idstring (path)Workflow ID
artifact_idstring (path)Artifact identifier from the artifacts list

Returns a signed URL with a TTL controlled by VALTER_R2_PRESIGN_TTL_SECONDS (default: 600 seconds / 10 minutes).

Terminal window
curl -X POST http://localhost:8000/v1/ingest/workflow/wf-abc123/artifacts/art-456/signed-url \
-H "Authorization: Bearer $API_KEY"
{
"data": {
"signed_url": "https://storage.example.com/artifacts/art-456?X-Amz-Signature=...",
"expires_in_seconds": 600
},
"meta": {
"trace_id": "a1b2c3d4-...",
"latency_ms": 45.2
}
}
MethodPathDescriptionStatus
POST/v1/ingest/workflowStart full analysis workflow202
GET/v1/ingest/workflow/{id}Get workflow status200
GET/v1/ingest/workflow/{id}/resultGet workflow result200
POST/v1/ingest/workflow/{id}/reviewSubmit human review200
POST/v1/ingest/workflow/{id}/reprocessReprocess workflow202
GET/v1/ingest/workflow/{id}/eventsList audit events200
GET/v1/ingest/workflow/{id}/artifactsList artifacts200
GET/v1/ingest/workflow/{id}/interactionsList interactions200
POST/v1/ingest/workflow/{id}/artifacts/{aid}/signed-urlGet signed download URL200
POST/v1/ingest/pdf-to-markdownConvert PDF to Markdown200
POST/v1/ingest/processoStart legacy extraction202
GET/v1/ingest/processo/{id}Get extraction status200
POST/v1/ingest/processo/{id}/validateValidate extraction200
POST/v1/ingest/processo/{id}/phase-analysisStart phase analysis202
GET/v1/ingest/processo/{id}/phase-analysis/{aid}Get phase analysis status200
POST/v1/ingest/processo/{id}/phase-analysis/{aid}/reviewReview phase analysis200
POST/v1/ingest/processo/{id}/phase-analysis/reprocessReprocess phase analysis202