Developers/REST API

Application integration

DocIntel REST API

Build ingestion, knowledge, media, workflow, and operational experiences through versioned, OAuth-secured HTTP contracts.

Base URL

Request conventions

Public APIhttps://docintel.adar.agomoniai.com/api/v1
OpenAPIhttps://docintel.adar.agomoniai.com/openapi.json
Authenticated request
curl https://docintel.adar.agomoniai.com/api/v1/documents \
  -H "Authorization: Bearer $DOCINTEL_ACCESS_TOKEN" \
  -H "X-DocIntel-Workspace-ID: $WORKSPACE_ID" \
  -H "Accept: application/json" \
  -H "X-Request-Id: $REQUEST_ID"

Send JSON unless an upload contract specifies multipart or a signed-cloud transfer. Retain the request ID and any returned operation ID for support and trace correlation.

API families

Coverage

Workspaces

Membership, roles, shared and personal workspaces, and authorization context.

Documents

Upload initiation, metadata, classification, embedding, status, and lifecycle management.

Knowledge

Grounded questions, summaries, comparisons, citations, and session-aware context.

Knowledge Academy

Courses, curriculum, multimodal learning scope, AI Tutor, study tools, quizzes, progress, and human guidance.

Media

Conversation transcripts, audio, large video, timelines, frames, and processing progress.

Workflows

Run vertical workflows, review findings, approve outputs, and manage PDF packets.

Batch

Multi-document ingestion, bulk classification, embedding, summaries, retry, and status.

Contract index

Public REST surface

Every route below is implemented under /api/v1. Select a family to move directly to its endpoint and data contracts.

Authorization has two dimensions

The OAuth scope permits an operation. User membership, application workspace grants, role, and resource ownership determine which data the operation can reach. Sending a workspace ID never grants access by itself.

Identity and discovery

Discover the caller and API surface

MethodPathScopeResponse contract
GET/documents:readAPI name, version, client ID, granted scopes, and capability links.
GET/meAuthenticateddata.{user_id,email,full_name,role,client_id,scopes,workspace_count}

Workspace contracts

Personal context, teams, and membership

MethodPathScopeContract
GET/me/workspacesworkspaces:readPersonal context plus owned and shared team workspaces.
POST/workspace-contextworkspaces:read{workspace_id|null} returns selected context and header value.
GET/workspacesworkspaces:readAccessible workspace collection in data.
POST/workspacesworkspaces:write{name}; returns HTTP 201 and created workspace.
GET/workspaces/{workspace_id}workspaces:readWorkspace metadata, ownership, membership, and counts.
PATCH/workspaces/{workspace_id}workspaces:write{name}; owner/editor policy is enforced.
DELETE/workspaces/{workspace_id}workspaces:writeDeletes an authorized team workspace.
GET/workspaces/{workspace_id}/documentsdocuments:readDocuments visible in the selected team workspace.
POST/workspaces/{workspace_id}/membersworkspaces:write{email,role}; HTTP 201 with active membership.
PATCH/workspaces/{workspace_id}/members/{user_id}workspaces:write{role} updates membership authorization.
DELETE/workspaces/{workspace_id}/members/{user_id}workspaces:writeRemoves an authorized member.
POST/workspaces/{workspace_id}/leaveworkspaces:writeRemoves the current principal from the workspace.

Document and upload contracts

Move bytes directly, then manage knowledge assets

MethodPathScopeContract
GET/documentsdocuments:readdata[] plus personal or team workspace context.
GET/documents/{document_id}documents:readDocument metadata, classification, status, counts, and timestamps.
GET/documents/{document_id}/chunksdocuments:readAuthorized extracted chunks and chunk metadata.
POST/uploadsdocuments:writeUpload manifest; HTTP 201 returns signed PUT URL, document ID, path, headers, and expiry.
POST/uploads/completedocuments:writeCompletion manifest; HTTP 202 returns document ID and chunking state.
POST/documents/{document_id}/embeddingdocuments:writeHTTP 202; starts embedding after chunk readiness.
DELETE/documents/{document_id}documents:writeDeletes authorized metadata, vectors, chunks, and stored artifacts according to lifecycle policy.
POST/documents/{document_id}/versionsversions:writeRegisters lineage, previous document, change summary, and changed pages.
GET/documents/{document_id}/versionsversions:readVersion and lineage records.
Video uses its dedicated durable upload workflow

The generic document upload contract rejects video content. Large video upload and processing remain specialized operations so file transfer, worker leases, checkpoints, transcript chunks, sampled frames, and progress can be managed independently.

Knowledge contracts

Grounded response streams

MethodPathScopeContract
POST/knowledge/query/streamknowledge:queryChatRequest; SSE emits token, done, and error events with grounded result metadata.
POST/summaries/documents/{document_id}/streamknowledge:generateSummarizeRequest; SSE emits map/reduce metadata, tokens, done, and error events.
SSE event contract
data: {"type":"token","text":"..."}

