# Functions

## Lists all Macro Function objects.

> This API requires a Giver session.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/MacroFunctions/{strSessionID}":{"get":{"tags":["Functions"],"summary":"Lists all Macro Function objects.","description":"This API requires a Giver session.","operationId":"Functions-ListMacroFunctions","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/ListMacroFunctionsResponse"}}}}}}}},"components":{"schemas":{"ListMacroFunctionsResponse":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of Function objects.","format":"int32"},"macroFunctions":{"type":"array","items":{"$ref":"#/components/schemas/MacroFunctionSpecs"},"description":"List of Function objects.\r\nMay be empty.","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 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},"MacroFunctionSpecs":{"type":"object","properties":{"name":{"type":"string","description":"Name of the Macro Function object.","nullable":true},"descriptions":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Descriptions of the Macro Function object, in different languages/cultures.\r\nThe key is the language/culture, e.g. \"en-US\" or \"it-IT\",\r\nand the value is the corresponding text.","nullable":true},"macroParameters":{"type":"array","items":{"$ref":"#/components/schemas/MacroParameterSpecs"},"description":"List of its Macro Parameter objects.\r\nMay be empty.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Macro Function object."},"MacroParameterSpecs":{"type":"object","properties":{"name":{"type":"string","description":"Name of the Macro Parameter object.","nullable":true},"descriptions":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Description of the Macro Parameter object, in different languages/cultures.\r\nThe key is the language/culture, e.g. \"en-US\" or \"it-IT\",\r\nand the value is the corresponding text.","nullable":true},"obfuscated":{"type":"boolean","description":"Whether the Macro Parameter value must be obfuscated when displayed\r\n(e.g. the parameter represents a password, an API key etc.)."}},"additionalProperties":false}}}}
````

## Lists all Function objects.

> This API requires a Giver session.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Functions/{strSessionID}":{"get":{"tags":["Functions"],"summary":"Lists all Function objects.","description":"This API requires a Giver session.","operationId":"Functions-ListFunctions","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/ListFunctionsResponse"}}}}}}}},"components":{"schemas":{"ListFunctionsResponse":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of Function objects.","format":"int32"},"functions":{"type":"array","items":{"$ref":"#/components/schemas/FunctionSpecs"},"description":"List of Function objects.\r\nMay be empty.","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 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 a List Functions request."},"FunctionSpecs":{"type":"object","properties":{"functionID":{"type":"string","description":"Function object ID.","nullable":true},"functionType":{"type":"string","description":"Function type, e.g. ```Internal``` or ```WebHook```.\r\nInternal functions are a limited subset implemented internally,\r\nwhile WebHook intents perform an external HTTP call to the\r\nspecified web hook, using the specified templates.\r\nRequired during Add operations.\r\nIgnored during Update operations.","nullable":true},"name":{"type":"string","description":"Name of the Function object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the function.\r\nRequired during Add operations.","nullable":true},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/FunctionParameterSpecs"},"description":"List of its Function Parameter objects.\r\nMay be empty.","nullable":true},"webHook":{"type":"string","description":"HTTP URL of the web hook to be called when the function is invoked,\r\nup to the path part. The query string part is specified separately.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```http://example.com/{param}/something```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpMethod":{"type":"string","description":"HTTP method to be used when calling the web hook, e.g. \"GET\", \"POST\" etc.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpHeaders":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Optional set of HTTP headers to be passed to the web hook.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpQueryStringTemplate":{"type":"string","description":"Template of the HTTP query string to be passed to the web hook.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```param1={param1}&param2={param2}```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyTemplate":{"type":"string","description":"Template of the HTTP request body to be passed to the web hook.\r\nIt may be in any format (JSON, XML etc.), and may include the value of function \r\nparameters using the syntax ```{parameter}```, where \"parameter\"\r\nis the parameter name. E.g.: ```{ \"param1\": \"{param1}\", \"param2\": \"{param2}\" }```,\r\nor: ```<request><param1>{param1}</param1><param2>{param2}</param2></request>```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyContentType":{"type":"string","description":"MIME type of the HTTP request body to be passed to the web hook.\r\nIf not specified \"text/plain\" is assumed.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"sendExtensionHeaders":{"type":"array","items":{"type":"string"},"description":"List of extension headers to be sent to the web hook. Extension headers let the web hook receive internal information on the current state of the conversation, such as the session ID, current date and place, context variables etc. If the function is of Internal type, it is ignored. <br> Currently supported extension headers are:<ul> <li><code>SESSION-ID</code>: the current session ID, sent with header X-Memori-Session-ID</li> <li><code>CURRENT-TAG</code>: the current tag, sent with headers X-Memori-Current-Tag and X-Memori-Current-Tag-Authenticated</li> <li><code>CURRENT-DATE</code>: the current date in UTC, sent with header X-Memori-Current-Date</li> <li><code>CURRENT-PLACE</code>: the current place, sent with headers X-Memori-Current-Place-Name, X-Memori-Current-Place-Latitude, X-Memori-Current-Place-Longitude and X-Memori-Current-Place-UncertaintyKm</li> <li><code>CONTEXT-VARS</code>: the current context variables, sent with header X-Memori-Context-Vars, with the format NAME1:VALUE1,NAME2:VALUE2,...,NAMEn:VALUEn</li> <li><code>USER-EMAIL</code>: the current user email, sent with header X-Memori-User-Email</li> </ul>","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 an Function object."},"FunctionParameterSpecs":{"type":"object","properties":{"parameterID":{"type":"string","description":"Function Parameter object ID.","nullable":true},"name":{"type":"string","description":"Name of the Function Parameter object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function Parameter object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the parameter.\r\nRequired during Add operations.","nullable":true},"parameterType":{"type":"string","description":"Parameter type, e.g. \"string\", \"number\", \"integer\", \"boolean\". Required during Add operations. <br> Currently supported types are:<ul> <li><code>string</code>: string value</li> <li><code>number</code>: floating point value</li> <li><code>integer</code>: integer value</li> <li><code>boolean</code>: boolean value</li> </ul>","nullable":true},"possibleValues":{"type":"array","items":{"type":"string"},"description":"Optional list of possible values of the parameter.\r\nIf empty or null, the parameter accepts any value of the specified type.","nullable":true},"required":{"type":"boolean","description":"Whether the parameter is required or not.\r\nDefault is not required.","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 an Function Parameter object."}}}}
````

