API Quick Start
Create an API key from API Access, then send it in the x-api-key header. The API Access page also shows active keys and key status.
Choose how layout analysis runs
- Preferred consumer-layout path: analyze the PDF with
prebuilt-layout, wait for succeeded, and pass the operation response or its analyzeResult in layoutResult. - Automatic fallback path: omit
layoutResult and include the PDF. Doclligence runs prebuilt-layout internally. - When supplying a layout, keep page numbers, dimensions, units, words, polygons, tables, paragraphs, and bounding regions unchanged.
A supplied layout avoids another MSDI analysis call. For redaction, a supplied layout must come from the same PDF included in the request.
Supply either layoutResult, or fileBase64 for automatic layout analysis. If both are supplied, Doclligence uses layoutResult and does not re-analyze the document.
POST https://your-doclligence-domain/api/v1/extract-table
x-api-key: YOUR_API_KEY
Content-Type: application/json
{
"fileName": "invoice.pdf",
"layoutResult": MSDI_OPERATION_RESULT_OBJECT,
"columns": "Description, GST, Total",
"instructions": "Merge continuation lines into the prior priced row."
}layoutResult: optional MSDI JSON object.fileBase64: required only when layoutResult is omitted.columns: comma-separated output column names.instructions: optional extraction and table-continuation guidance.
Table extraction without a consumer layout
{
"fileName": "invoice.pdf",
"fileBase64": "BASE64_PDF_CONTENT",
"fileMimeType": "application/pdf",
"columns": "Description, GST, Total",
"instructions": "Merge continuation lines into the prior priced row."
}Sample extract-table response
{
"providerMode": "live",
"fileName": "invoice.pdf",
"requestedColumns": ["Description", "GST", "Total"],
"htmlTable": "<table>...</table>",
"json": [
{
"Description": "Service fee - February",
"GST": "8.18",
"Total": "90.00"
}
],
"csv": "\"Description\",\"GST\",\"Total\"\n\"Service fee - February\",\"8.18\",\"90.00\"",
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rows>...</rows>",
"warnings": [
"Selected table span pages: 1",
"Discovery reasoning: Best matching invoice line table."
],
"outputFiles": [
{
"name": "invoice.json",
"mimeType": "application/json;charset=utf-8",
"content": "[...]"
}
],
"details": {
"rowCount": 1,
"columnCount": 3,
"cells": [
{
"rowIndex": 0,
"columnIndex": 0,
"columnName": "Description",
"content": "Service fee - February",
"boundingBox": {
"pageNumber": 1,
"left": 104,
"top": 322,
"width": 210,
"height": 18
}
}
]
},
"usage": {
"documentCount": 12,
"remainingDocuments": 0,
"documentLimit": 10,
"pagesUsed": 42,
"remainingPages": 108,
"pageLimit": 150,
"pagesProcessed": 2
}
}Redact PDF
Redaction requires the original document to render masks. Images are normalized into PDF pages and the result is always a flattened PDF.
POST https://your-doclligence-domain/api/v1/redact
x-api-key: YOUR_API_KEY
Content-Type: application/json
{
"fileName": "document.pdf",
"fileBase64": "BASE64_PDF_CONTENT",
"fileMimeType": "application/pdf",
"layoutResult": MSDI_OPERATION_RESULT_OBJECT,
"prompt": "Find and redact customer names and dates of birth.",
"email": "recipient@example.com",
"color": "#000000",
"opacity": 1,
"searchablePdf": true
}fileBase64: required original PDF, JPEG, PNG, or TIFF, as raw base64 or a data URL.fileMimeType: recommended for raw base64 and inferred from a data URL when present.layoutResult: optional MSDI JSON object generated from that document.prompt: required description of information to find and mask.email: optional delivery address.color: optional mask color.opacity: optional value from 0.1 to 1. Use 1 to fully conceal the original value.searchablePdf: optional boolean. When true, adds an invisible text layer from non-redacted MSDI words; words intersecting redaction boxes are excluded.- The request is rejected when the document and layout page counts differ.
Sample redact response
{
"providerMode": "live",
"fileName": "document.pdf",
"prompt": "Find and redact customer names and dates of birth.",
"findings": [
{
"text": "Jane Citizen",
"type": "Customer Name",
"page": 1,
"boundingBox": {
"left": 112,
"top": 148,
"width": 156,
"height": 24
}
}
],
"summary": {
"totalFindings": 1,
"pagesImpacted": 1
},
"style": {
"color": "#000000",
"opacity": 1
},
"searchablePdf": true,
"download": {
"name": "document-redacted.pdf",
"mimeType": "application/pdf",
"content": "BASE64_REDACTED_PDF_CONTENT"
},
"emailDelivery": {
"requested": true,
"recipient": "recipient@example.com",
"mode": "graph"
},
"usage": {
"documentCount": 13,
"remainingDocuments": 0,
"documentLimit": 10,
"pagesUsed": 45,
"remainingPages": 105,
"pageLimit": 150,
"pagesProcessed": 3
}
}API responses include the processed result and current page usage. Usage is based on the supplied layout page count or, when layout is omitted, the PDF page count. Redaction responses include the redacted PDF as base64 in download.content.
Accepted layoutResult shapes
// Complete MSDI operation response
{
"status": "succeeded",
"apiVersion": "2024-11-30",
"analyzeResult": {
"modelId": "prebuilt-layout",
"pages": [ ... ],
"tables": [ ... ],
"paragraphs": [ ... ]
}
}
// Or the analyzeResult object itself
{
"modelId": "prebuilt-layout",
"pages": [ ... ],
"tables": [ ... ],
"paragraphs": [ ... ]
}Common API errors
400: invalid layoutResult; neither layout nor PDF supplied for extraction; missing redaction PDF or prompt; mismatched page counts; or a signature-search PDF over 10 pages.401: missing, invalid, or revoked API key.429: insufficient remaining page allowance.500: processing or provider failure.
Option 1 API: Compare Two Signature Snippets
Use this endpoint when you already have two cropped signature images and want a similarity assessment.
POST https://your-doclligence-domain/api/v1/verify-signature
x-api-key: YOUR_API_KEY
Content-Type: application/json
{
"signatureA": "BASE64_IMAGE_CONTENT_OR_DATA_URL",
"signatureAMimeType": "image/png",
"signatureB": "BASE64_IMAGE_CONTENT_OR_DATA_URL",
"signatureBMimeType": "image/png"
}Sample verify-signature response
{
"providerMode": "live",
"matchConfidence": 78,
"decision": "possible_match",
"reasoning": "The signatures share similar slant and overall rhythm, but there are visible differences in stroke endings and letter connections.",
"observations": [
"Both signatures have a similar left-to-right baseline.",
"The initial stroke shape is similar.",
"The ending flourish differs in length and angle."
],
"risks": [
"Image quality and cropping can affect confidence.",
"This is not a forensic conclusion."
],
"usage": {
"documentCount": 13,
"remainingDocuments": 0,
"documentLimit": 10,
"pagesUsed": 46,
"remainingPages": 104,
"pageLimit": 150,
"pagesProcessed": 1
}
}Option 2 API: Find a Signature in a PDF
Use this endpoint with one source signature and a target PDF of up to 10 pages. Larger PDFs return 400 before AI processing and do not consume page usage. When multiple candidates are found, they are compared and calibrated together before being ranked by confidence. Only detections with match confidence strictly above 50% are returned. The summary is calculated from that filtered list; when no confident match exists, detections is empty, confidence is 0, and page is null.
POST https://your-doclligence-domain/api/v1/find-signatures
x-api-key: YOUR_API_KEY
Content-Type: application/json
{
"fileName": "contract.pdf",
"fileBase64": "BASE64_PDF_CONTENT",
"sourceSignature": "BASE64_IMAGE_CONTENT_OR_DATA_URL",
"sourceSignatureMimeType": "image/png"
}Sample find-signatures response
{
"providerMode": "live",
"fileName": "contract.pdf",
"detections": [
{
"pageNumber": 4,
"boundingBox": {
"left": 120,
"top": 650,
"width": 240,
"height": 70
},
"signatureImageBase64": "BASE64_CROPPED_SIGNATURE_IMAGE",
"signatureImageMimeType": "image/png",
"matchConfidence": 88,
"decision": "possible_match",
"reasoning": "The candidate has similar baseline, slant, and ending flourish, but the middle strokes differ.",
"observations": [
"Similar left-to-right slope",
"Comparable initial stroke height"
],
"risks": [
"PDF scan quality may affect comparison",
"This is not a forensic conclusion"
]
}
],
"summary": {
"candidateSignaturesFound": 1,
"bestMatchConfidence": 88,
"bestMatchPage": 4
},
"warnings": [
"Azure returned 1 cropped figure candidate(s).",
"Only detections above 50% confidence are returned."
],
"usage": {
"pagesUsed": 50,
"remainingPages": 100,
"pageLimit": 150,
"pagesProcessed": 4
}
}