data: {"type":"done","answer":"...","sources":[...],"trace_id":"..."}

data: {"type":"error","error":"..."}

Clients must parse complete SSE frames rather than treating transport chunks as JSON boundaries. Preserve citations, source identifiers, timestamps, and trace IDs returned by the terminal event.

Knowledge Academy contracts

Governed learning from enterprise knowledge

MethodPathScopeContract
GET/learning/courseslearning:readList accessible courses in the selected workspace.
POST/learning/courseslearning:manageCourseCreate; creates a course and enrolls its creator as teacher.
GET/learning/courses/{course_id}learning:readReturns the course workspace, curriculum, assets, artifacts, attempts, and questions.
PATCH/learning/courses/{course_id}learning:manageCourseUpdate; updates metadata or lifecycle status.
DELETE/learning/courses/{course_id}learning:manageDeletes the course and dependent learning records.
GET/learning/courses/{course_id}/scopelearning:readResolves course, module, or lesson evidence and grounding instructions.
POST/learning/courses/{course_id}/memberslearning:manageMemberCreate; enrolls an existing workspace member.
DELETE/learning/courses/{course_id}/members/{user_id}learning:manageRemoves course enrollment without removing workspace membership.
PUT/learning/courses/{course_id}/curriculumlearning:manageCurriculumSave; replaces ordered modules and lessons.
GET/learning/documentslearning:readLists workspace documents, audio, and video eligible for attachment.
POST/learning/courses/{course_id}/assetslearning:manageAssetCreate; maps content to a course, module, or lesson.
DELETE/learning/courses/{course_id}/assets/{asset_id}learning:manageDetaches content while preserving the source DocIntel asset.
POST/learning/courses/{course_id}/tutor/query/streamlearning:participateLearningTutorRequest; streams an answer grounded only in resolved learning scope.
POST/learning/courses/{course_id}/artifactslearning:participateArtifactCreate; persists summaries, guides, concepts, flashcards, or interactive quizzes.
GET/learning/courses/{course_id}/artifactslearning:readLists the caller's saved learning materials.
DELETE/learning/courses/{course_id}/artifacts/{artifact_id}learning:participateDeletes a caller-authorized study artifact.
POST/learning/courses/{course_id}/artifacts/{artifact_id}/attemptslearning:participateQuizAttemptCreate; grades and persists selected option IDs.
GET/learning/courses/{course_id}/progresslearning:readReturns learner or educator-visible completion and quiz performance.
POST/learning/courses/{course_id}/questionslearning:participateQuestionCreate; escalates a question to a teacher or advisor.
PATCH/learning/courses/{course_id}/questions/{question_id}learning:participateQuestionUpdate; answers, reassigns, or closes a question.
Explicit team workspace context is required

Knowledge Academy endpoints require X-DocIntel-Workspace-ID. OAuth scope authorizes the action; workspace membership, application grants, course persona, and ownership constrain its data.

Batch contracts

Durable multi-item execution

MethodPathScopeContract
POST/batches/uploadsbatches:writeBatchUploadRequest; HTTP 201 returns job ID and one signed upload contract per file.
POST/batches/{job_id}/uploads/completebatches:writeSelected document IDs and concurrency; HTTP 202 queues verification and ingestion.
POST/batches/embeddingbatches:writeDocumentBatchRequest; HTTP 202 returns queued job and total items.
POST/batches/classificationbatches:writeDocumentBatchRequest; HTTP 202 returns queued job and total items.
POST/batches/workspace-summarybatches:writeWorkspaceSummaryRequest; HTTP 202 returns queued summary job.
GET/batchesbatches:readFilter by workspace, operation, status, and limit 1-100.
GET/batches/{job_id}batches:readJob, progress, stage, counters, configuration, and item states.
GET/batches/{job_id}/resultsbatches:readTerminal result plus per-item output, attempts, and errors.
POST/batches/{job_id}/retrybatches:writeHTTP 202; requeues failed items only.
POST/batches/{job_id}/resumebatches:writeHTTP 202; resumes from retained job/item state.
POST/batches/{job_id}/cancelbatches:writeHTTP 202; requests cancellation and skips queued items.

Operations and workflow contracts

Discover schemas and normalize status

MethodPathScopeContract
GET/operations/catalogworkflows:readContract version, enterprise capabilities, and available workflow definitions.
GET/operationsbatches:readNormalized operation views filtered by workspace, status, and limit.
GET/operations/{operation_id}batches:readNormalized status with progress, current step, counters, items, result, and error.
GET/workflows/{workflow}/schemaworkflows:readRequired inputs, version, vertical, review requirement, and packet types.
POST/workflows/{workflow}/validateworkflows:readValidates a workflow payload without starting a run.

Workflow identifiers currently include healthcare_clinical, healthcare_prior_auth, finance_tax_readiness, talent_readiness, employee_mobility, and lease_intelligence.

