---
title: "Undo - Undoes the previous answer"
method: POST
path: "/{sessionID}/undo"
tags: ["Decisions"]
---

# Undo - Undoes the previous answer

`POST /{sessionID}/undo`

A method to undo the previous answer array posted to the response endpoint. This rolls back the session, removing any facts inferred from the answer array and returns the original question. A different answer can be provided or undo can be used again to further roll-back the session.<br><br> **Note:** when there are no further answers to undo, the same question will be returned.

## Path parameters

- `sessionID` string, required

## Request body

- object

## Response `200`

Session stepped back to a previous question or result

- 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)
