Skip to main content

API Reference

Authentication

All Reasoning Engine endpoints require these headers:

HeaderValueDescription
AuthorizationBearer {access_token}OAuth 2.0 bearer token (client credentials flow)
Ocp-Apim-Subscription-Key{subscription_key}API Management subscription key
Content-Typeapplication/jsonRequired for all POST requests

Endpoints

The Reasoning Engine exposes a workflow-based API with synchronous and asynchronous execution modes.

Synchronous Execution

POST /reasoning-engine/workflows/main

Runs the full pipeline and returns the result when complete. Use for simple integrations where blocking is acceptable.

Response: The complete output schema.

Asynchronous Execution

POST /reasoning-engine/workflows/main/start-async

Starts the pipeline and returns immediately with a runId. Use for production integrations to avoid HTTP timeouts.

Response:

{
"runId": "run-a1b2c3d4"
}

Poll Run Status

GET /reasoning-engine/workflows/main/runs/{runId}

Check the status of an async run and retrieve the result when complete.

Response:

{
"status": "completed",
"result": { }
}

Status values: running, completed, failed.

Request Body

All execution endpoints accept the same request body.

Required Fields

FieldTypeDescription
objectivestringThe analytical question the engine should answer

Data Inputs

At least one of series or datasets should be provided.

FieldTypeDescription
seriesarray (optional)Time-series data. Each item: {id, label, points: [{t, v}]} where t is an ISO timestamp and v is a numeric value
datasetsarray (optional)Numeric datasets for correlation. Each item: {id, label, values: [number]}

Optional Fields

FieldTypeDescription
hintsstring[] (optional)Context hints to guide the analysis
outputProfilestring (optional)Output format profile (default: "default")
taskIdstring (optional)Custom task identifier for tracing

Example Request

{
"objective": "Analyze the relationship between sleep duration and mood scores over the past month",
"series": [
{
"id": "sleep_hours",
"label": "Sleep Duration",
"points": [
{ "t": "2025-02-15", "v": 7.5 },
{ "t": "2025-02-16", "v": 6.2 },
{ "t": "2025-02-17", "v": 8.1 }
]
},
{
"id": "mood_score",
"label": "Mood Score",
"points": [
{ "t": "2025-02-15", "v": 8 },
{ "t": "2025-02-16", "v": 5 },
{ "t": "2025-02-17", "v": 9 }
]
}
],
"hints": ["User reports feeling tired on weekdays"],
"outputProfile": "default"
}

curl Example

curl -X POST "$BASE_URL/reasoning-engine/workflows/main" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"objective": "What trends exist in my sleep data?",
"series": [
{
"id": "sleep",
"label": "Sleep Hours",
"points": [
{"t": "2025-03-01", "v": 7.0},
{"t": "2025-03-02", "v": 6.5},
{"t": "2025-03-03", "v": 5.8}
]
}
]
}'

Response

See the complete Output Schema for the full response structure.

Key top-level fields in the response:

FieldAlways PresentDescription
taskIdYesTrace identifier
objectiveYesOriginal objective
temporalWhen temporal step runsStatistics, trends, insights
patternWhen pattern step runsDetected behavioral patterns
correlationWhen correlation step runsCross-metric relationships
domainWhen domain step runsExternal knowledge retrieved
explanationAlwaysSynthesized narrative and recommendations
validationAlwaysFact-check results
resultAlwaysSummary, key insights, confidence score
executedStepsYesWhich steps ran, skipped, or failed
timingYesExecution duration

Error Codes

CodeMeaning
400Invalid request body (missing objective, malformed data)
401Invalid or expired bearer token
403Subscription key rejected
422Schema validation failed (invalid field types or values)
500Internal server error