API Reference / Cognis - Reasoning

Ask Cognis (streaming SSE)

post https://api.intelig.ai/api/v1/intelig/cognis/threads/{threadId}/ask/stream

Auth: Authorization: ApiKey <key> (an API key sent as Bearer is rejected) or Authorization: Bearer <jwt> for a dashboard session. operationId: askStream

Sends a question to the Cognis AI reasoning engine and streams the response via Server-Sent Events. Emits 'start', 'delta' (content chunks), 'complete' (with metadata including pillar, evidence, token usage), and 'error' events. Ideal for real-time UI rendering of AI responses.

Example request

curl -X POST "https://api.intelig.ai/api/v1/intelig/cognis/threads/1/ask/stream" \
  -H "Authorization: ApiKey $INTELIG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What is our deployment frequency this quarter?",
    "mode": "ASK",
    "scopeType": "ORGANIZATION",
    "scopeId": 12
  }'

Path parameters

NameTypeRequiredDescription
threadId integer (int64) yes

Request body

application/json

FieldTypeRequiredDescription
question string yes The question to ask Cognis Example: What is our deployment frequency this quarter?
mode string yes Intent mode for the question (GENERAL, ASK, or AGENT) One of: ASK, AGENT, GENERAL Example: ASK
scopeType string no Optional per-message scope type override (ORGANIZATION, TEAM, CONTRIBUTOR) Example: ORGANIZATION
scopeId integer (int64) no Optional per-message scope ID override Example: 12
dateFrom string no Optional per-message date range start (ISO date) Example: 2026-01-01
dateTo string no Optional per-message date range end (ISO date) Example: 2026-01-31
clientTimezone string no Browser/client IANA timezone Example: America/New_York
clientToday string no Browser/client local date (ISO date) Example: 2026-05-29
modelKey string no Optional model key for this ask. When omitted, the user's saved Cognis model preference is used, falling back to the system default. Example: anthropic:claude-opus-4-8

Response 200

text/event-stream · ServerSentEventCognisStreamEvent[]

No body.

Status codes

  • 200 — SSE stream opened successfully
  • 400 — Invalid request or empty question
  • 401 — Not authenticated
  • 403 — Insufficient permissions for Cognis pillar
  • 404 — Thread not found
  • 429 — —

Every response is wrapped in { success, message, data }. A 4xx means the request is wrong — do not retry it unchanged. A 429 carries Retry-After in seconds.