## Lists Function objects with pagination.

> This API requires a Giver session.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Functions/{strSessionID}/{from}/{howMany}":{"get":{"tags":["Functions"],"summary":"Lists Function objects with pagination.","description":"This API requires a Giver session.","operationId":"Functions-ListFunctionsPaginated","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}},{"name":"from","in":"path","description":"The 0-based index of the first Function object to list","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"howMany","in":"path","description":"The number of the Function objects to list","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFunctionsResponse"}}}}}}}},"components":{"schemas":{"ListFunctionsResponse":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of Function objects.","format":"int32"},"functions":{"type":"array","items":{"$ref":"#/components/schemas/FunctionSpecs"},"description":"List of Function objects.\r\nMay be empty.","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 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 a List Functions request."},"FunctionSpecs":{"type":"object","properties":{"functionID":{"type":"string","description":"Function object ID.","nullable":true},"functionType":{"type":"string","description":"Function type, e.g. ```Internal``` or ```WebHook```.\r\nInternal functions are a limited subset implemented internally,\r\nwhile WebHook intents perform an external HTTP call to the\r\nspecified web hook, using the specified templates.\r\nRequired during Add operations.\r\nIgnored during Update operations.","nullable":true},"name":{"type":"string","description":"Name of the Function object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the function.\r\nRequired during Add operations.","nullable":true},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/FunctionParameterSpecs"},"description":"List of its Function Parameter objects.\r\nMay be empty.","nullable":true},"webHook":{"type":"string","description":"HTTP URL of the web hook to be called when the function is invoked,\r\nup to the path part. The query string part is specified separately.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```http://example.com/{param}/something```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpMethod":{"type":"string","description":"HTTP method to be used when calling the web hook, e.g. \"GET\", \"POST\" etc.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpHeaders":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Optional set of HTTP headers to be passed to the web hook.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpQueryStringTemplate":{"type":"string","description":"Template of the HTTP query string to be passed to the web hook.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```param1={param1}&param2={param2}```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyTemplate":{"type":"string","description":"Template of the HTTP request body to be passed to the web hook.\r\nIt may be in any format (JSON, XML etc.), and may include the value of function \r\nparameters using the syntax ```{parameter}```, where \"parameter\"\r\nis the parameter name. E.g.: ```{ \"param1\": \"{param1}\", \"param2\": \"{param2}\" }```,\r\nor: ```<request><param1>{param1}</param1><param2>{param2}</param2></request>```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyContentType":{"type":"string","description":"MIME type of the HTTP request body to be passed to the web hook.\r\nIf not specified \"text/plain\" is assumed.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"sendExtensionHeaders":{"type":"array","items":{"type":"string"},"description":"List of extension headers to be sent to the web hook. Extension headers let the web hook receive internal information on the current state of the conversation, such as the session ID, current date and place, context variables etc. If the function is of Internal type, it is ignored. <br> Currently supported extension headers are:<ul> <li><code>SESSION-ID</code>: the current session ID, sent with header X-Memori-Session-ID</li> <li><code>CURRENT-TAG</code>: the current tag, sent with headers X-Memori-Current-Tag and X-Memori-Current-Tag-Authenticated</li> <li><code>CURRENT-DATE</code>: the current date in UTC, sent with header X-Memori-Current-Date</li> <li><code>CURRENT-PLACE</code>: the current place, sent with headers X-Memori-Current-Place-Name, X-Memori-Current-Place-Latitude, X-Memori-Current-Place-Longitude and X-Memori-Current-Place-UncertaintyKm</li> <li><code>CONTEXT-VARS</code>: the current context variables, sent with header X-Memori-Context-Vars, with the format NAME1:VALUE1,NAME2:VALUE2,...,NAMEn:VALUEn</li> <li><code>USER-EMAIL</code>: the current user email, sent with header X-Memori-User-Email</li> </ul>","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 an Function object."},"FunctionParameterSpecs":{"type":"object","properties":{"parameterID":{"type":"string","description":"Function Parameter object ID.","nullable":true},"name":{"type":"string","description":"Name of the Function Parameter object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function Parameter object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the parameter.\r\nRequired during Add operations.","nullable":true},"parameterType":{"type":"string","description":"Parameter type, e.g. \"string\", \"number\", \"integer\", \"boolean\". Required during Add operations. <br> Currently supported types are:<ul> <li><code>string</code>: string value</li> <li><code>number</code>: floating point value</li> <li><code>integer</code>: integer value</li> <li><code>boolean</code>: boolean value</li> </ul>","nullable":true},"possibleValues":{"type":"array","items":{"type":"string"},"description":"Optional list of possible values of the parameter.\r\nIf empty or null, the parameter accepts any value of the specified type.","nullable":true},"required":{"type":"boolean","description":"Whether the parameter is required or not.\r\nDefault is not required.","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 an Function Parameter object."}}}}
````

