> For the complete documentation index, see [llms.txt](https://docs.aisuru.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aisuru.com/api/backend/analysis.md).

# Analysis

## POST /api/v2/Analysis/AnalyzeUserQuery/{strToken}/{strMemoriID}

> Starts an Analysis process for User/query match on Deep Thought known facts.

````json
{"openapi":"3.0.1","info":{"title":"Memori.ai Web API V2","version":"v2"},"paths":{"/api/v2/Analysis/AnalyzeUserQuery/{strToken}/{strMemoriID}":{"post":{"tags":["Analysis"],"summary":"Starts an Analysis process for User/query match on Deep Thought known facts.","operationId":"Analysis-AnalyzeUserQuery","parameters":[{"name":"strToken","in":"path","description":"The login token","required":true,"schema":{"type":"string"}},{"name":"strMemoriID","in":"path","description":"The ID of the Memori object","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The specifications of the analysis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserQueryAnalysisSpecs"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisStatusSpecsProcessStatusResponse"}}}}}}}},"components":{"schemas":{"UserQueryAnalysisSpecs":{"type":"object","properties":{"query":{"type":"string","description":"Query to be matched with User objects in the analysis.\r\nRequired.","nullable":true},"threshold":{"type":"number","description":"Threshold between 0.0 and 1.0. User objects whose match level\r\nis below this threshold will be discarded.\r\nIf null, all User objects will be returned.","format":"float","nullable":true}},"additionalProperties":false},"AnalysisStatusSpecsProcessStatusResponse":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/AnalysisStatusSpecs"},"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 reponse.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous reponse.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is indicative of the actual\r\nerror.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response of an Import, Analysis or Get Process Status requests."},"AnalysisStatusSpecs":{"type":"object","properties":{"analysisType":{"type":"string","description":"Analysis type. Required. <br> Can be one of the following:<ul> <li><code>UserQuery</code>: for Deep Thought User/query Match analysis</li> </ul>","nullable":true},"query":{"type":"string","description":"Query to be used in the analysis.\r\nUsed when AnalysisType is ```UserQuery```.","nullable":true},"analysisWarningsCount":{"type":"integer","description":"Number of Import Warning objects","format":"int32"},"analysisWarnings":{"type":"array","items":{"$ref":"#/components/schemas/AnalysisWarning"},"description":"List of Import Warning objects.\r\nMay be empty.","nullable":true},"processID":{"type":"string","description":"Process ID.","nullable":true},"memoriID":{"type":"string","description":"ID of the Memori object this Process refers to.","nullable":true},"processUserName":{"type":"string","description":"Name of the user that started the Process.","nullable":true},"processType":{"type":"string","description":"Process type. <br> Can be one of the following:<ul> <li><code>Import</code>: for file import processes</li> <li><code>Analysis</code>: for Deep Thought user/query analysis processes</li> </ul>","nullable":true},"status":{"type":"string","description":"Current status of the Process (starting, running etc.). <br> May be one of the following:<ul> <li><code>Starting</code>: the Process is preparing to start, but has not started yet. Will advance to <code>Running</code> automatically.</li> <li><code>Running</code>: the Process has been started and is actively processing elements.</li> <li><code>Stopped</code>: the Process has been stopped manually, not all elements may have been processed.</li> <li><code>Completed</code>: the Process finished successfully, all the elements have been processed.</li> <li><code>Failed</code>: the Process terminated due to an unexpected error, not all elements may have been processed.</li> </ul>","nullable":true},"error":{"type":"string","description":"If the Status is ```Failed```, reports the error that\r\ncaused the Process to fail.\r\nNull otherwise.","nullable":true},"totalElements":{"type":"integer","description":"Total elements this Process is processing.","format":"int32"},"processedElements":{"type":"integer","description":"Number of elements this Process has processed so far.","format":"int32"},"progress":{"type":"number","description":"Progress of the Process as a fraction of 1.","format":"float"},"processSpecsJSON":{"type":"string","description":"Original parameters of the Process request, as a JSON structure,\r\nexcluding the elements (e.g. document rows for an Import process).","nullable":true},"begin":{"type":"string","description":"Timestamp of start of the Process.\r\nNull until the Process is in ```Starting``` status.","format":"date-time","nullable":true},"end":{"type":"string","description":"Timestamp of end of the Process.\r\nNull until the Process is in ```Starting``` or\r\n```Running``` status.","format":"date-time","nullable":true},"eta":{"type":"number","description":"Estimated time required to complete the Process,\r\nin seconds.","format":"float","nullable":true},"creationTimestamp":{"type":"string","description":"Timestamp of creation. Returned during Get operations.\r\nIgnored in other cases.","format":"date-time","nullable":true},"lastChangeTimestamp":{"type":"string","description":"Timestamp of latest change. Returned during Get operations.\r\nIgnored in other cases.","format":"date-time","nullable":true}},"additionalProperties":false},"AnalysisWarning":{"type":"object","properties":{"warningType":{"type":"string","description":"Type of warning. <br> <ul>Currently supported types are: <li><code>Error</code>: an error occurred while performing analysis</li> </ul>","nullable":true},"text":{"type":"string","description":"When ```WarningType``` is ```Error``` reports the\r\ntext of the error.","nullable":true}},"additionalProperties":false,"description":"Description of a possible problem during an Analysis operation."}}}}
````

## GET /api/v2/Analysis/UserQueryMatches/{strToken}/{strAnalysisID}/{from}/{howMany}/{threshold}

> Lists Deep Thought User/query Match objects of the specified Analysis object, with pagination.

````json
{"openapi":"3.0.1","info":{"title":"Memori.ai Web API V2","version":"v2"},"paths":{"/api/v2/Analysis/UserQueryMatches/{strToken}/{strAnalysisID}/{from}/{howMany}/{threshold}":{"get":{"tags":["Analysis"],"summary":"Lists Deep Thought User/query Match objects of the specified Analysis object, with pagination.","operationId":"Analysis-ListUserQueryMatches","parameters":[{"name":"strToken","in":"path","description":"The login token","required":true,"schema":{"type":"string"}},{"name":"strAnalysisID","in":"path","description":"The Analysis process ID","required":true,"schema":{"type":"string"}},{"name":"from","in":"path","description":"The 0-based index of the first Match object to list","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"howMany","in":"path","description":"The number of the Match objects to list","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"threshold","in":"path","description":"Optional threshold between 0.0 and 1.0: Match objects below the threshold are excluded from the list","schema":{"type":"number","format":"float"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUserQueryMatchesResponse"}}}}}}}},"components":{"schemas":{"ListUserQueryMatchesResponse":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of Deep Thought User/query Match objects.","format":"int32"},"matches":{"type":"array","items":{"$ref":"#/components/schemas/UserQueryMatchSpecs"},"description":"The list of Deep Thought User/query Match objects.","nullable":true},"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 reponse.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous reponse.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is indicative of the actual\r\nerror.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response of a List Deep Thought User/query Matches request."},"UserQueryMatchSpecs":{"type":"object","properties":{"userQueryMatchID":{"type":"string","description":"Match ID. Unique and assigned by the system.","nullable":true},"analysisID":{"type":"string","description":"ID of the Analysis object this match refers to.","nullable":true},"memoriID":{"type":"string","description":"ID of the Memori object this match refers to.","nullable":true},"engineUserID":{"type":"string","description":"ID of the corresponding User object on the Engine.","nullable":true},"userName":{"type":"string","description":"User name.","nullable":true},"tenantName":{"type":"string","description":"User's Tenant name.","nullable":true},"userEmail":{"type":"string","description":"User's e-mail.","nullable":true},"match":{"type":"number","description":"Match level between the Analysis query and this User.\r\nValue is between 0 and 1, with 0.0 meaning no match\r\nand 1.0 meaning perfect match.","format":"float"}},"additionalProperties":false,"description":"Specifications of a Deep Thought User/query Match object."}}}}
````