Events and delivery contracts

Subscribe, inspect, and replay

MethodPathScopeContract
GET/eventsevents:readCursor-style event list with resource filters and limit 1-500.
POST/event-subscriptionsevents:writeSubscriptionInput; HTTP 201 returns subscription and one-time signing material where applicable.
GET/event-subscriptionsevents:readAuthorized subscriptions and filters.
DELETE/event-subscriptions/{subscription_id}events:writeRemoves the subscription.
GET/webhook-deliveriesevents:readDelivery history filtered by subscription/status, limit 1-500.
POST/webhook-deliveries/{delivery_id}/retryevents:writeHTTP 202; resets and requeues one failed delivery.
POST/webhook-deliveries/process-dueevents:writeHTTP 202; schedules up to 200 due deliveries.
POST/events/{event_id}/replayevents:writeHTTP 202; recreates matching deliveries idempotently.
Open signature and delivery guidance

Human review and governance

Keep generated intelligence accountable

MethodPathScopeContract
POST/reviewsreviews:writeReviewTaskInput; HTTP 201 creates a governed review task.
GET/reviewsreviews:writeReview tasks filtered by status and limit.
POST/reviews/{task_id}/assignreviews:writeAssigns the current authorized reviewer.
POST/reviews/{task_id}/decisionreviews:approve{decision,reviewer_notes} records approval, requested changes, or rejection.
POST/artifactsartifacts:writeArtifactInput; HTTP 201 stores a draft, reviewed, or approved knowledge artifact.
GET/artifactsartifacts:readArtifacts filtered by workspace.
POST/evaluationsevaluations:run{trace_id,evaluation_type}; HTTP 201 correlates quality evaluation with a trace.

Request data contracts

Canonical JSON models

These fields mirror the public API request models. Optional fields are shown with their defaults.

DirectUploadSessionRequestDocument upload
{
  "filename": "policy.pdf",
  "content_type": "application/pdf",
  "file_size": 348120,
  "workspace_id": "uuid-or-null",
  "redact_pii": false
}

Completion adds doc_id and gcs_source_path returned by the initiation call.

ChatRequestGrounded query
{
  "question": "What are the renewal risks?",
  "document_ids": ["document-uuid"],
  "history": [],
  "workspace_id": "uuid-or-null",
  "redact_pii": false,
  "agent_mode": "auto"
}

agent_mode accepts auto, off, or force.

SummarizeRequestDocument summary
{
  "summary_type": "executive",
  "custom_prompt": "",
  "chunk_indices": [],
  "redact_pii": false
}

Supported product styles include executive, detailed, bullets, sections, and custom where enabled.

Knowledge Academy modelsCourse and learning workflow
{
  "workspace_id": "workspace-uuid",
  "title": "Enterprise RAG Foundations",
  "course_code": "AI-101",
  "semester": "Fall 2026",
  "description": "Evidence-grounded learning across multimodal content.",
  "instructor_name": "Course Instructor",
  "objectives": ["Explain hybrid retrieval", "Evaluate grounded answers"]
}

{
  "question": "What is discussed in this lesson?",
  "module_id": "module-uuid",
  "lesson_id": "lesson-uuid",
  "history": [],
  "response_language": "en",
  "redact_pii": false
}

Generated OpenAPI schemas also define course updates, enrollment, curriculum, asset mapping, artifacts, quiz attempts, and teacher or advisor questions.

DocumentBatchRequestClassify or embed
{
  "document_ids": ["document-uuid"],
  "workspace_id": "uuid-or-null",
  "concurrency": 3,
  "force": false,
  "idempotency_key": "client-operation-key"
}

Concurrency is bounded from 1 through 10.

BatchUploadRequestMultiple signed uploads
{
  "files": [{
    "filename": "statement.pdf",
    "content_type": "application/pdf",
    "file_size": 348120
  }],
  "workspace_id": "uuid-or-null",
  "redact_pii": false,
  "idempotency_key": "client-operation-key"
}

The response includes one document ID, signed URL, cloud path, method, and required headers per file.

WorkspaceSummaryRequestLarge workspace summary
{
  "workspace_id": "workspace-uuid",
  "document_ids": [],
  "summary_type": "executive",
  "custom_prompt": "",
  "redact_pii": false,
  "language": "en",
  "concurrency": 2,
  "idempotency_key": "client-operation-key"
}

Concurrency is bounded from 1 through 6; an empty document list selects accessible ready documents.

SubscriptionInputEvents and webhooks
{
  "event_types": ["document.embedded"],
  "workspace_id": "uuid-or-null",
  "resource_type": null,
  "resource_id": null,
  "webhook_url": "https://example.com/docintel/events"
}

Use an empty event type list only when the intended subscription semantics are understood.

ReviewTaskInputHuman review
{
  "vertical": "healthcare",
  "run_id": "workflow-run-id",
  "title": "Review prior authorization packet",
  "workspace_id": "uuid-or-null",
  "priority": "normal",
  "due_at": null,
  "metadata": {}
}

