# Session

## POST /memori/v2/Session

> Initializes a new Dialog State Machine session for an existing Memori.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Session":{"post":{"tags":["Session"],"summary":"Initializes a new Dialog State Machine session for an existing Memori.","operationId":"Session-OpenSession","requestBody":{"description":"The Session Open request specifications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenSessionSpecs"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenSessionResponse"}}}}}}}},"components":{"schemas":{"OpenSessionSpecs":{"type":"object","properties":{"memoriID":{"type":"string","description":"The Memori object ID.\r\nRequired.","nullable":true},"password":{"type":"string","description":"Password. As an alternative the minimum number\r\nof recovery tokens can be supplied in the\r\nRecoveryTokens property.\r\nIf the Memori is public no password is required.","nullable":true},"recoveryTokens":{"type":"array","items":{"type":"string"},"description":"Recovery tokens, as an alternative to the Memori's password.\r\nMust be supplied in the minimum number set during Memori\r\nregistration.","nullable":true},"tag":{"type":"string","description":"Optional initial tag. If specified the PIN property must also be specified. The Dialog State Machine will try to transition to the corresponding Giver or Receiver automatically. Transition may fail if Tag or PIN are incorrect, or if the Giver or Receiver have not been set up yet. <br> When ContinueFromChatLogID is specified, Tag and PIN must match those in use in the Chat Log when the session was saved.","nullable":true},"pin":{"type":"string","description":"Optional PIN corresponding to the initial tag, expressed as a 6-digit number between 000000 and 999999. Must be specified if the Tag property is specified. <br> When ContinueFromChatLogID is specified, Tag and PIN must match those in use in the Chat Log when the session was saved.","nullable":true},"initialContextVars":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Optional initial context, expressed as a set of variable-value paris. <br> When ContinueFromChatLogID is specified, InitialContextVars is ignored.","nullable":true},"initialQuestion":{"type":"string","description":"Optional initial question. It is sent as a Text Entered Event to the Dialog State Machine if the state session opening is R1. <br> When ContinueFromChatLogID is specified, InitialQuestion is ignored.","nullable":true},"continueFromChatLogID":{"type":"string","description":"Optional ID of an existing Chat Log for this Memori object, from which the session and the conversation should continue. <br> When specified, InitialContextVars and InitialQuestion are ignored. Additionally, the Tag and PIN properties must match those in use in the Chat Log when the session was saved.","nullable":true},"continueFromSessionID":{"type":"string","description":"Optional ID of an existing Session ID for this Memori object, from which the session and the conversation should continue. <br> When specified, InitialContextVars and InitialQuestion are ignored. Additionally, the Tag and PIN properties must match those in use in the Chat Log when the session was saved.","nullable":true},"birthDate":{"type":"string","description":"Birthdate of the user. Age verification may be applied when Memori\r\ncontent is NSFW or makes use of completions.\r\nIf a login token is specified in the Additional Info field, the user's birth date\r\nobtained from the login token overrides whatever value is specified here.\r\nThis value is never stored.","format":"date-time","nullable":true},"maintenanceCode":{"type":"string","description":"For internal use only.","nullable":true},"additionalInfo":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Optional additional key-value pairs to be saved in the session and the corresponding Event Log Memori Opened event. This additional information can be retrieved later by the Giver with the Event Log API. <br> Currently supported keys are:<ul> <li><code>loginToken</code>: a valid Memori.AI login token for the user, from which information like the user's unique ID, their birth date and e-mail are retrieved (for age verification and DCM integration purposes)</li> <li><code>language</code>: the language ISO code used to open the session (may be different from the Memori language if a translation layer is in place)</li> <li><code>referral</code>: the referral URL, as reported by the hosting web application</li> <li><code>timeZoneOffset</code>: the offset in minutes of the UTC time zone from the user's local time zone. Note: the offset is <i>subtracted</i> from UTC to obtain the user's local time, not added. E.g.: it should be -120 for CEST, <b>not</b> +120.</li> </ul>","nullable":true}},"additionalProperties":false,"description":"Specifications for a Session Open request."},"OpenSessionResponse":{"type":"object","properties":{"sessionID":{"type":"string","description":"Session ID.","nullable":true},"currentState":{"$ref":"#/components/schemas/DialogStateSpecs"},"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous response.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous response.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is equivalent to the HTTP\r\nstatus code.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response of an Open Session request."},"DialogStateSpecs":{"type":"object","properties":{"state":{"type":"string","description":"Current state of the Dialog State Machine, eg. ```R1```, ```G3``` etc.","nullable":true},"stateName":{"type":"string","description":"Name of the current state of the Dialog State Machine, e.g. ```WaitingForReceiverQuestion``` etc.","nullable":true},"previousState":{"type":"string","description":"Previous state of the Dialog State Machine, eg. ```I0```, ```G2b``` etc.","nullable":true},"confidence":{"type":"number","description":"Confidence of understanding of the entered text, with ```0.0``` no\r\nunderstanding at all and ```1.0``` certain understanding. ```Null``` if\r\nthe state transition did not require any natural language understanding.","format":"float","nullable":true},"confidenceLevel":{"type":"string","description":"Confidence level, e.g. ```NONE```, ```LOW```,\r\n```MEDIUM``` or ```HIGH```. ```Null``` if\r\nthe state transition did not require any natural language\r\nunderstanding.","nullable":true},"emission":{"type":"string","description":"Emission from the Dialog State Machine transition. ```Null``` if\r\nthe previous state transition did not emit any text.","nullable":true},"emittedMedia":{"type":"array","items":{"$ref":"#/components/schemas/MediumSpecs"},"description":"List of Medium objects associated with the emission of the state transition.","nullable":true},"media":{"type":"array","items":{"$ref":"#/components/schemas/MediumSpecs"},"description":"Obsolete. List of Medium objects associated with the emission of the state transition.\r\nUse EmittedMedia instead.","nullable":true,"deprecated":true},"continuationEmitted":{"type":"boolean","description":"```True``` if the emission contains a continuation prompts,\r\n            such as \"Is there anything else you want to ask me?\"."},"emitter":{"type":"string","description":"Name of the Memori that provided this emission. Used with Board of Experts model.\r\n```Null``` if no Board of Experts is configured, or if the Memori\r\nproviding the emission is the chairman of the Board.","nullable":true},"completion":{"type":"boolean","description":"```True``` if the emission has been obtained with a\r\n            completion from a generative AI."},"acceptsTimeout":{"type":"boolean","description":"```True``` if the current state accepts a Timeout event.\r\n            Sending a Timeout event to a state that does not accept it\r\n            causes no transition. The event is simply ignored."},"acceptsAbort":{"type":"boolean","description":"```True``` if the current state can be aborted.\r\n            Trying to abort event a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsMedia":{"type":"boolean","description":"```True``` if the current state accepts a MediumSelected event.\r\n            Trying to send a MediumSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsDate":{"type":"boolean","description":"```True``` if the current state accepts a DateSelected event.\r\n            Trying to send a DateSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsPlace":{"type":"boolean","description":"```True``` if the current state accepts a PlaceSelected event.\r\n            Trying to send a PlaceSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsTag":{"type":"boolean","description":"```True``` if the current state accepts a TagSelected event.\r\n            Trying to send a TagSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsFeedback":{"type":"boolean","description":"```True``` if the current state accepts a feedback intent\r\n            (e.g. \"it's not what I asked\") to notify the answer was incorrect.\r\n            Trying to send a feedback intent to a state that does not accept it\r\n            causes no transition. A courtesy answer is replied."},"hints":{"type":"array","items":{"type":"string"},"description":"List of texts suggested or accepted in the current state.\r\nIf empty does not mean the current state accepts no texts, but\r\nrather that there are no suggestions.","nullable":true},"timeout":{"type":"number","description":"Idle timeout, in seconds.\r\nSpecifies the time after which, if the user remains in idle state,\r\na Timeout event should be sent.\r\nMay be ```Null``` if the current state does not accept\r\nTimeout events.","format":"double","nullable":true},"currentTag":{"type":"string","description":"Latest tag set with a Tag Changed event.","nullable":true},"currentTagAuthenticated":{"type":"boolean","description":"True if the latest tag set with a Tag Changed event\r\nhas been successfully authenticated with its PIN."},"currentDate":{"type":"string","description":"Latest date set with a Date Changed event.","format":"date-time","nullable":true},"currentPlaceName":{"type":"string","description":"The name of the latest place set with Place Changed event.","nullable":true},"currentLatitude":{"type":"number","description":"The latitude of the latest place set with Place Changed event.","format":"double","nullable":true},"currentLongitude":{"type":"number","description":"The longitude of the latest place set with Place Changed event.","format":"double","nullable":true},"currentUncertaintyKm":{"type":"number","description":"The uncertainty in kilometers of the latest place set with Place Changed event.","format":"double","nullable":true},"currentMemoryID":{"type":"string","description":"ID of the current Memory object being created or answered.","nullable":true},"lastMatchedMemoryID":{"type":"string","description":"ID of the last Memory object matched and emitted.","nullable":true},"currentMedia":{"type":"array","items":{"$ref":"#/components/schemas/MediumSpecs"},"description":"List of Medium objects temporarily stored in the Dialog State Machine via MediumSelected events.\r\nMedia stored in the Current Media list will be sent to any configured generative AI at the\r\nnext TextEntered event. After a TextEntered event the list is always cleared.","nullable":true},"contextVars":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Current context, expressed as a set of variable-value paris.","nullable":true},"memoryTags":{"type":"array","items":{"type":"string"},"description":"The tags associated with the current Memory.","nullable":true},"llmUsage":{"$ref":"#/components/schemas/InteractionLLMUsage"}},"additionalProperties":false,"description":"Specifications of a state of the Dialog State Machine."},"MediumSpecs":{"type":"object","properties":{"mediumID":{"type":"string","description":"Medium object ID.","nullable":true},"url":{"type":"string","description":"URL of the Medium. If specified, the Content property must be ```Null```.\r\nUse this property to link large amounts of data stored externally.\r\nIf the amount of data is modest the Content property may be used as an alternative.","nullable":true},"content":{"type":"string","description":"Content of the Medium. If specified, the URL property must be ```Null```.\r\nDon't use this property to store large amounts of data. Can be used to store limited \r\ntext for a maximum of 10 KiB. For larger amounts store the data externally and link it\r\nvia the URL property.","nullable":true},"mimeType":{"type":"string","description":"MIME type of the Medium.\r\nRequired during Add operations.","nullable":true},"title":{"type":"string","description":"Title of the Medium.","nullable":true},"properties":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Key-value pairs for additional structured content storage.","nullable":true},"creationTimestamp":{"type":"string","description":"Timestamp of creation. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"creationSessionID":{"type":"string","description":"ID of the session that created this object.","nullable":true},"lastChangeTimestamp":{"type":"string","description":"Timestamp of latest change. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"lastChangeSessionID":{"type":"string","description":"ID of the latest session that changed this object.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Medium object."},"InteractionLLMUsage":{"type":"object","properties":{"provider":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"totalInputTokens":{"type":"integer","format":"int32"},"inputCacheReadTokens":{"type":"integer","format":"int32"},"inputCacheWriteTokens":{"type":"integer","format":"int32"},"outputTokens":{"type":"integer","format":"int32"},"durationMs":{"type":"integer","format":"int32"},"energyImpact":{"$ref":"#/components/schemas/InteractionEnergyImpact"}},"additionalProperties":false},"InteractionEnergyImpact":{"type":"object","properties":{"energy":{"type":"number","format":"double","nullable":true},"energyUnit":{"type":"string","nullable":true},"gwp":{"type":"number","format":"double","nullable":true},"gwpUnit":{"type":"string","nullable":true},"adPe":{"type":"number","format":"double","nullable":true},"adPeUnit":{"type":"string","nullable":true},"pe":{"type":"number","format":"double","nullable":true},"peUnit":{"type":"string","nullable":true},"wcf":{"type":"number","format":"double","nullable":true},"wcfUnit":{"type":"string","nullable":true}},"additionalProperties":false}}}}
````

## GET /memori/v2/Session/{strSessionID}

> Returns the current state of a session's Dialog State Machine.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Session/{strSessionID}":{"get":{"tags":["Session"],"summary":"Returns the current state of a session's Dialog State Machine.","operationId":"Session-GetCurrentState","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentStateResponse"}}}}}}}},"components":{"schemas":{"CurrentStateResponse":{"type":"object","properties":{"currentState":{"$ref":"#/components/schemas/DialogStateSpecs"},"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous response.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous response.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is equivalent to the HTTP\r\nstatus code.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Base response for requests reporting or affecting the Dialog State Machine's state."},"DialogStateSpecs":{"type":"object","properties":{"state":{"type":"string","description":"Current state of the Dialog State Machine, eg. ```R1```, ```G3``` etc.","nullable":true},"stateName":{"type":"string","description":"Name of the current state of the Dialog State Machine, e.g. ```WaitingForReceiverQuestion``` etc.","nullable":true},"previousState":{"type":"string","description":"Previous state of the Dialog State Machine, eg. ```I0```, ```G2b``` etc.","nullable":true},"confidence":{"type":"number","description":"Confidence of understanding of the entered text, with ```0.0``` no\r\nunderstanding at all and ```1.0``` certain understanding. ```Null``` if\r\nthe state transition did not require any natural language understanding.","format":"float","nullable":true},"confidenceLevel":{"type":"string","description":"Confidence level, e.g. ```NONE```, ```LOW```,\r\n```MEDIUM``` or ```HIGH```. ```Null``` if\r\nthe state transition did not require any natural language\r\nunderstanding.","nullable":true},"emission":{"type":"string","description":"Emission from the Dialog State Machine transition. ```Null``` if\r\nthe previous state transition did not emit any text.","nullable":true},"emittedMedia":{"type":"array","items":{"$ref":"#/components/schemas/MediumSpecs"},"description":"List of Medium objects associated with the emission of the state transition.","nullable":true},"media":{"type":"array","items":{"$ref":"#/components/schemas/MediumSpecs"},"description":"Obsolete. List of Medium objects associated with the emission of the state transition.\r\nUse EmittedMedia instead.","nullable":true,"deprecated":true},"continuationEmitted":{"type":"boolean","description":"```True``` if the emission contains a continuation prompts,\r\n            such as \"Is there anything else you want to ask me?\"."},"emitter":{"type":"string","description":"Name of the Memori that provided this emission. Used with Board of Experts model.\r\n```Null``` if no Board of Experts is configured, or if the Memori\r\nproviding the emission is the chairman of the Board.","nullable":true},"completion":{"type":"boolean","description":"```True``` if the emission has been obtained with a\r\n            completion from a generative AI."},"acceptsTimeout":{"type":"boolean","description":"```True``` if the current state accepts a Timeout event.\r\n            Sending a Timeout event to a state that does not accept it\r\n            causes no transition. The event is simply ignored."},"acceptsAbort":{"type":"boolean","description":"```True``` if the current state can be aborted.\r\n            Trying to abort event a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsMedia":{"type":"boolean","description":"```True``` if the current state accepts a MediumSelected event.\r\n            Trying to send a MediumSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsDate":{"type":"boolean","description":"```True``` if the current state accepts a DateSelected event.\r\n            Trying to send a DateSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsPlace":{"type":"boolean","description":"```True``` if the current state accepts a PlaceSelected event.\r\n            Trying to send a PlaceSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsTag":{"type":"boolean","description":"```True``` if the current state accepts a TagSelected event.\r\n            Trying to send a TagSelected event to a state that does not accept it\r\n            causes no transition. It is simply ignored."},"acceptsFeedback":{"type":"boolean","description":"```True``` if the current state accepts a feedback intent\r\n            (e.g. \"it's not what I asked\") to notify the answer was incorrect.\r\n            Trying to send a feedback intent to a state that does not accept it\r\n            causes no transition. A courtesy answer is replied."},"hints":{"type":"array","items":{"type":"string"},"description":"List of texts suggested or accepted in the current state.\r\nIf empty does not mean the current state accepts no texts, but\r\nrather that there are no suggestions.","nullable":true},"timeout":{"type":"number","description":"Idle timeout, in seconds.\r\nSpecifies the time after which, if the user remains in idle state,\r\na Timeout event should be sent.\r\nMay be ```Null``` if the current state does not accept\r\nTimeout events.","format":"double","nullable":true},"currentTag":{"type":"string","description":"Latest tag set with a Tag Changed event.","nullable":true},"currentTagAuthenticated":{"type":"boolean","description":"True if the latest tag set with a Tag Changed event\r\nhas been successfully authenticated with its PIN."},"currentDate":{"type":"string","description":"Latest date set with a Date Changed event.","format":"date-time","nullable":true},"currentPlaceName":{"type":"string","description":"The name of the latest place set with Place Changed event.","nullable":true},"currentLatitude":{"type":"number","description":"The latitude of the latest place set with Place Changed event.","format":"double","nullable":true},"currentLongitude":{"type":"number","description":"The longitude of the latest place set with Place Changed event.","format":"double","nullable":true},"currentUncertaintyKm":{"type":"number","description":"The uncertainty in kilometers of the latest place set with Place Changed event.","format":"double","nullable":true},"currentMemoryID":{"type":"string","description":"ID of the current Memory object being created or answered.","nullable":true},"lastMatchedMemoryID":{"type":"string","description":"ID of the last Memory object matched and emitted.","nullable":true},"currentMedia":{"type":"array","items":{"$ref":"#/components/schemas/MediumSpecs"},"description":"List of Medium objects temporarily stored in the Dialog State Machine via MediumSelected events.\r\nMedia stored in the Current Media list will be sent to any configured generative AI at the\r\nnext TextEntered event. After a TextEntered event the list is always cleared.","nullable":true},"contextVars":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Current context, expressed as a set of variable-value paris.","nullable":true},"memoryTags":{"type":"array","items":{"type":"string"},"description":"The tags associated with the current Memory.","nullable":true},"llmUsage":{"$ref":"#/components/schemas/InteractionLLMUsage"}},"additionalProperties":false,"description":"Specifications of a state of the Dialog State Machine."},"MediumSpecs":{"type":"object","properties":{"mediumID":{"type":"string","description":"Medium object ID.","nullable":true},"url":{"type":"string","description":"URL of the Medium. If specified, the Content property must be ```Null```.\r\nUse this property to link large amounts of data stored externally.\r\nIf the amount of data is modest the Content property may be used as an alternative.","nullable":true},"content":{"type":"string","description":"Content of the Medium. If specified, the URL property must be ```Null```.\r\nDon't use this property to store large amounts of data. Can be used to store limited \r\ntext for a maximum of 10 KiB. For larger amounts store the data externally and link it\r\nvia the URL property.","nullable":true},"mimeType":{"type":"string","description":"MIME type of the Medium.\r\nRequired during Add operations.","nullable":true},"title":{"type":"string","description":"Title of the Medium.","nullable":true},"properties":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Key-value pairs for additional structured content storage.","nullable":true},"creationTimestamp":{"type":"string","description":"Timestamp of creation. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"creationSessionID":{"type":"string","description":"ID of the session that created this object.","nullable":true},"lastChangeTimestamp":{"type":"string","description":"Timestamp of latest change. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"lastChangeSessionID":{"type":"string","description":"ID of the latest session that changed this object.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Medium object."},"InteractionLLMUsage":{"type":"object","properties":{"provider":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"totalInputTokens":{"type":"integer","format":"int32"},"inputCacheReadTokens":{"type":"integer","format":"int32"},"inputCacheWriteTokens":{"type":"integer","format":"int32"},"outputTokens":{"type":"integer","format":"int32"},"durationMs":{"type":"integer","format":"int32"},"energyImpact":{"$ref":"#/components/schemas/InteractionEnergyImpact"}},"additionalProperties":false},"InteractionEnergyImpact":{"type":"object","properties":{"energy":{"type":"number","format":"double","nullable":true},"energyUnit":{"type":"string","nullable":true},"gwp":{"type":"number","format":"double","nullable":true},"gwpUnit":{"type":"string","nullable":true},"adPe":{"type":"number","format":"double","nullable":true},"adPeUnit":{"type":"string","nullable":true},"pe":{"type":"number","format":"double","nullable":true},"peUnit":{"type":"string","nullable":true},"wcf":{"type":"number","format":"double","nullable":true},"wcfUnit":{"type":"string","nullable":true}},"additionalProperties":false}}}}
````

## DELETE /memori/v2/Session/{strSessionID}

> Closes the session and disposes of its Dialog State Machine.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Session/{strSessionID}":{"delete":{"tags":["Session"],"summary":"Closes the session and disposes of its Dialog State Machine.","operationId":"Session-CloseSession","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"Response":{"type":"object","properties":{"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous response.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous response.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is equivalent to the HTTP\r\nstatus code.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Base response."}}}}
````

## GET /memori/v2/Session/{strSessionID}/IsValid

> Checks if a session is valid (exists and is not in terminal state)

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Session/{strSessionID}/IsValid":{"get":{"tags":["Session"],"summary":"Checks if a session is valid (exists and is not in terminal state)","operationId":"Session-IsSessionValid","parameters":[{"name":"strSessionID","in":"path","description":"The session ID to check","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionValidResponse"}}}}}}}},"components":{"schemas":{"SessionValidResponse":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Indicates whether the session is valid (exists and is not in terminal state Z0)."},"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous response.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous response.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is equivalent to the HTTP\r\nstatus code.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response for session validity check requests."}}}}
````


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aisuru.com/api/engine/session.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
