Query context

Ask a natural-language question and receive an evidence-backed Context Package. Use an explicit project or engagement ID for deterministic delivery context; engagement queries compose the caller-visible projects linked by the canonical commercial-engagement relationship. Customer identity is resolvable with honest provider coverage. Omit subject identity only for portfolio questions such as “What should I focus on today?”.

POST/api/v1/context/query

Authorization

agent:readapi key scoperequired
Required scope when calling with an API key.
agent:context_querysession capabilityoptional
Required capability when calling with a signed-in session.

Request body

questionstringrequired
Natural-language question.
subjectstringoptional
Optional explicit subject phrase.
focusstringoptional"customer" | "engagement" | "project"
Optional subject-kind hint.
subject_refobjectoptional
Preferred deterministic subject: { kind: customer|engagement|project, id: UUID }. Mutually exclusive with subject.
project_idstringoptional
Project UUID shortcut for subject_ref. Mutually exclusive with other subject IDs.
engagement_idstringoptional
Commercial engagement UUID shortcut for subject_ref. Mutually exclusive with other subject IDs.
customer_idstringoptional
Customer UUID shortcut for subject_ref. Mutually exclusive with other subject IDs.
Example request
{
  "question": "Why is this project at risk?",
  "project_id": "24ea6df2-7f4c-4c32-9fc1-6c8a0cb5b4b2"
}

Request

curl -X POST "https://www.digitalstack360.com/api/v1/context/query" \
  -H "Authorization: Bearer $DS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question":"Why is this project at risk?","project_id":"24ea6df2-7f4c-4c32-9fc1-6c8a0cb5b4b2"}'

Examples use a placeholder key from your environment. Store your key in $DS_API_KEY — never commit it.

Response

200 OK
{
  "data": {
    "intent": {
      "name": "daily_focus"
    },
    "summary": "2 projects need attention.",
    "evidence": [],
    "coverage": {
      "sources": [
        {
          "source": "subject_resolution",
          "status": "ok"
        }
      ]
    },
    "provenance": {
      "plan_id": "daily_focus.v1",
      "synthesizer": "none"
    }
  },
  "meta": {
    "context_package_version": "C1",
    "deterministic": true
  }
}

Errors

401
missing_auth

No credentials provided

401
invalid_api_key

API key is invalid or revoked

400
bad_request

Missing question or invalid focus

403
scope_insufficient

Key lacks agent:read scope