https://docintel.adar.agomoniai.com/api/v1Application integration
DocIntel REST API
Build ingestion, knowledge, media, workflow, and operational experiences through versioned, OAuth-secured HTTP contracts.
Base URL
Request conventions
https://docintel.adar.agomoniai.com/openapi.jsoncurl 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
Membership, roles, shared and personal workspaces, and authorization context.
Upload initiation, metadata, classification, embedding, status, and lifecycle management.
Grounded questions, summaries, comparisons, citations, and session-aware context.
Courses, curriculum, multimodal learning scope, AI Tutor, study tools, quizzes, progress, and human guidance.
Conversation transcripts, audio, large video, timelines, frames, and processing progress.
Run vertical workflows, review findings, approve outputs, and manage PDF packets.
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.
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
| Method | Path | Scope | Response contract |
|---|---|---|---|
| GET | / | documents:read | API name, version, client ID, granted scopes, and capability links. |
| GET | /me | Authenticated | data.{user_id,email,full_name,role,client_id,scopes,workspace_count} |
Workspace contracts
Personal context, teams, and membership
| Method | Path | Scope | Contract |
|---|---|---|---|
| GET | /me/workspaces | workspaces:read | Personal context plus owned and shared team workspaces. |
| POST | /workspace-context | workspaces:read | {workspace_id|null} returns selected context and header value. |
| GET | /workspaces | workspaces:read | Accessible workspace collection in data. |
| POST | /workspaces | workspaces:write | {name}; returns HTTP 201 and created workspace. |
| GET | /workspaces/{workspace_id} | workspaces:read | Workspace metadata, ownership, membership, and counts. |
| PATCH | /workspaces/{workspace_id} | workspaces:write | {name}; owner/editor policy is enforced. |
| DELETE | /workspaces/{workspace_id} | workspaces:write | Deletes an authorized team workspace. |
| GET | /workspaces/{workspace_id}/documents | documents:read | Documents visible in the selected team workspace. |
| POST | /workspaces/{workspace_id}/members | workspaces: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:write | Removes an authorized member. |
| POST | /workspaces/{workspace_id}/leave | workspaces:write | Removes the current principal from the workspace. |
Document and upload contracts
Move bytes directly, then manage knowledge assets
| Method | Path | Scope | Contract |
|---|---|---|---|
| GET | /documents | documents:read | data[] plus personal or team workspace context. |
| GET | /documents/{document_id} | documents:read | Document metadata, classification, status, counts, and timestamps. |
| GET | /documents/{document_id}/chunks | documents:read | Authorized extracted chunks and chunk metadata. |
| POST | /uploads | documents:write | Upload manifest; HTTP 201 returns signed PUT URL, document ID, path, headers, and expiry. |
| POST | /uploads/complete | documents:write | Completion manifest; HTTP 202 returns document ID and chunking state. |
| POST | /documents/{document_id}/embedding | documents:write | HTTP 202; starts embedding after chunk readiness. |
| DELETE | /documents/{document_id} | documents:write | Deletes authorized metadata, vectors, chunks, and stored artifacts according to lifecycle policy. |
| POST | /documents/{document_id}/versions | versions:write | Registers lineage, previous document, change summary, and changed pages. |
| GET | /documents/{document_id}/versions | versions:read | Version and lineage records. |
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
| Method | Path | Scope | Contract |
|---|---|---|---|
| POST | /knowledge/query/stream | knowledge:query | ChatRequest; SSE emits token, done, and error events with grounded result metadata. |
| POST | /summaries/documents/{document_id}/stream | knowledge:generate | SummarizeRequest; SSE emits map/reduce metadata, tokens, done, and error events. |
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
| Method | Path | Scope | Contract |
|---|---|---|---|
| GET | /learning/courses | learning:read | List accessible courses in the selected workspace. |
| POST | /learning/courses | learning:manage | CourseCreate; creates a course and enrolls its creator as teacher. |
| GET | /learning/courses/{course_id} | learning:read | Returns the course workspace, curriculum, assets, artifacts, attempts, and questions. |
| PATCH | /learning/courses/{course_id} | learning:manage | CourseUpdate; updates metadata or lifecycle status. |
| DELETE | /learning/courses/{course_id} | learning:manage | Deletes the course and dependent learning records. |
| GET | /learning/courses/{course_id}/scope | learning:read | Resolves course, module, or lesson evidence and grounding instructions. |
| POST | /learning/courses/{course_id}/members | learning:manage | MemberCreate; enrolls an existing workspace member. |
| DELETE | /learning/courses/{course_id}/members/{user_id} | learning:manage | Removes course enrollment without removing workspace membership. |
| PUT | /learning/courses/{course_id}/curriculum | learning:manage | CurriculumSave; replaces ordered modules and lessons. |
| GET | /learning/documents | learning:read | Lists workspace documents, audio, and video eligible for attachment. |
| POST | /learning/courses/{course_id}/assets | learning:manage | AssetCreate; maps content to a course, module, or lesson. |
| DELETE | /learning/courses/{course_id}/assets/{asset_id} | learning:manage | Detaches content while preserving the source DocIntel asset. |
| POST | /learning/courses/{course_id}/tutor/query/stream | learning:participate | LearningTutorRequest; streams an answer grounded only in resolved learning scope. |
| POST | /learning/courses/{course_id}/artifacts | learning:participate | ArtifactCreate; persists summaries, guides, concepts, flashcards, or interactive quizzes. |
| GET | /learning/courses/{course_id}/artifacts | learning:read | Lists the caller's saved learning materials. |
| DELETE | /learning/courses/{course_id}/artifacts/{artifact_id} | learning:participate | Deletes a caller-authorized study artifact. |
| POST | /learning/courses/{course_id}/artifacts/{artifact_id}/attempts | learning:participate | QuizAttemptCreate; grades and persists selected option IDs. |
| GET | /learning/courses/{course_id}/progress | learning:read | Returns learner or educator-visible completion and quiz performance. |
| POST | /learning/courses/{course_id}/questions | learning:participate | QuestionCreate; escalates a question to a teacher or advisor. |
| PATCH | /learning/courses/{course_id}/questions/{question_id} | learning:participate | QuestionUpdate; answers, reassigns, or closes a question. |
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
| Method | Path | Scope | Contract |
|---|---|---|---|
| POST | /batches/uploads | batches:write | BatchUploadRequest; HTTP 201 returns job ID and one signed upload contract per file. |
| POST | /batches/{job_id}/uploads/complete | batches:write | Selected document IDs and concurrency; HTTP 202 queues verification and ingestion. |
| POST | /batches/embedding | batches:write | DocumentBatchRequest; HTTP 202 returns queued job and total items. |
| POST | /batches/classification | batches:write | DocumentBatchRequest; HTTP 202 returns queued job and total items. |
| POST | /batches/workspace-summary | batches:write | WorkspaceSummaryRequest; HTTP 202 returns queued summary job. |
| GET | /batches | batches:read | Filter by workspace, operation, status, and limit 1-100. |
| GET | /batches/{job_id} | batches:read | Job, progress, stage, counters, configuration, and item states. |
| GET | /batches/{job_id}/results | batches:read | Terminal result plus per-item output, attempts, and errors. |
| POST | /batches/{job_id}/retry | batches:write | HTTP 202; requeues failed items only. |
| POST | /batches/{job_id}/resume | batches:write | HTTP 202; resumes from retained job/item state. |
| POST | /batches/{job_id}/cancel | batches:write | HTTP 202; requests cancellation and skips queued items. |
Operations and workflow contracts
Discover schemas and normalize status
| Method | Path | Scope | Contract |
|---|---|---|---|
| GET | /operations/catalog | workflows:read | Contract version, enterprise capabilities, and available workflow definitions. |
| GET | /operations | batches:read | Normalized operation views filtered by workspace, status, and limit. |
| GET | /operations/{operation_id} | batches:read | Normalized status with progress, current step, counters, items, result, and error. |
| GET | /workflows/{workflow}/schema | workflows:read | Required inputs, version, vertical, review requirement, and packet types. |
| POST | /workflows/{workflow}/validate | workflows:read | Validates 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
| Method | Path | Scope | Contract |
|---|---|---|---|
| GET | /events | events:read | Cursor-style event list with resource filters and limit 1-500. |
| POST | /event-subscriptions | events:write | SubscriptionInput; HTTP 201 returns subscription and one-time signing material where applicable. |
| GET | /event-subscriptions | events:read | Authorized subscriptions and filters. |
| DELETE | /event-subscriptions/{subscription_id} | events:write | Removes the subscription. |
| GET | /webhook-deliveries | events:read | Delivery history filtered by subscription/status, limit 1-500. |
| POST | /webhook-deliveries/{delivery_id}/retry | events:write | HTTP 202; resets and requeues one failed delivery. |
| POST | /webhook-deliveries/process-due | events:write | HTTP 202; schedules up to 200 due deliveries. |
| POST | /events/{event_id}/replay | events:write | HTTP 202; recreates matching deliveries idempotently. |
Human review and governance
Keep generated intelligence accountable
| Method | Path | Scope | Contract |
|---|---|---|---|
| POST | /reviews | reviews:write | ReviewTaskInput; HTTP 201 creates a governed review task. |
| GET | /reviews | reviews:write | Review tasks filtered by status and limit. |
| POST | /reviews/{task_id}/assign | reviews:write | Assigns the current authorized reviewer. |
| POST | /reviews/{task_id}/decision | reviews:approve | {decision,reviewer_notes} records approval, requested changes, or rejection. |
| POST | /artifacts | artifacts:write | ArtifactInput; HTTP 201 stores a draft, reviewed, or approved knowledge artifact. |
| GET | /artifacts | artifacts:read | Artifacts filtered by workspace. |
| POST | /evaluations | evaluations: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.
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"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
# GET / - API catalog
curl -sS "$API" \
-H "$AUTH" | jq
# GET /me - authenticated principal and effective scopes
curl -sS "$API/me" \
-H "$AUTH" | jqWorkspaces and membership12 endpoints
# 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" | jqRun destructive workspace and membership examples only against a disposable test workspace.
Documents, uploads, and versions9 endpoints
# 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" | jqKnowledge streams2 endpoints
# 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
# 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" | jqPractice-question content must follow the generated PracticeQuiz schema. Request learning:read, learning:participate, and learning:manage only as needed.
Batch processing11 endpoints
# 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" | jqOperations and workflow schemas5 endpoints
# 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]}')" | jqThe validation route checks inputs only. Use the workflow execution surface documented for the selected vertical when starting a run.
Events, subscriptions, and deliveries8 endpoints
# 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" | jqHuman review, artifacts, and evaluations7 endpoints
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"}')" | jqAsynchronous 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.
Errors and quotas
Stable error handling
| Status | Meaning | Client action |
|---|---|---|
| 400 | Invalid request | Correct the payload; do not retry unchanged. |
| 401 / 403 | Authentication, scope, or workspace denial | Refresh credentials or request approved access. |
| 404 | Unavailable resource | Verify workspace and resource ownership. |
| 409 | State or idempotency conflict | Read current operation state. |
| 429 | Application quota exceeded | Honor Retry-After and X-RateLimit-Reset. |
| 5xx | Transient service failure | Retry idempotent operations and retain trace ID. |
Governed calls may include X-DocIntel-Usage-Units, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
