---
title: "Query - Query a running session"
method: POST
path: "/{sessionID}/query"
tags: ["Decisions"]
---

# Query - Query a running session

`POST /{sessionID}/query`

A query is the method to get decisions from your knowledge map. You query a relationship in the knowledge map and provide either the subject, the object or both. More information can be found [here](https://docs.rainbird.ai/rainbird/developer-docs/api-guide/example-api-request-flow#query).

## Path parameters

- `sessionID` string, required

## Request body

- object
  - `subject` string — The subject side concept instance or value
  - `relationship` string, required — The relationship between subject and object
  - `object` union — The object side concept instance or value
    - string
    - number
    - boolean

## Response `200`

An answer if one is reached, or a question

- union
  - QuestionResponse — A question the engine wants answered
    - `question` Question, required — A question object that needs a response
      - `subject` string
      - `object` string
      - `objectType` string
      - `objectMetadata` object — If it exists the object side meta
      - `dataType` string
      - `relationship` string
      - `type` string
      - `plural` boolean
      - `allowCF` boolean
      - `allowUnknown` boolean
      - `canAdd` boolean — Whether further objects can be added to the query
      - `prompt` string — User interaction required for further processing
      - `knownAnswers` unknown[] — An array of objects that have been answered
        - unknown
      - `concepts` object[]
        - `conceptType` string
        - `name` string
        - `type` string
        - `value` string
        - `invalidResponse` boolean
    - `extraQuestions` unknown[] — If extra questions exist - this would be an array of question objects
      - unknown
    - `sid` string, required — The ID of the session
    - `stats` object — This has been deprecated
  - ResultResponse — The engine is providing results
    - `result` object[], required — An array of results
      - `subject` string — The subject side concept instance or value
      - `relationshipType` string — The name of the relationship the query was for
      - `object` union — The object side concept instance or value
        - string
        - number
        - boolean
      - `certainty` number — How certain this fact or answer is
      - `factID` string — ID used to fetch the evidence tree that lead to this decision
      - `relationship` string — The relationship between subject and object
      - `subjectMetadata` object — If it exists the subject side meta
      - `objectMetadata` object — If it exists the object side meta
    - `queryProfile` unknown[] — This has been deprecated
      - unknown
    - `sid` string, required — The session ID this result relates to
    - `stats` object — This has been deprecated

---

[API](https://skmtc.net/rainbird/apis/rainbird-api-documentation.md) · [All operations](https://skmtc.net/rainbird/apis/rainbird-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rainbird/rainbird-api-documentation/revisions/0b8d2bc38f5d/schema)