Priority accepts low, normal, high, or urgent.

ArtifactInputGoverned knowledge output
{
  "artifact_type": "advisor_packet",
  "title": "Reviewed advisor packet",
  "content": {},
  "workspace_id": "uuid-or-null",
  "source_document_ids": [],
  "source_trace_id": null,
  "status": "draft"
}

Status accepts draft, reviewed, or approved.

VersionInput and EvaluationInputLineage and quality
{
  "previous_document_id": "uuid-or-null",
  "change_summary": "Reviewer corrections",
  "changed_pages": [1, 3]
}

{
  "trace_id": "trace-id",
  "evaluation_type": "groundedness"
}

Version lineage and evaluation correlation remain separate governed records.

Executable examples

cURL command library

These examples cover every public endpoint listed above. Define the shared values once, open the relevant family, and replace sample identifiers with values returned by your environment.

Shared environment
export API="https://docintel.adar.agomoniai.com/api/v1"
export DOCINTEL_ACCESS_TOKEN="YOUR_REST_AUDIENCE_ACCESS_TOKEN"
export WORKSPACE_ID="YOUR_TEAM_WORKSPACE_UUID"
export DOCUMENT_ID="YOUR_DOCUMENT_UUID"
export COURSE_ID="YOUR_COURSE_UUID"
export MODULE_ID="YOUR_MODULE_UUID"
export LESSON_ID="YOUR_LESSON_UUID"
export AUTH="Authorization: Bearer $DOCINTEL_ACCESS_TOKEN"
export WS="X-DocIntel-Workspace-ID: $WORKSPACE_ID"
export JSON="Content-Type: application/json"
REST audience required

Generate the token for https://docintel.adar.agomoniai.com/api/v1. An MCP-audience token is intentionally rejected. Omit -H "$WS" when operating in the caller's personal workspace.

Identity and discovery2 endpoints
Catalog and current principal
# GET / - API catalog
curl -sS "$API" \
  -H "$AUTH" | jq

# GET /me - authenticated principal and effective scopes
curl -sS "$API/me" \
  -H "$AUTH" | jq
Workspaces and membership12 endpoints
Workspace commands
# GET /me/workspaces - personal and team contexts
curl -sS "$API/me/workspaces" \
  -H "$AUTH" | jq

# POST /workspace-context - validate and select a team context
curl -sS -X POST "$API/workspace-context" \
  -H "$AUTH" -H "$JSON" \
  --data "{\"workspace_id\":\"$WORKSPACE_ID\"}" | jq

# GET /workspaces - accessible team workspaces
curl -sS "$API/workspaces" \
  -H "$AUTH" | jq

# POST /workspaces - create a team workspace
curl -sS -X POST "$API/workspaces" \
  -H "$AUTH" -H "$JSON" \
  --data '{"name":"Procurement Planning"}' | jq

# GET /workspaces/{workspace_id}
curl -sS "$API/workspaces/$WORKSPACE_ID" \
  -H "$AUTH" -H "$WS" | jq

# PATCH /workspaces/{workspace_id}
curl -sS -X PATCH "$API/workspaces/$WORKSPACE_ID" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"name":"FY27 Procurement Planning"}' | jq

# DELETE /workspaces/{workspace_id}
curl -sS -X DELETE "$API/workspaces/$WORKSPACE_ID" \
  -H "$AUTH" -H "$WS" | jq

# GET /workspaces/{workspace_id}/documents
curl -sS "$API/workspaces/$WORKSPACE_ID/documents" \
  -H "$AUTH" -H "$WS" | jq

# POST /workspaces/{workspace_id}/members
curl -sS -X POST "$API/workspaces/$WORKSPACE_ID/members" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"email":"reviewer@example.com","role":"viewer"}' | jq

export MEMBER_USER_ID="MEMBER_USER_UUID"

# PATCH /workspaces/{workspace_id}/members/{user_id}
curl -sS -X PATCH "$API/workspaces/$WORKSPACE_ID/members/$MEMBER_USER_ID" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"role":"editor"}' | jq

# DELETE /workspaces/{workspace_id}/members/{user_id}
curl -sS -X DELETE "$API/workspaces/$WORKSPACE_ID/members/$MEMBER_USER_ID" \
  -H "$AUTH" -H "$WS" | jq

# POST /workspaces/{workspace_id}/leave
curl -sS -X POST "$API/workspaces/$WORKSPACE_ID/leave" \
  -H "$AUTH" -H "$WS" | jq

Run destructive workspace and membership examples only against a disposable test workspace.

Documents, uploads, and versions9 endpoints
Document commands
# GET /documents - documents in selected context
curl -sS "$API/documents" \
  -H "$AUTH" -H "$WS" | jq

# GET /documents/{document_id}
curl -sS "$API/documents/$DOCUMENT_ID" \
  -H "$AUTH" -H "$WS" | jq