## Gets the details of a Function object.

> This API requires a Giver session.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Function/{strSessionID}/{strFunctionID}":{"get":{"tags":["Functions"],"summary":"Gets the details of a Function object.","description":"This API requires a Giver session.","operationId":"Functions-GetFunction","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}},{"name":"strFunctionID","in":"path","description":"The Function object ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFunctionResponse"}}}}}}}},"components":{"schemas":{"GetFunctionResponse":{"type":"object","properties":{"function":{"$ref":"#/components/schemas/FunctionSpecs"},"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 a Get Function request."},"FunctionSpecs":{"type":"object","properties":{"functionID":{"type":"string","description":"Function object ID.","nullable":true},"functionType":{"type":"string","description":"Function type, e.g. ```Internal``` or ```WebHook```.\r\nInternal functions are a limited subset implemented internally,\r\nwhile WebHook intents perform an external HTTP call to the\r\nspecified web hook, using the specified templates.\r\nRequired during Add operations.\r\nIgnored during Update operations.","nullable":true},"name":{"type":"string","description":"Name of the Function object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the function.\r\nRequired during Add operations.","nullable":true},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/FunctionParameterSpecs"},"description":"List of its Function Parameter objects.\r\nMay be empty.","nullable":true},"webHook":{"type":"string","description":"HTTP URL of the web hook to be called when the function is invoked,\r\nup to the path part. The query string part is specified separately.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```http://example.com/{param}/something```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpMethod":{"type":"string","description":"HTTP method to be used when calling the web hook, e.g. \"GET\", \"POST\" etc.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpHeaders":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Optional set of HTTP headers to be passed to the web hook.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpQueryStringTemplate":{"type":"string","description":"Template of the HTTP query string to be passed to the web hook.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```param1={param1}&param2={param2}```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyTemplate":{"type":"string","description":"Template of the HTTP request body to be passed to the web hook.\r\nIt may be in any format (JSON, XML etc.), and may include the value of function \r\nparameters using the syntax ```{parameter}```, where \"parameter\"\r\nis the parameter name. E.g.: ```{ \"param1\": \"{param1}\", \"param2\": \"{param2}\" }```,\r\nor: ```<request><param1>{param1}</param1><param2>{param2}</param2></request>```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyContentType":{"type":"string","description":"MIME type of the HTTP request body to be passed to the web hook.\r\nIf not specified \"text/plain\" is assumed.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"sendExtensionHeaders":{"type":"array","items":{"type":"string"},"description":"List of extension headers to be sent to the web hook. Extension headers let the web hook receive internal information on the current state of the conversation, such as the session ID, current date and place, context variables etc. If the function is of Internal type, it is ignored. <br> Currently supported extension headers are:<ul> <li><code>SESSION-ID</code>: the current session ID, sent with header X-Memori-Session-ID</li> <li><code>CURRENT-TAG</code>: the current tag, sent with headers X-Memori-Current-Tag and X-Memori-Current-Tag-Authenticated</li> <li><code>CURRENT-DATE</code>: the current date in UTC, sent with header X-Memori-Current-Date</li> <li><code>CURRENT-PLACE</code>: the current place, sent with headers X-Memori-Current-Place-Name, X-Memori-Current-Place-Latitude, X-Memori-Current-Place-Longitude and X-Memori-Current-Place-UncertaintyKm</li> <li><code>CONTEXT-VARS</code>: the current context variables, sent with header X-Memori-Context-Vars, with the format NAME1:VALUE1,NAME2:VALUE2,...,NAMEn:VALUEn</li> <li><code>USER-EMAIL</code>: the current user email, sent with header X-Memori-User-Email</li> </ul>","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 an Function object."},"FunctionParameterSpecs":{"type":"object","properties":{"parameterID":{"type":"string","description":"Function Parameter object ID.","nullable":true},"name":{"type":"string","description":"Name of the Function Parameter object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function Parameter object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the parameter.\r\nRequired during Add operations.","nullable":true},"parameterType":{"type":"string","description":"Parameter type, e.g. \"string\", \"number\", \"integer\", \"boolean\". Required during Add operations. <br> Currently supported types are:<ul> <li><code>string</code>: string value</li> <li><code>number</code>: floating point value</li> <li><code>integer</code>: integer value</li> <li><code>boolean</code>: boolean value</li> </ul>","nullable":true},"possibleValues":{"type":"array","items":{"type":"string"},"description":"Optional list of possible values of the parameter.\r\nIf empty or null, the parameter accepts any value of the specified type.","nullable":true},"required":{"type":"boolean","description":"Whether the parameter is required or not.\r\nDefault is not required.","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 an Function Parameter object."}}}}
````

## Removes an existing Function object.

> This API requires a Giver session.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Function/{strSessionID}/{strFunctionID}":{"delete":{"tags":["Functions"],"summary":"Removes an existing Function object.","description":"This API requires a Giver session.","operationId":"Functions-RemoveFunction","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}},{"name":"strFunctionID","in":"path","description":"The Function object 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."}}}}
````

