Skip to content

REST API Reference ​

DocIntel exposes a FastAPI REST API on port 8200. Interactive docs available at http://localhost:8200/docs.

Authentication ​

All endpoints require a Bearer token:

http
Authorization: Bearer <SERVER__API_KEY>

Set SERVER__API_KEY in your .env file.


Process a document ​

POST /process ​

Upload a file for extraction.

http
POST /process
Content-Type: multipart/form-data
Authorization: Bearer <token>

Form fields:

FieldTypeRequiredDescription
filefile✅Document to process
profilestring❌aec | contract | financial | scientific | general (auto-detected if omitted)
languagestring❌ISO 639-1 language code (e.g. de, fr, ja). Auto-detected if omitted. Activates language-specific extraction prompts for 75+ supported languages.
emitboolean❌Emit to Purple8 Graph on completion (default: true)
previewboolean❌Emit to /ingest/preview instead of /ingest/commit

Response:

json
{
  "job_id": "abc-123",
  "status": "queued",
  "created_at": "2026-04-01T12:00:00Z"
}

POST /process/url ​

Submit a URL for extraction. SSRF-guarded — RFC 1918, loopback, link-local, and cloud metadata endpoints are blocked.

http
POST /process/url
Content-Type: application/json
Authorization: Bearer <token>
json
{
  "url": "https://example.com/report.pdf",
  "profile": "scientific",
  "emit": true
}

Jobs ​

GET /jobs/{job_id} ​

Poll a job for status and results.

json
{
  "job_id": "abc-123",
  "status": "completed",
  "profile": "contract",
  "content_hash": "sha256:a1b2c3d4e5f6...",
  "entities": [
    {
      "type": "Party",
      "name": "Acme Corporation",
      "confidence": 0.74,
      "source_chunk_ids": ["chunk-0", "chunk-2"]
    }
  ],
  "relationships": [
    {
      "source": "Acme Corporation",
      "target": "GlobalTech Ltd",
      "type": "SIGNED_BY",
      "confidence": 0.67
    }
  ],
  "metadata": {
    "format": "pdf",
    "pages": 12,
    "language": "en",
    "processing_ms": 4230,
    "incremental_skip": false,
    "tables_injected": 3
  }
}

Status values: queued · running · completed · failed

Incremental processing

If the same document (by SHA-256 content hash) has already been processed, the job is completed instantly with "incremental_skip": true and the cached extraction result is returned. No LLM calls are made.


GET /jobs/{job_id}/stream ​

Stream partial results via Server-Sent Events as each chunk completes.

bash
curl -N http://localhost:8200/jobs/abc-123/stream \
  -H "Authorization: Bearer $API_KEY"

Event format:

event: entity
data: {"type":"Party","name":"Acme Corporation","confidence":0.94}

event: relationship
data: {"source":"Acme Corporation","target":"GlobalTech Ltd","type":"SIGNED_BY"}

event: done
data: {"job_id":"abc-123","status":"completed"}

GET /jobs ​

List recent jobs.

Query paramDefaultDescription
limit20Max jobs to return
statusallFilter by status
profileallFilter by profile

Connectors ​

POST /connectors/sync/sharepoint ​

Trigger a SharePoint library sync.

json
{
  "site_url": "https://myorg.sharepoint.com/sites/mysite",
  "library": "Documents",
  "profile": "general",
  "recursive": true
}

POST /connectors/sync/confluence ​

json
{
  "base_url": "https://myorg.atlassian.net/wiki",
  "space_key": "ENG",
  "profile": "scientific"
}

POST /connectors/sync/s3 ​

json
{
  "bucket": "my-bucket",
  "prefix": "reports/2026/",
  "glob": "*.pdf",
  "profile": "financial"
}

POST /connectors/webhook ​

Generic webhook — POST file bytes or a URL reference:

json
{
  "url": "https://internal-dms.example.com/doc/12345.docx",
  "profile": "contract",
  "metadata": {
    "source": "my-dms",
    "doc_id": "12345"
  }
}

Health & observability ​

EndpointDescription
GET /healthLiveness probe — returns {"status": "ok"}
GET /readyReadiness probe — checks LLM + Graph connectivity
GET /licenseLicense status — tier, quotas, features, expiry
GET /formatsList all supported document formats
GET /metricsPrometheus metrics
GET /docsSwagger UI (interactive API explorer)
GET /redocReDoc API documentation
GET /openapi.jsonOpenAPI schema

GET /license ​

Returns the current license status, including tier, features, quotas, and expiry information.

json
{
  "valid": true,
  "tier": "pro",
  "license_id": "abc-123",
  "org_name": "Acme Corp",
  "features": ["table_extraction", "multi_language", "confidence_calibration", "incremental_processing"],
  "quotas": {
    "documents_per_month": 5000,
    "workers": 8,
    "connectors": ["s3", "webhook", "sharepoint", "confluence"],
    "ocr_engines": ["tesseract", "azure_doc_intel", "google_vision", "textract"],
    "llm_providers": ["openai", "azure", "anthropic", "gemini", "ollama"]
  },
  "expires_at": "2027-04-07T00:00:00Z",
  "days_remaining": 365
}

If no license key is set, the server runs in unlicensed Beta mode with limited quotas (500 docs/month).


GET /ready ​

Readiness probe that verifies LLM and Graph connectivity.

json
{
  "status": "ready",
  "checks": {
    "llm": "ok",
    "graph": "ok"
  }
}

GET /formats ​

List all supported document formats with parser information.

json
{
  "formats": [
    {"format": "pdf", "extensions": [".pdf"], "parser": "PdfParser"},
    {"format": "docx", "extensions": [".docx", ".doc", ".odt"], "parser": "DocxParser"},
    ...
  ]
}

DELETE /jobs/{job_id} ​

Cancel or remove a job.

bash
curl -X DELETE http://localhost:8200/jobs/abc-123 \
  -H "Authorization: Bearer $API_KEY"
json
{
  "job_id": "abc-123",
  "status": "cancelled"
}

Purple8 DocIntel v0.12.5 · Universal Document Intelligence · NVIDIA Inception Member · Red Hat Technology Partner.