CoquiTitle API
Base URL: https://api.alianzacap.com
Authentication: Authorization: Bearer <access_token> (Auth0 JWT)
Case Management
Create Case
POST
/coquititle/casesCreate a new title study case
{
"finca_id": "12345-F",
"property_address": "123 Calle Principal, San Juan",
"demarcacion_code": "BA0101",
"ocr_mode": "document_ai",
"extractor_model": "gemini-2.5-flash",
"report_model": "gemini-3-pro-preview"
}
OCR Mode Options:
| Mode | Description | Evidence Support |
|---|---|---|
document_ai | Full OCR with bounding boxes (default) | Yes |
native_page_text | Uses Document AI's document.text | Yes |
direct_pdf_gemini_25 | Skip OCR, send PDFs to Gemini 2.5 | No |
direct_pdf_gemini_3 | Skip OCR, send PDFs to Gemini 3.0 | No |
Response (201):
{
"case_id": "550e8400-...",
"status": "pending",
"ocr_mode": "document_ai",
"extractor_model": "gemini-2.5-flash",
"report_model": "gemini-3-pro-preview"
}
List Cases
GET
/coquititle/casesList all cases with optional filtering
Query Parameters:
limit(int): Results per page (default: 20)offset(int): Pagination offsetstatus(string): Filter by status
Get Case
GET
/coquititle/cases/{id}Get case details by ID
Document Upload
Generate Upload URL
POST
/coquititle/cases/{id}/upload-urlGenerate a presigned S3 URL for direct upload
{
"filename": "folio-karibe.pdf",
"content_type": "application/pdf"
}
Response:
{
"upload_url": "https://s3.amazonaws.com/...",
"doc_id": "...",
"s3_key": "uploads/{case_id}/folio-karibe.pdf"
}
Upload directly to S3:
curl -X PUT "$upload_url" \
-H "Content-Type: application/pdf" \
--data-binary @file.pdf
Processing
Trigger Processing
POST
/coquititle/cases/{id}/processStart the OCR → extraction → report pipeline
Results
Get Report
GET
/coquititle/cases/{id}/reportGet the generated title study report
Response:
{
"report_json": {
"header": {
"finca_number": "5164",
"inscription_system": "karibe",
"demarcacion": "PA0101",
"registry_section": "de Guayama"
},
"boundaries": {
"norte": "con parcela numero 23",
"sur": "con Calle numero 4",
"este": "con parcela numero 25",
"oeste": "con parcela numero 19"
},
"description_prose": "RUSTICA: Parcela de terreno...",
"description_prose_annotated": "<span data-field=\"...\">...</span>...",
"ownership_prose": "Consta inscrito...",
"ownership_prose_annotated": "...<span data-field=\"titulares[0].name\">Juan Perez</span>...",
"encumbrances": {
"by_origin": [],
"direct": [],
"by_origin_free": true,
"direct_free": true
},
"evidence_sources": {
"titulares[0].name": [{
"doc_id": "...",
"page_no": 1,
"bboxes": [{"x": 0.1, "y": 0.2, "width": 0.05, "height": 0.02}],
"match_method": "exact",
"match_confidence": 1.0
}]
},
"evidence_summary": {
"total_fields": 32,
"fields_with_evidence": 29,
"coverage_pct": 91
}
}
}
Get Extraction Results
GET
/coquititle/cases/{id}/extraction-resultsGet raw extraction JSON with evidence map
Get Pending Docs
GET
/coquititle/cases/{id}/pending-docsGet processed pending documents
Sharing
Create Share
POST
/coquititle/cases/{id}/shareCreate a public share link for a report
{
"expires_at": "2025-01-15T00:00:00Z"
}
Response (201):
{
"share_id": "86af1832-a807-4ca0-8dff-559616593170",
"case_id": "550e8400-...",
"created_at": "2024-12-05T10:00:00Z",
"expires_at": null
}
Share URL format: https://app.alianzacap.com/coquititle/s/{share_id}
Get Shared Report (Unauthenticated)
GET
/coquititle/shares/{share_id}/reportAccess report via share link (no auth required)
Status Values
| Status | Description |
|---|---|
pending | Case created, no files uploaded |
uploaded | Files uploaded, processing not started |
processing_ocr | OCR in progress |
processing_extraction | Multi-pass extraction in progress |
processing_pending_docs | Pending documents processing |
building_title_state | Deterministic title derivation |
resolving_evidence | Evidence validation in progress |
generating_report | Multi-pass report generation |
completed | Processing complete, report available |
failed | Error occurred (see error_message) |
Errors
| Code | Meaning |
|---|---|
| 401 | Invalid/missing JWT |
| 404 | Case not found |
| 500 | Server error |
CORS
Allowed origins: https://app.alianzacap.com, http://localhost:3000