Search context evidence
Full-text search of ACTIVE evidence spans in the Engagement Knowledge Corpus, bound to an authorized project or engagement. Returns ranked passages with source provenance (page/paragraph/section, provenance quality), honest scope, freshness, and keyset continuation — evidence, never a synthesized answer. Project queries search directly-bound sources; engagement queries fan out to caller-visible child projects (direct engagement-bound sources are not yet supported). PostgreSQL full-text retrieval; no semantic/vector search. Requires the context-engine:read scope (agent:read alone is insufficient) plus the context:read permission.
/api/v1/context/searchAuthorization
context-engine:readapi key scoperequiredcontext:searchsession capabilityoptionalRequest body
subject_refobjectrequiredquerystringrequiredinclude_parent_contextbooleanoptionalinclude_child_projectsbooleanoptionalsource_typesarrayoptionaloccurred_afterstringoptionaloccurred_beforestringoptionallimitnumberoptionalcursorstringoptional{
"subject_ref": {
"type": "project",
"id": "24ea6df2-7f4c-4c32-9fc1-6c8a0cb5b4b2"
},
"query": "Shopify Tax"
}Request
curl -X POST "https://www.digitalstack360.com/api/v1/context/search" \
-H "Authorization: Bearer $DS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subject_ref":{"type":"project","id":"24ea6df2-7f4c-4c32-9fc1-6c8a0cb5b4b2"},"query":"Shopify Tax"}'Examples use a placeholder key from your environment. Store your key in $DS_API_KEY — never commit it.
Response
{
"data": {
"subject": {
"type": "project",
"id": "24ea6df2-7f4c-4c32-9fc1-6c8a0cb5b4b2",
"display_name": "Replatform"
},
"query": {
"text": "Shopify Tax"
},
"scope": {
"direct_sources": {
"status": "supported",
"included": true
},
"parent_context": {
"status": "unsupported",
"reason": "engagement_binding_not_available",
"included": false
},
"child_projects": {
"status": "not_applicable",
"included": false
},
"projects_examined": 1,
"projects_excluded": 0
},
"results": [
{
"span_id": "…",
"text": "Tax-category mapping uses Shopify Tax…",
"rank": 0.91,
"source_id": "…",
"source_title": "Tax Design",
"source_type": "document",
"subject_binding": {
"type": "project",
"id": "…",
"name": "Replatform"
},
"match_origin": "direct",
"page": 4,
"paragraph": 2,
"section": null,
"provenance_quality": "exact",
"occurred_at": "2026-06-01T00:00:00Z",
"source_ingested_at": "2026-07-01T00:00:00Z",
"content_version": 1,
"segmentation_version": 1,
"stored_document_id": "…"
}
],
"freshness": {
"status": "mixed",
"oldest_source_at": "2026-06-01T00:00:00Z",
"newest_source_at": "2026-06-01T00:00:00Z"
},
"coverage": {
"sources_matched": 1,
"projects_examined": 1,
"note": "result-scoped; corpus denominator not asserted"
},
"truncated": false,
"continuation": null
}
}Errors
missing_authNo credentials provided
invalid_api_keyAPI key is invalid or revoked
bad_requestInvalid subject_ref, empty/oversized query, or bad limit/cursor
scope_insufficientKey lacks context-engine:read scope
not_foundSubject is outside the workspace or not visible