Docs

Documents API

Classification, digitization and validation entrypoints, and the retired upload route.

Trial and prepaid workspaces

The legacy standalone digitization path is unavailable for trial and prepaid workspaces. Use supported packet intake, where upload, preprocessing, and review share the durable processing controls. Existing authorized document reads remain available; prepaid capacity does not enable an unsupported adapter.

Deprecated compatibility adapters. The generic classify and digitize endpoints on this page are retained for pre-packet integrations, but new integrations should use the Packets API: Storage-native intake is the upload path (the inline base64 upload route was retired on 2026-09-30), the intake pipeline's sanitization/OCR supersedes generic digitization, and packet role results with cohort-gated automatic acceptance and human correction replace generic classification. The remaining adapters are removed only after a consumer-migration review (the PR11 legacy retirement decision); their access restrictions below continue to apply.

Upload Document (retired)

POST /api/v1/documents/upload was retired on 2026-09-30 (legacy register LEG-04) and now returns 404. It accepted a base64-encoded PDF of at most 3 MiB and stored the bytes inline. Upload documents through packet intake instead: create an intake, upload the file to the signed target (files up to 30 MB; accepted formats are listed there), then finalize it. Documents stored through the retired route stay readable.

Classify Document Text

POST /api/v1/documents/classify

Classifies raw markdown into known document types.

Body

{
  "text": "This Lease Agreement...",
  "model": "optional-model-override"
}

Response

{
  "documentType": "lease",
  "confidence": 0.92,
  "metadata": {
    "inputTokens": 1250,
    "outputTokens": 45,
    "durationMs": 890,
    "estimatedCostUsd": 0.0012
  }
}

Digitize Document

POST /api/v1/documents/digitize

Runs synchronous digitization for an accessible document id. Applicant-document digitization now resolves its byte source through the storage-native document source lane when the organization is in that cohort; otherwise it keeps the legacy source path. Every applicant digitization write remains pinned to the captured document generation.

Body

ParameterTypeRequiredDescription
documentIdstring (UUID)YesDocument to digitize. Any 8-4-4-4-12 hexadecimal ID is accepted, so older procedure documents keep their original IDs.
tableNamestringNoOne of: ix_applicant_documents, ix_procedure_documents. Defaults to ix_applicant_documents.
fileFormatstringNoFile format. Defaults to pdf when omitted.
utilitystringConditionalRequired only when tableName is ix_procedure_documents; optional for applicant documents.
modelstringNoModel override for digitization
{
  "documentId": "550e8400-e29b-41d4-a716-446655440000",
  "tableName": "ix_applicant_documents",
  "fileFormat": "pdf"
}

Retired Validation Endpoint

POST /api/v1/documents/validate

This compatibility route now returns authenticated HTTP 410 Gone with CAPABILITY_RETIRED. It does not create a validation job. Use packet intake Review for deterministic document review.

Access Rules

For digitize operations, document access is verified against the API key organization scope before execution. For exact-content hydration, the locked document must belong to that same non-null organization. The API-key creator's uploader identity does not grant access to a personal or foreign-organization document.

Salesforce-owned documents are read-only copies for ordinary processing. Generic digitization and document-bound job creation return 404 NOT_FOUND for them, and ordinary upload replacement cannot change their packet membership. Source changes must be captured by the connector rather than written into the copy; the Salesforce connector is implemented but disabled.

Packet document reads also check the viewer's current source permission before issuing access to a Salesforce-owned copy. Current document lists omit files removed from the current source revision; an authorized historical package can retain its original files without restoring them to the current packet.

Direct reports and selected package artifacts require current permission for the fields in every committed source revision, including old-only fields. More than 200 revisions or malformed history is refused without truncating the proof. A revoked old field can also deny a current view. See the connector acceptance gates.

Sanitized PDF reads use the logical version-row context when available. A selected project document therefore carries both the applicant document id and the current application_document_versions.id needed by the resolver-backed PDF route.

On this page