# GET /documents/{document_id}/chunks
curl -sS "$API/documents/$DOCUMENT_ID/chunks" \
  -H "$AUTH" -H "$WS" | jq

export FILE_PATH="./sample-policy.pdf"
export FILE_NAME="$(basename "$FILE_PATH")"
export FILE_SIZE="$(wc -c < "$FILE_PATH" | tr -d ' ')"

# POST /uploads - create a signed upload contract
UPLOAD_SESSION="$(curl -sS -X POST "$API/uploads" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn \
    --arg filename "$FILE_NAME" \
    --argjson file_size "$FILE_SIZE" \
    --arg workspace_id "$WORKSPACE_ID" \
    '{filename:$filename,content_type:"application/pdf",file_size:$file_size,workspace_id:$workspace_id,redact_pii:false}')")"
echo "$UPLOAD_SESSION" | jq

export DOCUMENT_ID="$(echo "$UPLOAD_SESSION" | jq -r '.doc_id')"
export UPLOAD_URL="$(echo "$UPLOAD_SESSION" | jq -r '.upload_url')"
export GCS_SOURCE_PATH="$(echo "$UPLOAD_SESSION" | jq -r '.gcs_source_path')"

# Transfer bytes directly to cloud storage
curl -sS -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/pdf" \
  --upload-file "$FILE_PATH"

# POST /uploads/complete - verify upload and start chunking
curl -sS -X POST "$API/uploads/complete" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn \
    --arg doc_id "$DOCUMENT_ID" \
    --arg filename "$FILE_NAME" \
    --argjson file_size "$FILE_SIZE" \
    --arg workspace_id "$WORKSPACE_ID" \
    --arg path "$GCS_SOURCE_PATH" \
    '{doc_id:$doc_id,filename:$filename,content_type:"application/pdf",file_size:$file_size,workspace_id:$workspace_id,redact_pii:false,gcs_source_path:$path}')" | jq

# POST /documents/{document_id}/embedding
curl -sS -X POST "$API/documents/$DOCUMENT_ID/embedding" \
  -H "$AUTH" -H "$WS" | jq

# POST /documents/{document_id}/versions
curl -sS -X POST "$API/documents/$DOCUMENT_ID/versions" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"previous_document_id":null,"change_summary":"Initial reviewed version","changed_pages":[1,3]}' | jq

# GET /documents/{document_id}/versions
curl -sS "$API/documents/$DOCUMENT_ID/versions" \
  -H "$AUTH" -H "$WS" | jq

# DELETE /documents/{document_id}
curl -sS -X DELETE "$API/documents/$DOCUMENT_ID" \
  -H "$AUTH" -H "$WS" | jq
Knowledge streams2 endpoints
Q&A and summarization
# POST /knowledge/query/stream - grounded SSE response
curl -sS -N -X POST "$API/knowledge/query/stream" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  -H "Accept: text/event-stream" \
  --data "$(jq -cn \
    --arg question "Summarize the key obligations and risks." \
    --arg document_id "$DOCUMENT_ID" \
    --arg workspace_id "$WORKSPACE_ID" \
    '{question:$question,document_ids:[$document_id],history:[],workspace_id:$workspace_id,redact_pii:false,agent_mode:"auto"}')"

# POST /summaries/documents/{document_id}/stream
curl -sS -N -X POST "$API/summaries/documents/$DOCUMENT_ID/stream" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  -H "Accept: text/event-stream" \
  --data '{"summary_type":"executive","custom_prompt":"","chunk_indices":[],"redact_pii":false}'
Knowledge Academy20 endpoints
Course, Tutor, study, and guidance commands
# List and create courses
curl -sS "$API/learning/courses?workspace_id=$WORKSPACE_ID" -H "$AUTH" -H "$WS" | jq
COURSE="$(curl -sS -X POST "$API/learning/courses" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg ws "$WORKSPACE_ID" '{workspace_id:$ws,title:"Enterprise RAG Foundations",course_code:"AI-101",semester:"Fall 2026",description:"Evidence-grounded learning.",instructor_name:"Course Instructor",objectives:["Explain hybrid retrieval","Evaluate grounded answers"]}')")"
export COURSE_ID="$(echo "$COURSE" | jq -r '.id')"

# Read, update, or delete the course
curl -sS "$API/learning/courses/$COURSE_ID" -H "$AUTH" -H "$WS" | jq
curl -sS -X PATCH "$API/learning/courses/$COURSE_ID" -H "$AUTH" -H "$WS" -H "$JSON" --data '{"semester":"Winter 2027"}' | jq
# curl -sS -X DELETE "$API/learning/courses/$COURSE_ID" -H "$AUTH" -H "$WS" | jq

