Practical integration
Exercise the complete lifecycle
Move from confidential application credentials to a workspace-scoped request, durable processing, signed events, usage review, and credential rotation.
Integration journey
One end-to-end acceptance path
Client Credentials
Obtain a REST API token
curl -sS -X POST https://auth.docintel.adar.agomoniai.com/token \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET" \
--data-urlencode "scope=workspaces:read documents:read knowledge:query" \
--data-urlencode "resource=https://docintel.adar.agomoniai.com/api/v1"Client Credentials returns a short-lived access token, not a refresh token. Obtain a new token after access or credential policy changes.
Workspace request
Verify identity and documents
curl -sS https://docintel.adar.agomoniai.com/api/v1/documents \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-DocIntel-Workspace-ID: $WORKSPACE_ID" \
-H "Accept: application/json" | jqAn ungranted workspace must return HTTP 403, an MCP-audience token must be rejected by REST, and an unapproved scope must not be issued.
Knowledge Academy
Ground a Tutor in one lesson
# Inspect exactly which embedded assets support the selected lesson
curl -sS "$API/learning/courses/$COURSE_ID/scope?module_id=$MODULE_ID&lesson_id=$LESSON_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-DocIntel-Workspace-ID: $WORKSPACE_ID" | jq
# Stream an evidence-grounded Tutor response from that scope only
curl -sS -N -X POST "$API/learning/courses/$COURSE_ID/tutor/query/stream" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-DocIntel-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/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}')"Use learning:read to inspect courses and scope, learning:participate for Tutor, study, quizzes, and questions, and learning:manage for curriculum, enrollment, and content mapping.
Durable processing
Design for asynchronous completion
Large document and video bytes move directly to cloud storage. Store the returned document and operation IDs, monitor bounded progress, and subscribe to lifecycle events rather than holding an interactive request open.
Quota check
Honor operational headers
curl -sS -D - -o /tmp/docintel-body.json \
https://docintel.adar.agomoniai.com/api/v1/documents \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-DocIntel-Workspace-ID: $WORKSPACE_ID"
jq . /tmp/docintel-body.jsonInspect X-DocIntel-Usage-Units and any X-RateLimit-* headers. On HTTP 429, honor Retry-After.
Three client starters
Use the same contract in familiar languages
Service automation
Instantiate the starter with base URL, access token, and optional team workspace ID.
Python guidanceNode integration
Use the fetch-based client and keep OAuth secrets outside browser code.
JavaScript guidanceEnterprise services
Use the standard HTTP client starter and centralized application credential handling.
Java guidanceAcceptance checklist