## Updates an existing Function object.

> This API requires a Giver session.> \
> Only non-null (present) fields are considered for update.> \
> Null or absent fields are left unaltered.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Function/{strSessionID}/{strFunctionID}":{"patch":{"tags":["Functions"],"summary":"Updates an existing Function object.","description":"This API requires a Giver session.\r\nOnly non-null (present) fields are considered for update.\r\nNull or absent fields are left unaltered.","operationId":"Functions-UpdateFunction","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}},{"name":"strFunctionID","in":"path","description":"The Function object ID","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The Function object specifications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFunctionSpecs"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"UpdateFunctionSpecs":{"type":"object","properties":{"functionID":{"type":"string","description":"Function object ID.","nullable":true},"functionType":{"type":"string","description":"Function type, e.g. ```Internal``` or ```WebHook```.\r\nInternal functions are a limited subset implemented internally,\r\nwhile WebHook intents perform an external HTTP call to the\r\nspecified web hook, using the specified templates.\r\nRequired during Add operations.\r\nIgnored during Update operations.","nullable":true},"name":{"type":"string","description":"Name of the Function object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the function.\r\nRequired during Add operations.","nullable":true},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/FunctionParameterSpecs"},"description":"List of its Function Parameter objects.\r\nMay be empty.","nullable":true},"webHook":{"type":"string","description":"HTTP URL of the web hook to be called when the function is invoked,\r\nup to the path part. The query string part is specified separately.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```http://example.com/{param}/something```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpMethod":{"type":"string","description":"HTTP method to be used when calling the web hook, e.g. \"GET\", \"POST\" etc.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpHeaders":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Optional set of HTTP headers to be passed to the web hook.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpQueryStringTemplate":{"type":"string","description":"Template of the HTTP query string to be passed to the web hook.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```param1={param1}&param2={param2}```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyTemplate":{"type":"string","description":"Template of the HTTP request body to be passed to the web hook.\r\nIt may be in any format (JSON, XML etc.), and may include the value of function \r\nparameters using the syntax ```{parameter}```, where \"parameter\"\r\nis the parameter name. E.g.: ```{ \"param1\": \"{param1}\", \"param2\": \"{param2}\" }```,\r\nor: ```<request><param1>{param1}</param1><param2>{param2}</param2></request>```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyContentType":{"type":"string","description":"MIME type of the HTTP request body to be passed to the web hook.\r\nIf not specified \"text/plain\" is assumed.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"sendExtensionHeaders":{"type":"array","items":{"type":"string"},"description":"List of extension headers to be sent to the web hook. Extension headers let the web hook receive internal information on the current state of the conversation, such as the session ID, current date and place, context variables etc. If the function is of Internal type, it is ignored. <br> Currently supported extension headers are:<ul> <li><code>SESSION-ID</code>: the current session ID, sent with header X-Memori-Session-ID</li> <li><code>CURRENT-TAG</code>: the current tag, sent with headers X-Memori-Current-Tag and X-Memori-Current-Tag-Authenticated</li> <li><code>CURRENT-DATE</code>: the current date in UTC, sent with header X-Memori-Current-Date</li> <li><code>CURRENT-PLACE</code>: the current place, sent with headers X-Memori-Current-Place-Name, X-Memori-Current-Place-Latitude, X-Memori-Current-Place-Longitude and X-Memori-Current-Place-UncertaintyKm</li> <li><code>CONTEXT-VARS</code>: the current context variables, sent with header X-Memori-Context-Vars, with the format NAME1:VALUE1,NAME2:VALUE2,...,NAMEn:VALUEn</li> <li><code>USER-EMAIL</code>: the current user email, sent with header X-Memori-User-Email</li> </ul>","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 for an Update Function request."},"FunctionParameterSpecs":{"type":"object","properties":{"parameterID":{"type":"string","description":"Function Parameter object ID.","nullable":true},"name":{"type":"string","description":"Name of the Function Parameter object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function Parameter object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the parameter.\r\nRequired during Add operations.","nullable":true},"parameterType":{"type":"string","description":"Parameter type, e.g. \"string\", \"number\", \"integer\", \"boolean\". Required during Add operations. <br> Currently supported types are:<ul> <li><code>string</code>: string value</li> <li><code>number</code>: floating point value</li> <li><code>integer</code>: integer value</li> <li><code>boolean</code>: boolean value</li> </ul>","nullable":true},"possibleValues":{"type":"array","items":{"type":"string"},"description":"Optional list of possible values of the parameter.\r\nIf empty or null, the parameter accepts any value of the specified type.","nullable":true},"required":{"type":"boolean","description":"Whether the parameter is required or not.\r\nDefault is not required.","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 an Function Parameter object."},"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."}}}}
````