# Replace curriculum and capture generated module and lesson IDs
COURSE="$(curl -sS -X PUT "$API/learning/courses/$COURSE_ID/curriculum" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"modules":[{"title":"RAG Foundations","description":"Retrieval and grounding.","lessons":[{"title":"Hybrid Retrieval","description":"Keyword and vector retrieval."}]}]}')"
export MODULE_ID="$(echo "$COURSE" | jq -r '.modules[0].id')"
export LESSON_ID="$(echo "$COURSE" | jq -r '.modules[0].lessons[0].id')"

# Discover and attach multimodal workspace content
curl -sS "$API/learning/documents?workspace_id=$WORKSPACE_ID" -H "$AUTH" -H "$WS" | jq
COURSE="$(curl -sS -X POST "$API/learning/courses/$COURSE_ID/assets" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg doc "$DOCUMENT_ID" --arg module "$MODULE_ID" --arg lesson "$LESSON_ID" '{document_id:$doc,module_id:$module,lesson_id:$lesson,title:"Hybrid Retrieval Lesson"}')")"
export ASSET_ID="$(echo "$COURSE" | jq -r --arg doc "$DOCUMENT_ID" '.assets[] | select(.document_id==$doc) | .id')"

# Verify exact lesson scope, then stream a grounded Tutor answer
curl -sS "$API/learning/courses/$COURSE_ID/scope?module_id=$MODULE_ID&lesson_id=$LESSON_ID" -H "$AUTH" -H "$WS" | jq
curl -sS -N -X POST "$API/learning/courses/$COURSE_ID/tutor/query/stream" -H "$AUTH" -H "$WS" -H "$JSON" -H "Accept: text/event-stream" \
  --data "$(jq -cn --arg module "$MODULE_ID" --arg lesson "$LESSON_ID" '{question:"What is discussed in this lesson?",module_id:$module,lesson_id:$lesson,history:[],response_language:"en",redact_pii:false}')"

# Persist and list grounded learning material
ARTIFACT="$(curl -sS -X POST "$API/learning/courses/$COURSE_ID/artifacts" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg module "$MODULE_ID" --arg lesson "$LESSON_ID" --arg doc "$DOCUMENT_ID" '{artifact_type:"summary",title:"Hybrid Retrieval Summary",content:"Reviewed grounded summary.",source_document_ids:[$doc],module_id:$module,lesson_id:$lesson}')")"
export SUMMARY_ARTIFACT_ID="$(echo "$ARTIFACT" | jq -r '.id')"
curl -sS "$API/learning/courses/$COURSE_ID/artifacts" -H "$AUTH" -H "$WS" | jq

# Create a schema-valid PracticeQuiz, submit an attempt, and read progress
QUIZ_CONTENT="$(jq -cn '{schema_version:1,instructions:"Select every correct answer.",questions:[{id:"q1",question:"Which retrieval approach combines lexical and semantic evidence?",options:[{id:"A",text:"Hybrid retrieval",correct:true},{id:"B",text:"Vector retrieval only",correct:false},{id:"C",text:"Keyword retrieval only",correct:false},{id:"D",text:"No retrieval",correct:false}],explanation:"Hybrid retrieval combines keyword and vector signals."}]}')"
QUIZ_ARTIFACT="$(curl -sS -X POST "$API/learning/courses/$COURSE_ID/artifacts" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg module "$MODULE_ID" --arg lesson "$LESSON_ID" --arg doc "$DOCUMENT_ID" --arg content "$QUIZ_CONTENT" '{artifact_type:"practice_questions",title:"Hybrid Retrieval Practice",content:$content,source_document_ids:[$doc],module_id:$module,lesson_id:$lesson}')")"
export ARTIFACT_ID="$(echo "$QUIZ_ARTIFACT" | jq -r '.id')"
curl -sS -X POST "$API/learning/courses/$COURSE_ID/artifacts/$ARTIFACT_ID/attempts" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"answers":{"q1":["A"]},"replace":false}' | jq
curl -sS "$API/learning/courses/$COURSE_ID/progress" -H "$AUTH" -H "$WS" | jq

# Ask and answer a human-guidance question
QUESTION="$(curl -sS -X POST "$API/learning/courses/$COURSE_ID/questions" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg lesson "$LESSON_ID" '{target_role:"teacher",question:"How should I evaluate retrieval quality?",context:{lesson_id:$lesson}}')")"
export QUESTION_ID="$(echo "$QUESTION" | jq -r '.id')"
curl -sS -X PATCH "$API/learning/courses/$COURSE_ID/questions/$QUESTION_ID" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"answer":"Measure recall, precision, groundedness, and latency.","status":"answered"}' | jq

# Enroll or remove a member
curl -sS -X POST "$API/learning/courses/$COURSE_ID/members" -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"email":"student@example.com","persona":"student"}' | jq
# curl -sS -X DELETE "$API/learning/courses/$COURSE_ID/members/$MEMBER_USER_ID" -H "$AUTH" -H "$WS" | jq

