API Reference

Documents API

Query, filter, retrieve, and upload clinical PDF documents and inbound faxes via the Intellectua REST API.

GET
/v1/documentsList all documents

Query Parameters

statusstring

Filter by status: RECEIVED, PROCESSING, NEEDS_REVIEW, READY_FOR_FILING, FILED

limitinteger

Number of records to return (default: 50, max: 100)

offsetinteger

Pagination offset index (default: 0)

labelIdstring

Filter documents containing this specific label ID

Response Fields

data[].idstring
data[].directionenum
data[].carrierstring
data[].documentStatusstring
data[].patientNamestring | null
data[].aiConfidencefloat
data[].labelsarray
pagination.totalinteger
Example Response Payload200 OK
{
  "data": [
    {
      "id": "doc_9f8e7d6c5b4a",
      "direction": "INBOUND",
      "carrier": "SINCH",
      "documentStatus": "RECEIVED",
      "priority": "ROUTINE",
      "sourceNumber": "+15552345678",
      "destinationNumber": "+15559876543",
      "pageCount": 4,
      "aiConfidence": 0.98,
      "aiSummary": "Patient referral for orthopedic knee evaluation with prior MRI records.",
      "patientName": "Jane Doe",
      "patientDob": "1984-06-12T00:00:00.000Z",
      "labels": [
        { "id": "lbl_ortho", "name": "Orthopedics", "color": "#3b82f6" },
        { "id": "lbl_referral", "name": "New Referral", "color": "#10b981" }
      ],
      "assignedUsers": [
        { "id": "usr_dr_smith", "name": "Dr. Alan Smith", "email": "[email protected]" }
      ],
      "receivedAt": "2026-09-21T14:32:00.000Z"
    }
  ],
  "pagination": {
    "total": 142,
    "limit": 20,
    "offset": 0,
    "hasMore": true
  }
}
GET
/v1/documents/:idGet single document details

Parameters

:idPath Param • Required string

The unique identifier of the target document.

versionQuery Param • integer

Optional specific version number (e.g. 1). When provided, returns that version in selectedVersion and points downloadUrl to it. Defaults to latest version.

Document Versioning & Previous Versions

All document revisions (e.g. original upload, signed/annotated revisions, stamped copies) are preserved in the versions array. Each version item includes its dedicated downloadUrl so you can retrieve or download any historical version at any time.

Clinical Extracted Schema

When AI extraction completes, structured clinical fields (diagnoses, referring doctor, MRN, insurance) are decrypted and returned inside the extractedData object.

Example Single Document Response200 OK
{
  "id": "doc_9f8e7d6c5b4a",
  "direction": "INBOUND",
  "carrier": "SINCH",
  "documentStatus": "NEEDS_SIGNATURE",
  "priority": "URGENT",
  "sourceNumber": "+15552345678",
  "destinationNumber": "+15559876543",
  "pageCount": 2,
  "aiConfidence": 0.99,
  "patientName": "Robert Chen",
  "extractedData": {
    "patientMrn": "MRN-884920",
    "referringDoctor": "Dr. Clara Oswald",
    "icd10Codes": ["M25.561", "M17.11"],
    "documentCategory": "CONSULTATION_REPORT",
    "urgencyLevel": "URGENT"
  },
  "labels": [
    { "id": "lbl_urg", "name": "Urgent", "color": "#ef4444" }
  ],
  "downloadUrl": "/v1/documents/doc_9f8e7d6c5b4a/download",
  "selectedVersion": {
    "id": "ver_01",
    "versionNumber": 2,
    "fileSizeBytes": 251400,
    "mimeType": "application/pdf",
    "isOriginal": false,
    "isSigned": true,
    "downloadUrl": "/v1/documents/doc_9f8e7d6c5b4a/download?version=2",
    "createdAt": "2026-09-22T09:15:00.000Z"
  },
  "versions": [
    {
      "id": "ver_02",
      "versionNumber": 2,
      "fileSizeBytes": 251400,
      "mimeType": "application/pdf",
      "isOriginal": false,
      "isSigned": true,
      "downloadUrl": "/v1/documents/doc_9f8e7d6c5b4a/download?version=2",
      "createdAt": "2026-09-22T09:15:00.000Z"
    },
    {
      "id": "ver_01",
      "versionNumber": 1,
      "fileSizeBytes": 248910,
      "mimeType": "application/pdf",
      "isOriginal": true,
      "isSigned": false,
      "downloadUrl": "/v1/documents/doc_9f8e7d6c5b4a/download?version=1",
      "createdAt": "2026-09-21T18:10:00.000Z"
    }
  ],
  "receivedAt": "2026-09-21T18:10:00.000Z"
}
GET
/v1/documents/:id/downloadDownload document PDF & previous versions

Parameters

:idPath Param • Required string

The unique identifier of the target document.

versionQuery Param • integer

The specific version number to download (e.g. ?version=1 for original upload, ?version=2 for signed copy). When omitted, automatically streams the latest version.

Binary Response Details

Content-Typeapplication/pdf
Content-Dispositioninline; filename="document_v1.pdf"
Cache-Controlprivate, max-age=300
Endpoint Alias/v1/documents/:id/file
Example Download Commands200 Binary PDF
# 1. Download Latest Version
curl -X GET "https://api.intellectua.ai/v1/documents/doc_9f8e7d6c5b4a/download" \
  -H "x-api-key: YOUR_API_KEY" \
  --output document_latest.pdf

# 2. Download Specific Historical Version (e.g. Version 1)
curl -X GET "https://api.intellectua.ai/v1/documents/doc_9f8e7d6c5b4a/download?version=1" \
  -H "x-api-key: YOUR_API_KEY" \
  --output document_v1.pdf

# HTTP Response Headers:
# HTTP/1.1 200 OK
# Content-Type: application/pdf
# Content-Disposition: inline; filename="document_v1.pdf"
# Content-Length: 248910
# Cache-Control: private, max-age=300
POST
/v1/documents/uploadUpload PDF document

Multipart Form Parameters

fileRequired Binary (PDF)

The PDF binary stream to upload. Max file size: 50MB.

Example Upload Response201 Created
{
  "id": "doc_b8374a910e2f",
  "status": "RECEIVED",
  "receivedAt": "2026-09-21T21:45:00.000Z"
}