## Adds a new Function object.

> This API requires a Giver session.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/Function/{strSessionID}":{"post":{"tags":["Functions"],"summary":"Adds a new Function object.","description":"This API requires a Giver session.","operationId":"Functions-AddFunction","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The Function object specifications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFunctionSpecs"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFunctionResponse"}}}}}}}},"components":{"schemas":{"AddFunctionSpecs":{"type":"object","properties":{"functionID":{"type":"string","description":"Function object ID.","nullable":true},"functionType":{"type":"string","description":"Function type, e.g. ```Internal``` or ```WebHook```.\r\nInternal functions are a limited subset implemented internally,\r\nwhile WebHook intents perform an external HTTP call to the\r\nspecified web hook, using the specified templates.\r\nRequired during Add operations.\r\nIgnored during Update operations.","nullable":true},"name":{"type":"string","description":"Name of the Function object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the function.\r\nRequired during Add operations.","nullable":true},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/FunctionParameterSpecs"},"description":"List of its Function Parameter objects.\r\nMay be empty.","nullable":true},"webHook":{"type":"string","description":"HTTP URL of the web hook to be called when the function is invoked,\r\nup to the path part. The query string part is specified separately.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```http://example.com/{param}/something```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpMethod":{"type":"string","description":"HTTP method to be used when calling the web hook, e.g. \"GET\", \"POST\" etc.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpHeaders":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Optional set of HTTP headers to be passed to the web hook.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpQueryStringTemplate":{"type":"string","description":"Template of the HTTP query string to be passed to the web hook.\r\nIt may include the value of function parameters using the syntax ```{parameter}```,\r\nwhere \"parameter\" is the parameter name. E.g.: ```param1={param1}&param2={param2}```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyTemplate":{"type":"string","description":"Template of the HTTP request body to be passed to the web hook.\r\nIt may be in any format (JSON, XML etc.), and may include the value of function \r\nparameters using the syntax ```{parameter}```, where \"parameter\"\r\nis the parameter name. E.g.: ```{ \"param1\": \"{param1}\", \"param2\": \"{param2}\" }```,\r\nor: ```<request><param1>{param1}</param1><param2>{param2}</param2></request>```.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"httpBodyContentType":{"type":"string","description":"MIME type of the HTTP request body to be passed to the web hook.\r\nIf not specified \"text/plain\" is assumed.\r\nIf the function is of Internal type, it is ignored.","nullable":true},"sendExtensionHeaders":{"type":"array","items":{"type":"string"},"description":"List of extension headers to be sent to the web hook. Extension headers let the web hook receive internal information on the current state of the conversation, such as the session ID, current date and place, context variables etc. If the function is of Internal type, it is ignored. <br> Currently supported extension headers are:<ul> <li><code>SESSION-ID</code>: the current session ID, sent with header X-Memori-Session-ID</li> <li><code>CURRENT-TAG</code>: the current tag, sent with headers X-Memori-Current-Tag and X-Memori-Current-Tag-Authenticated</li> <li><code>CURRENT-DATE</code>: the current date in UTC, sent with header X-Memori-Current-Date</li> <li><code>CURRENT-PLACE</code>: the current place, sent with headers X-Memori-Current-Place-Name, X-Memori-Current-Place-Latitude, X-Memori-Current-Place-Longitude and X-Memori-Current-Place-UncertaintyKm</li> <li><code>CONTEXT-VARS</code>: the current context variables, sent with header X-Memori-Context-Vars, with the format NAME1:VALUE1,NAME2:VALUE2,...,NAMEn:VALUEn</li> <li><code>USER-EMAIL</code>: the current user email, sent with header X-Memori-User-Email</li> </ul>","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 for an Add Function request."},"FunctionParameterSpecs":{"type":"object","properties":{"parameterID":{"type":"string","description":"Function Parameter object ID.","nullable":true},"name":{"type":"string","description":"Name of the Function Parameter object.\r\nRequired during Add operations.","nullable":true},"description":{"type":"string","description":"Description of the Function Parameter object. The description is provided to the\r\ngenerative AI to help it understand the purpose of the parameter.\r\nRequired during Add operations.","nullable":true},"parameterType":{"type":"string","description":"Parameter type, e.g. \"string\", \"number\", \"integer\", \"boolean\". Required during Add operations. <br> Currently supported types are:<ul> <li><code>string</code>: string value</li> <li><code>number</code>: floating point value</li> <li><code>integer</code>: integer value</li> <li><code>boolean</code>: boolean value</li> </ul>","nullable":true},"possibleValues":{"type":"array","items":{"type":"string"},"description":"Optional list of possible values of the parameter.\r\nIf empty or null, the parameter accepts any value of the specified type.","nullable":true},"required":{"type":"boolean","description":"Whether the parameter is required or not.\r\nDefault is not required.","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 an Function Parameter object."},"AddFunctionResponse":{"type":"object","properties":{"functionID":{"type":"string","description":"Function object ID.","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 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 Add Function request."}}}}
````


---

# 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/functions.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.