# Detach or delete caller-owned learning records
# curl -sS -X DELETE "$API/learning/courses/$COURSE_ID/assets/$ASSET_ID" -H "$AUTH" -H "$WS" | jq
# curl -sS -X DELETE "$API/learning/courses/$COURSE_ID/artifacts/$ARTIFACT_ID" -H "$AUTH" -H "$WS" | jq

Practice-question content must follow the generated PracticeQuiz schema. Request learning:read, learning:participate, and learning:manage only as needed.

Batch processing11 endpoints
Batch commands
# POST /batches/uploads - reserve multiple signed uploads
BATCH_UPLOAD="$(curl -sS -X POST "$API/batches/uploads" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn \
    --arg workspace_id "$WORKSPACE_ID" \
    '{workspace_id:$workspace_id,redact_pii:false,idempotency_key:"upload-2026-001",files:[{filename:"policy-a.pdf",content_type:"application/pdf",file_size:348120},{filename:"policy-b.pdf",content_type:"application/pdf",file_size:228400}]}')")"
echo "$BATCH_UPLOAD" | jq

export BATCH_JOB_ID="$(echo "$BATCH_UPLOAD" | jq -r '.batch_job_id')"
export DOCUMENT_ID_1="$(echo "$BATCH_UPLOAD" | jq -r '.files[0].document_id')"
export DOCUMENT_ID_2="$(echo "$BATCH_UPLOAD" | jq -r '.files[1].document_id')"

# Upload each file using its returned .files[n].upload_url before completion.

# POST /batches/{job_id}/uploads/complete
curl -sS -X POST "$API/batches/$BATCH_JOB_ID/uploads/complete" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg a "$DOCUMENT_ID_1" --arg b "$DOCUMENT_ID_2" '{document_ids:[$a,$b],concurrency:3}')" | jq

# POST /batches/embedding
curl -sS -X POST "$API/batches/embedding" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg ws "$WORKSPACE_ID" --arg a "$DOCUMENT_ID_1" --arg b "$DOCUMENT_ID_2" '{workspace_id:$ws,document_ids:[$a,$b],concurrency:3,force:false,idempotency_key:"embed-2026-001"}')" | jq

# POST /batches/classification
curl -sS -X POST "$API/batches/classification" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg ws "$WORKSPACE_ID" --arg a "$DOCUMENT_ID_1" --arg b "$DOCUMENT_ID_2" '{workspace_id:$ws,document_ids:[$a,$b],concurrency:3,force:false,idempotency_key:"classify-2026-001"}')" | jq

# POST /batches/workspace-summary
curl -sS -X POST "$API/batches/workspace-summary" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg ws "$WORKSPACE_ID" '{workspace_id:$ws,document_ids:[],summary_type:"executive",custom_prompt:"",redact_pii:false,language:"en",concurrency:2,idempotency_key:"summary-2026-001"}')" | jq

# GET /batches - filter jobs
curl -sS "$API/batches?workspace_id=$WORKSPACE_ID&status=running&limit=25" \
  -H "$AUTH" -H "$WS" | jq

# GET /batches/{job_id}
curl -sS "$API/batches/$BATCH_JOB_ID" \
  -H "$AUTH" -H "$WS" | jq

# GET /batches/{job_id}/results
curl -sS "$API/batches/$BATCH_JOB_ID/results" \
  -H "$AUTH" -H "$WS" | jq

# POST /batches/{job_id}/retry
curl -sS -X POST "$API/batches/$BATCH_JOB_ID/retry" \
  -H "$AUTH" -H "$WS" | jq

# POST /batches/{job_id}/resume
curl -sS -X POST "$API/batches/$BATCH_JOB_ID/resume" \
  -H "$AUTH" -H "$WS" | jq

# POST /batches/{job_id}/cancel
curl -sS -X POST "$API/batches/$BATCH_JOB_ID/cancel" \
  -H "$AUTH" -H "$WS" | jq
Operations and workflow schemas5 endpoints
Operation commands
# GET /operations/catalog
curl -sS "$API/operations/catalog" \
  -H "$AUTH" -H "$WS" | jq

# GET /operations
curl -sS "$API/operations?workspace_id=$WORKSPACE_ID&status=running&limit=25" \
  -H "$AUTH" -H "$WS" | jq

export OPERATION_ID="YOUR_OPERATION_UUID"

# GET /operations/{operation_id}
curl -sS "$API/operations/$OPERATION_ID" \
  -H "$AUTH" -H "$WS" | jq

export WORKFLOW="healthcare_prior_auth"

# GET /workflows/{workflow}/schema
curl -sS "$API/workflows/$WORKFLOW/schema" \
  -H "$AUTH" -H "$WS" | jq

# POST /workflows/{workflow}/validate
curl -sS -X POST "$API/workflows/$WORKFLOW/validate" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg document_id "$DOCUMENT_ID" '{document_ids:[$document_id],policy_document_ids:[$document_id]}')" | jq

The validation route checks inputs only. Use the workflow execution surface documented for the selected vertical when starting a run.

Events, subscriptions, and deliveries8 endpoints
Event commands
# GET /events
curl -sS "$API/events?after=0&resource_type=document&resource_id=$DOCUMENT_ID&limit=100" \
  -H "$AUTH" -H "$WS" | jq

# POST /event-subscriptions
SUBSCRIPTION="$(curl -sS -X POST "$API/event-subscriptions" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg ws "$WORKSPACE_ID" '{event_types:["document.embedded","document.failed","batch.completed"],workspace_id:$ws,resource_type:null,resource_id:null,webhook_url:"https://webhooks.example.com/docintel/events"}')")"
echo "$SUBSCRIPTION" | jq
export SUBSCRIPTION_ID="$(echo "$SUBSCRIPTION" | jq -r '.subscription_id // .id')"

# GET /event-subscriptions
curl -sS "$API/event-subscriptions" \
  -H "$AUTH" -H "$WS" | jq

# DELETE /event-subscriptions/{subscription_id}
curl -sS -X DELETE "$API/event-subscriptions/$SUBSCRIPTION_ID" \
  -H "$AUTH" -H "$WS" | jq

# GET /webhook-deliveries
curl -sS "$API/webhook-deliveries?subscription_id=$SUBSCRIPTION_ID&status=failed&limit=100" \
  -H "$AUTH" -H "$WS" | jq

export DELIVERY_ID="YOUR_DELIVERY_UUID"

# POST /webhook-deliveries/{delivery_id}/retry
curl -sS -X POST "$API/webhook-deliveries/$DELIVERY_ID/retry" \
  -H "$AUTH" -H "$WS" | jq

# POST /webhook-deliveries/process-due
curl -sS -X POST "$API/webhook-deliveries/process-due?limit=50" \
  -H "$AUTH" -H "$WS" | jq

export EVENT_ID="YOUR_EVENT_UUID"

# POST /events/{event_id}/replay
curl -sS -X POST "$API/events/$EVENT_ID/replay" \
  -H "$AUTH" -H "$WS" | jq
Human review, artifacts, and evaluations7 endpoints
Governance commands
export WORKFLOW_RUN_ID="YOUR_WORKFLOW_RUN_ID"

# POST /reviews
REVIEW="$(curl -sS -X POST "$API/reviews" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg ws "$WORKSPACE_ID" --arg run "$WORKFLOW_RUN_ID" '{vertical:"healthcare",run_id:$run,title:"Review prior authorization packet",workspace_id:$ws,priority:"high",due_at:null,metadata:{source:"public_api"}}')")"
echo "$REVIEW" | jq
export REVIEW_TASK_ID="$(echo "$REVIEW" | jq -r '.task_id // .id')"

# GET /reviews
curl -sS "$API/reviews?status=pending&limit=100" \
  -H "$AUTH" -H "$WS" | jq

# POST /reviews/{task_id}/assign
curl -sS -X POST "$API/reviews/$REVIEW_TASK_ID/assign" \
  -H "$AUTH" -H "$WS" | jq

# POST /reviews/{task_id}/decision
curl -sS -X POST "$API/reviews/$REVIEW_TASK_ID/decision" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data '{"decision":"approved","reviewer_notes":"Evidence and packet reviewed."}' | jq

# POST /artifacts
curl -sS -X POST "$API/artifacts" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg ws "$WORKSPACE_ID" --arg doc "$DOCUMENT_ID" '{artifact_type:"review_packet",title:"Approved review packet",content:{summary:"Reviewed and approved."},workspace_id:$ws,source_document_ids:[$doc],source_trace_id:null,status:"approved"}')" | jq

# GET /artifacts
curl -sS "$API/artifacts?workspace_id=$WORKSPACE_ID" \
  -H "$AUTH" -H "$WS" | jq

export TRACE_ID="YOUR_TRACE_ID"

# POST /evaluations
curl -sS -X POST "$API/evaluations" \
  -H "$AUTH" -H "$WS" -H "$JSON" \
  --data "$(jq -cn --arg trace_id "$TRACE_ID" '{trace_id:$trace_id,evaluation_type:"groundedness"}')" | jq

Asynchronous operations

Do not hold long requests open

Large uploads, transcription, video processing, embedding, batch jobs, and vertical workflows return durable identifiers. Poll status with bounded backoff or subscribe to webhooks.

SubmitOperation IDProcessEventResult
Continue to webhooks

Errors and quotas

Stable error handling

StatusMeaningClient action
400Invalid requestCorrect the payload; do not retry unchanged.
401 / 403Authentication, scope, or workspace denialRefresh credentials or request approved access.
404Unavailable resourceVerify workspace and resource ownership.
409State or idempotency conflictRead current operation state.
429Application quota exceededHonor Retry-After and X-RateLimit-Reset.
5xxTransient service failureRetry idempotent operations and retain trace ID.

Governed calls may include X-DocIntel-Usage-Units, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.