{"basePath":"/mqtt","definitions":{"calc.interval.counter":{"anyOf":[{"$ref":"#/definitions/container.interval.counter.expression"},{"$ref":"#/definitions/container.interval.counter.dataset"},{"$ref":"#/definitions/container.interval.counter.route"},{"$ref":"#/definitions/container.interval.counter.datetime"},{"$ref":"#/definitions/container.interval.counter.parameter"},{"$ref":"#/definitions/container.interval.counter.message"},{"$ref":"#/definitions/container.interval.counter.interval"},{"$ref":"#/definitions/container.interval.counter.active"},{"$ref":"#/definitions/container.interval.counter.geofence"},{"$ref":"#/definitions/container.interval.counter.variable"},{"$ref":"#/definitions/container.interval.counter.specified"},{"$ref":"#/definitions/container.interval.counter.calculator"},{"$ref":"#/definitions/container.interval.counter.accumulator"}],"x-key-property":"type"},"calc.interval.counters":{"description":"[Intervals counters](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters), define how to calculate messsages inside each interval.\n","items":{"$ref":"#/definitions/calc.interval.counter"},"maxItems":50,"type":"array"},"calc.interval.selector":{"anyOf":[{"$ref":"#/definitions/container.interval.selector.expression"},{"$ref":"#/definitions/container.interval.selector.datetime"},{"$ref":"#/definitions/container.interval.selector.geofence"},{"$ref":"#/definitions/container.interval.selector.calculator"},{"$ref":"#/definitions/container.interval.selector.inactive"}],"x-key-property":"type"},"calc.interval.selectors":{"description":"[Intervals selectors](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors) are used to split device messages into intervals based on user-defined criteria.\nResulting intervals will have begin, end times, and duration. It is possible to have intervals that consist of one message only, i.e. with zero duration.\n\nEach interval selector type has its own internal logic in the configuration, determines the state of each analyzed message sequentially, and assigns each message one of the following:\n* ON — interval can continue\n* ON_NEW — interval should restart\n* OFF — interval should stop\n* UNKNOWN — unable to calculate\n\nSo, to detect one interval it is enough to have at least one message marked ON or ON_NEW.\n\nIf multiple interval selectors are specified, they will be merged with AND logic, i.e. only ranges where all specified interval selectors are active will be present in the final intervals\n","items":{"$ref":"#/definitions/calc.interval.selector"},"maxItems":3,"minItems":1,"type":"array"},"changelog.get":{"properties":{"count":{"default":10000000,"description":"limit number of posts to be returned","format":"uint32","maximum":10000000,"minimum":1,"type":"integer"},"fields":{"description":"CSV-formatted list of post fields to be returned","maxLength":4096,"type":"string"},"filter":{"description":"optional filter expression to return only matching posts","maxLength":1024,"type":"string","x-view-type":"expression"},"from":{"description":"start moment's UNIX timestamp, use 0 to ignore left bound","minimum":0,"type":"number","x-view-type":"datetime"},"reverse":{"default":false,"description":"use true to list posts from newest to oldest","type":"boolean"},"to":{"description":"end moment's UNIX timestamp, use 0 to ignore right bound","minimum":0,"type":"number","x-view-type":"datetime"}},"type":"object"},"changelog.post":{"properties":{"author":{"description":"display name of the post author on the forum","type":"string"},"name":{"description":"name of the changelog the post belongs to","type":"string"},"text":{"description":"post text in markdown format","format":"textarea","type":"string"},"timestamp":{"description":"post publication UNIX timestamp","type":"number","x-view-type":"datetime"},"title":{"description":"changelog topic title","type":"string"},"url":{"description":"direct link to the post on the forum","type":"string"}},"type":"object"},"changelog.posts":{"properties":{"result":{"description":"changelog posts sorted by publication time","items":{"$ref":"#/definitions/changelog.post"},"type":"array"}},"type":"object"},"container.interval":{"additionalProperties":true,"description":"selected interval data","properties":{"begin":{"$ref":"#/definitions/container.interval.begin"},"duration":{"$ref":"#/definitions/container.interval.duration"},"end":{"$ref":"#/definitions/container.interval.end"}},"type":"object"},"container.interval.begin":{"description":"interval begin time, UNIX timestamp","minimum":1,"type":"number","x-view-type":"datetime"},"container.interval.counter":{"anyOf":[{"$ref":"#/definitions/container.interval.counter.expression"},{"$ref":"#/definitions/container.interval.counter.dataset"},{"$ref":"#/definitions/container.interval.counter.route"},{"$ref":"#/definitions/container.interval.counter.datetime"},{"$ref":"#/definitions/container.interval.counter.parameter"},{"$ref":"#/definitions/container.interval.counter.message"},{"$ref":"#/definitions/container.interval.counter.interval"},{"$ref":"#/definitions/container.interval.counter.active"},{"$ref":"#/definitions/container.interval.counter.geofence"},{"$ref":"#/definitions/container.interval.counter.variable"},{"$ref":"#/definitions/container.interval.counter.specified"},{"$ref":"#/definitions/container.interval.counter.accumulator"}],"x-key-property":"type"},"container.interval.counter.accumulator":{"description":"Accumulate value of another counter across multiple intervals.\n\nUse to compute aggregate metrics like total mileage.\n","properties":{"counter":{"description":"Counter name which numerical value to accumulate.\n","maxLength":128,"minLength":1,"type":"string"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"reset_expression":{"description":"[Expression](https://flespi.com/kb/expressions) over interval counters that can be used to specify reset condition for accumulated value, e.g. when to start value accumulation again from scratch.\nNon-zero expression evaluation result means condition to be reset. For example you may specify: \"duration>3600\" to continiously accumulate value only for short intervals, that are less than 1 hour.\nprevious(\"counter_name\") function, if used in expression will return the value of counter_name counter from previously calculated and stored interval.\n","format":"expression-complex","maxLength":1024,"minLength":1,"type":"string","x-view-type":"expression"},"reset_interval":{"description":"Defines interval, upon which accumulated value will be automatically reset to zero","enum":["hour","day","week_monday","week_sunday","month","year"],"type":"string","x-view-enum-labels":["Hour","Day","Week (from Monday)","Week (from Sunday)","Month","Year"]},"type":{"const":"accumulator","default":"accumulator","description":"Accumulate value of another counter across multiple intervals.\n\nUse to compute aggregate metrics like total mileage.\n","readOnly":true,"type":"string"}},"required":["type","name","counter"],"title":"Accumulator","type":"object","x-view-order":["type","name","counter","reset_interval","reset_expression"],"x-view-shrink-field":"name"},"container.interval.counter.active":{"description":"Return true/false based on whether the interval is currently active/inactive.\n\nUse to detect unfinished (e.g. still is running) intervals.\n","properties":{"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"active","default":"active","description":"Return true/false based on whether the interval is currently active/inactive.\n\nUse to detect unfinished (e.g. still is running) intervals.\n","readOnly":true,"type":"string"}},"required":["type","name"],"title":"Active","type":"object","x-view-order":["type","name"],"x-view-shrink-field":"name"},"container.interval.counter.calculator":{"description":"Put intervals generated by another calculator into this calculator either as array(all or aggregated by some field) or object (first, last or aggregated).\nUse to intersect data from multiple calculators.","properties":{"allow_finish_after":{"description":"when true, may include intervals that started before our 'end' but finished later","type":"boolean"},"allow_start_before":{"description":"when true, may include intervals that started before our 'begin' but finished later","type":"boolean"},"calc_id":{"description":"Calculator ID which intervals to add","minimum":1,"type":"integer","x-flespi-acl":"gw/calcs","x-view-selector":"calcs"},"fields":{"description":"Specify which fields to copy from referenced calculator intervals.\nFor example to limit the size of counter JSON you may configure to include just 'id', 'begin' and 'duration' fields.\n","items":{"anyOf":[{"description":"Use field name from referenced calculator's interval as is","maxLength":64,"minLength":1,"pattern":"^[\\w:!%$.-]([\\w:!%$. -]*[\\w:!%$.-])?$","title":"Interval field","type":"string"},{"description":"Compute new field using expression over referenced calculator's interval fields and selected aggregate method\n\nIf expression is not specified the value of field from referenced interval JSON will be taken directly.\n","properties":{"aggregate":{"default":"first","description":"Aggregation method, valid only when counter method set to 'aggregate' or 'aggregate_by_field':\n - first - will be used the first calculated value\n - last - will be used the last calculated value\n - summary - will be used summation of all calculated values\n - minimum - will be used minimum calculated value (for numbers only)\n - maximum - will be used maximum calculated value (for numbers only)\n\n If 'aggregate_by_field' method is used aggregation method is not applicable to the first field, which is automatically used for grouping intervals\n","enum":["first","last","summary","minimum","maximum"],"type":"string"},"expression":{"description":"[Expression](https://flespi.com/kb/expressions) for calculating field value for the referenced interval.\n\nIf the expression value can not be calculated for the field it will generate null.\n\nIf expression is not specified for the field the value from referenced interval JSON will be taken directly.\n","format":"expression-complex","maxLength":256,"minLength":1,"type":"string","x-view-type":"expression"},"name":{"description":"field name, will be used as key in generated interval JSON","maxLength":64,"minLength":1,"pattern":"^[\\w:!%$.-]([\\w:!%$. -]*[\\w:!%$.-])?$","type":"string"}},"required":["name"],"title":"Computed field","type":"object","x-view-order":["name","expression","aggregate"],"x-view-shrink-field":"name"}]},"maxItems":24,"minItems":1,"type":"array"},"lookup_time_after":{"description":"specify how many seconds to look forward after interval end to search for intervals","maximum":864000,"minimum":0,"type":"integer"},"lookup_time_before":{"description":"specify how many seconds to look back before interval begin to search for intervals","maximum":864000,"minimum":0,"type":"integer"},"method":{"default":"each","description":"Method for selecting interval(s) from referenced calculator:\n - first - will be used the first suitable interval\n - last - will be used the last suitable interval\n - each - all suitable intervals values will be presented as array\n - aggregate - aggregate intervals into single, for this method you should specify fields\n - aggregate_by_field - group intervals based on the first field, and aggregate them into single value, the first field value will be used for grouping\n","enum":["first","last","each","aggregate","aggregate_by_field"],"type":"string"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"calc","default":"calc","description":"Put intervals generated by another calculator into this calculator either as array(all or aggregated by some field) or object (first, last or aggregated).\nUse to intersect data from multiple calculators.","readOnly":true,"type":"string"},"validate_interval":{"description":"Optional expression to validate intervals. If specified only those intervals from referenced calculator that conforms to the expression will be added.\nYou use flespi [expressions](https://flespi.com/kb/expressions) and reference interval counter fields as parameters inside it.\n","format":"expression-complex","maxLength":1024,"type":"string","x-view-type":"expression"}},"required":["type","name","calc_id"],"title":"Calculator","type":"object","x-view-order":["type","name","calc_id","method","validate_interval","allow_start_before","lookup_time_before","allow_finish_after","lookup_time_after","fields","aggregate"],"x-view-shrink-field":"name"},"container.interval.counter.dataset":{"description":"For each message generate a JSON object and return an array of generated points.\n\nUse to collect a set of specific data points for each interval, e.g. to plot them on a diagram.\n\nWhen there is a need to copy message parameters into the interval without any conversion or renaming it is suggested to use 'message' counter with method='each' instead.\nAlso take a look at counter of type='parameter' which can be also suitable instead of dataset.\n","properties":{"allow_unknown":{"description":"when true, if some field is not possible to calculate (e.g. parameter is missing) pass null instead","type":"boolean"},"fields":{"description":"values to be precalcuated for each message","items":{"properties":{"name":{"description":"field name, will be used as key in generated JSON for each message","maxLength":64,"minLength":1,"pattern":"^[\\w:!%$.-]([\\w:!%$. -]*[\\w:!%$.-])?$","type":"string"},"value":{"description":"[Expression](https://flespi.com/kb/expressions) for calculating field value for the message referencing values of its parameters, e.g.: (param1+param2)/(param3-param4)\n","format":"expression-complex","maxLength":256,"minLength":1,"type":"string","x-view-type":"expression"}},"required":["name","value"],"title":"Field","type":"object"},"maxItems":20,"minItems":1,"type":"array"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"dataset","default":"dataset","description":"For each message generate a JSON object and return an array of generated points.\n\nUse to collect a set of specific data points for each interval, e.g. to plot them on a diagram.\n\nWhen there is a need to copy message parameters into the interval without any conversion or renaming it is suggested to use 'message' counter with method='each' instead.\nAlso take a look at counter of type='parameter' which can be also suitable instead of dataset.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","name","fields"],"title":"Dataset","type":"object","x-view-order":["type","name","fields","allow_unknown","validate_message"],"x-view-shrink-field":"name"},"container.interval.counter.datetime":{"description":"Print the user-formatted begin or end time according to specified timezone into the interval.\n\nUse to add interval begin/end time as string in user's timezone.\n","properties":{"format":{"default":"%c","description":"Timestamp format, POSIX way, check strftime function for the format definition","maxLength":256,"minLength":2,"type":"string"},"interval":{"default":"begin","description":"Timestamp source","enum":["begin","end"],"type":"string","x-view-enum-labels":["Interval begin","Interval end"]},"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"datetime","default":"datetime","description":"Print the user-formatted begin or end time according to specified timezone into the interval.\n\nUse to add interval begin/end time as string in user's timezone.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","name"],"title":"Datetime","type":"object","x-view-order":["type","name","interval","format","validate_message"],"x-view-shrink-field":"name"},"container.interval.counter.expression":{"description":"Calculate a value based on device message parameter values.\nEvaluates an expression using device message parameters and add its first, last, average, minimum or maximum calculated value to the interval.\n\nThis is the most popular type of interval counter that is used to calculate almost everything which can be extracted from device messages within the selected interval.\nUse to compute various metrics within interval like mileage, engine hours, duration of some event and so on.\nAlso used to determine first/last value of specific message parameters within interval.\n","properties":{"expression":{"description":"[Expression](https://flespi.com/kb/expressions) for calculating counter value for the message referencing values of its parameters, e.g.: (param1+param2)/(param3-param4)\n","format":"expression-complex","maxLength":1024,"minLength":1,"type":"string","x-view-type":"expression"},"method":{"default":"first","description":"Method for combining each message's value on interval together:\n - first - will be used first calculated value\n - last - will be used last calculated value\n - minimum - will be used the minimum calculated value\n - maximum - will be used the maximum calculated value\n - summary - will be used summation of all calculated values\n - average - average value among calculated\n - difference - the difference between each next and current calculated values, in the counter summary of such differences will be stored\n - duration - summary of duration from the current message till the next, for each case when boolean expression evaluates to non-zero\n","enum":["first","last","average","minimum","maximum","summary","difference","duration"],"type":"string"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"expression","default":"expression","description":"Calculate a value based on device message parameter values.\nEvaluates an expression using device message parameters and add its first, last, average, minimum or maximum calculated value to the interval.\n\nThis is the most popular type of interval counter that is used to calculate almost everything which can be extracted from device messages within the selected interval.\nUse to compute various metrics within interval like mileage, engine hours, duration of some event and so on.\nAlso used to determine first/last value of specific message parameters within interval.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","name","expression"],"title":"Expression","type":"object","x-view-order":["type","name","expression","method","validate_message"],"x-view-shrink-field":"name"},"container.interval.counter.geofence":{"description":"Store the name of the geofence that was triggered in the interval selector of type 'geofence'.\n\nUse only with interval selector of type 'geofence'. In all other cases it will report null.\n","properties":{"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"geofence","default":"geofence","description":"Store the name of the geofence that was triggered in the interval selector of type 'geofence'.\n\nUse only with interval selector of type 'geofence'. In all other cases it will report null.\n","readOnly":true,"type":"string"}},"required":["type","name"],"title":"Geofence","type":"object","x-view-order":["type","name"],"x-view-shrink-field":"name"},"container.interval.counter.interval":{"description":"Calculate result of expression that references already calculated interval parameters (that are defined as counter before this counter).\n\nUse to compute average/max/min values for the interval or perform any other combination of interval counter values into a new one.\n\nIn expression you access interval parameters by using the names of previously defined counters.\nThe availability of parameters in the interval message depends on the order of defined counters as it may reference only previously defined counter names.\n","properties":{"expression":{"description":"[Expression](https://flespi.com/kb/expressions) for calculating counter value for the interval referencing values of its counters, e.g.: (counter1+counter2)/duration\n","format":"expression-complex","maxLength":1024,"minLength":1,"type":"string","x-view-type":"expression"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"interval","default":"interval","description":"Calculate result of expression that references already calculated current interval parameters (that are defined as counters and located before this one in the counters array) or counter values from previously calculated interval (accessible with previous(\"counter_name\") function).\n\nUse to compute average/max/min values for the interval or perform any other combination of interval counter values into a new one.\n\nIn expression you access interval parameters by using the names of previously defined counters.\nThe availability of parameters in the interval message depends on the order of defined counters as it may reference only previously defined counter names.\n","readOnly":true,"type":"string"}},"required":["type","name","expression"],"title":"Interval","type":"object","x-view-order":["type","name","expression"],"x-view-shrink-field":"name"},"container.interval.counter.message":{"description":"Copy part or full message JSON into the interval according to specified method (first, last, each, aggregate, aggregate_by_field).\n\nUse to include raw, filtered or aggregated message data into the interval.\n\nAlso is used to copy into interval the values of first or last message parameters in simplfied form.\n\nAlso is used to find an extremum on the interval, for a example add to the interval a message when the speed was maximum.\n\nAlso is used to calculate aggregated value from messages by some field, for example to enumerate all encountered BLE beacons and add their last position.\n","properties":{"extremum":{"description":"Select message(s) according to selected extremum calculated from the specified expression","properties":{"expression":{"description":"[Expression](https://flespi.com/kb/expressions) for calculating extremum value for the message referencing values of its parameters, e.g.: (param1+param2)/(param3-param4)\n","format":"expression-complex","maxLength":1024,"minLength":1,"type":"string","x-view-type":"expression"},"type":{"default":"minimum","description":"Type of the extremum of calculated expression to select correct message(s)","enum":["minimum","maximum"],"type":"string"}},"required":["type","expression"],"type":"object","x-view-order":["type","expression"]},"fields":{"description":"Fields to copy from the message into JSON object under counter. If not specified all message fields will be copied.\n","items":{"anyOf":[{"description":"Use message parameter name as is","maxLength":256,"minLength":1,"pattern":"^[\\w:!%$.-]([\\w:!%$. -]*[\\w:!%$.-])?$","title":"Message field","type":"string"},{"description":"Compute new field using expression over message parameters and selected aggregate method\n\nIf expression is not specified the value of message parameter will be taken directly.\n","properties":{"aggregate":{"default":"first","description":"Aggregation method, valid only when counter method set to 'aggregate' or 'aggregate_by_field':\n - first - will be used the first calculated value\n - last - will be used the last calculated value\n - summary - will be used summation of all calculated values\n - minimum - will be used minimum calculated value (for numbers only)\n - maximum - will be used maximum calculated value (for numbers only)\n\n If 'aggregate_by_field' method is used aggregation method is not applicable to the first field, which is automatically used for grouping messages\n","enum":["first","last","summary","minimum","maximum"],"type":"string"},"expression":{"description":"[Expression](https://flespi.com/kb/expressions) for calculating field value for counter JSON output.\n\nIf the expression value can not be calculated for the field it will generate null.\n\nIf expression is not specified for the field the value from message parameter with the same name as field will be taken directly.\n","format":"expression-complex","maxLength":256,"minLength":1,"type":"string","x-view-type":"expression"},"name":{"description":"field name, will be used as key in the counter JSON output","maxLength":64,"minLength":1,"pattern":"^[\\w:!%$.-]([\\w:!%$. -]*[\\w:!%$.-])?$","type":"string"}},"required":["name"],"title":"Computed field","type":"object","x-view-order":["name","expression","aggregate"],"x-view-shrink-field":"name"}]},"maxItems":20,"minItems":1,"type":"array"},"method":{"default":"first","description":"Method for selecting message which will be copied into parameter's value:\n - first - will be used the first suitable message\n - last - will be used the last suitable message\n - each - all suitable messages values will be presented as array\n - aggregate - aggregate messages into single, for this method you should specify fields\n - aggregate_by_field - group messages based on the first field, and aggregate them into single value, the first field value will be used for grouping\n","enum":["first","last","each","aggregate","aggregate_by_field"],"type":"string"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"message","default":"message","description":"Copy part or full message JSON into the interval according to specified method (first, last, each, aggregate, aggregate_by_field).\n\nUse to include raw, filtered or aggregated message data into the interval.\n\nAlso is used to copy into interval the values of first or last message parameters in simplfied form.\n\nAlso is used to find an extremum on the interval, for a example add to the interval a message when the speed was maximum.\n\nAlso is used to calculate aggregated value from messages by some field, for example to enumerate all encountered BLE beacons and add their last position.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","name"],"title":"Message","type":"object","x-view-order":["type","name","method","extremum","fields","validate_message"],"x-view-shrink-field":"name"},"container.interval.counter.name":{"description":"counter name, will be used as key in generated interval JSON","maxLength":64,"minLength":1,"pattern":"^[\\w_\\.\\-]+$","type":"string"},"container.interval.counter.parameter":{"description":"Add parameter value(-es) from the message into the interval (e.g. first, last, each or each distinct encountered).\n\nUse to include specific message parameters into the interval JSON.\n\nThis counter usually is used for simple cases like copy device.id or ident to the interval JSON.\nIt is also suitable for more complex cases when you need to enumerate all distinct parameter values encountered in messages - for example enumerate visited geofences detected by plugin, failed DTC codes or list all encountered BLE beacons.\n\n\nFor more complex cases, when you need to add multiple message parameters or somehow convert their value using expression take a look at 'expression' and 'message' interval counters instead.\n","properties":{"method":{"default":"first","description":"Method for generating counter value:\n - first - will be used parameter value from the first suitable message\n - last - will be used parameter value from the last suitable message\n - each - parameter value form all suitable messages will be presented as an array\n - distinct - distinct parameter values gathered from all suitable messages will be presented as array. If parameter value is an array by itself its unique elements will be extracted.\n","enum":["first","last","each","distinct"],"type":"string"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"parameter":{"description":"Original message parameter name which to add to the interval, if not specified counter name will be used.\n\nFor distinct method the counter will store in the interval JSON all unique values of this parameter encountered in messages.\nWhen the parameter value is JSON array all unique elements inside array will be enumerated.\nThis can be used for all cases like enumerating DTC codes from \"can.dtc\" parameter, visited geofences from \"plugin.geofence.name\" parameter and even includes all BLE beacons tracked with \"ble.beacons\" parameter.\n\nYou can not use anything except message parameter name in this field. If you want to convert parameter value using some expression or calculate a value based on multiple parameters consider using 'expression' or 'message' type of interval counter instead.\n","maxLength":128,"type":"string"},"type":{"const":"parameter","default":"parameter","description":"Add parameter value(-es) from the message into the interval (e.g. first, last, each or each distinct encountered).\n\nUse to include specific message parameters into the interval JSON.\n\nThis counter usually is used for simple cases like copy device.id or ident to the interval JSON.\nIt is also suitable for more complex cases when you need to enumerate all distinct parameter values encountered in messages - for example enumerate visited geofences detected by plugin, failed DTC codes or list all encountered BLE beacons.\n\n\nFor more complex cases, when you need to add multiple message parameters or somehow convert their value using expression take a look at 'expression' and 'message' interval counters instead.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","name"],"title":"Parameter","type":"object","x-view-order":["type","name","parameter","method","validate_message"],"x-view-shrink-field":"name"},"container.interval.counter.route":{"description":"Dump position.latitude and position.longitude parameters for each message within the interval into [Google-encoded polyline algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) format.\n\nUse to generate a compressed representation of the trip’s route.\n","properties":{"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"route","default":"route","description":"Dump position.latitude and position.longitude parameters for each message within the interval into [Google-encoded polyline algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) format.\n\nUse to generate a compressed representation of the trip’s route.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","name"],"title":"Route","type":"object","x-view-order":["type","name","validate_message"],"x-view-shrink-field":"name"},"container.interval.counter.specified":{"description":"Save info into the interval field under specified name and value.\n\nUse to tag calculators for easier filtering later on.\n","properties":{"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"specified","default":"specified","description":"Save info into the interval field under specified name and value.\n\nUse to tag calculators for easier filtering later on.\n","readOnly":true,"type":"string"},"value":{"anyOf":[{"maxLength":256,"minLength":1,"title":"string","type":"string"},{"title":"number","type":"number"},{"title":"boolean","type":"boolean"}]}},"required":["type","name","value"],"title":"Specified","type":"object","x-view-order":["type","name","value"],"x-view-shrink-field":"name"},"container.interval.counter.variable":{"description":"Calculate value according to expression and make it available for use in other counters’ expressions.\n\nUse to store and maintain state during counters calculation.\n\nAccess to claculated value by this counter is available in other counters through the use of variable(\"counter-name\") function.\nNo actual value will be stored in the interval JSON.\n","properties":{"expression":{"description":"[Expression](https://flespi.com/kb/expressions) for calculating variable value for the message referencing values of its parameters, e.g.: (param1+param2)/(param3-param4)\n","format":"expression-complex","maxLength":1024,"minLength":1,"type":"string","x-view-type":"expression"},"name":{"$ref":"#/definitions/container.interval.counter.name"},"type":{"const":"variable","default":"variable","description":"Calculate value according to expression and make it available for use in other counters’ expressions.\n\nUse to store and maintain state during counters calculation.\n\nAccess to claculated value by this counter is available in other counters through the use of variable(\"counter-name\") function.\nNo actual value will be stored in the interval JSON.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","name","expression"],"title":"Variable (virtual)","type":"object","x-view-order":["type","name","expression","method","validate_message"],"x-view-shrink-field":"name"},"container.interval.counters":{"description":"[Intervals counters](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters), define how to calculate messsages inside each interval.\n","items":{"$ref":"#/definitions/container.interval.counter"},"maxItems":50,"type":"array"},"container.interval.duration":{"description":"interval duration in seconds","type":"number"},"container.interval.end":{"description":"interval end time","minimum":1,"type":"number","x-view-type":"datetime"},"container.interval.geofence.coordinate":{"properties":{"lat":{"description":"Latitude in degrees, between -90 and +90 inclusive","maximum":90,"minimum":-90,"type":"number"},"lon":{"description":"Longitude in degrees, between -180 and +180 inclusive","maximum":180,"minimum":-180,"type":"number"}},"required":["lat","lon"],"title":"Coordinate","type":"object"},"container.interval.geofence.name":{"description":"geofence name, can be optionally ava in 'geofence' counter","maxLength":128,"type":"string"},"container.interval.selector":{"anyOf":[{"$ref":"#/definitions/container.interval.selector.expression"},{"$ref":"#/definitions/container.interval.selector.datetime"},{"$ref":"#/definitions/container.interval.selector.geofence"},{"$ref":"#/definitions/container.interval.selector.inactive"}],"x-key-property":"type"},"container.interval.selector.calculator":{"description":"Intervals are detected based on another calculator intervals.\nThis type of selector can be used only in calculators and not available in on-demand intervals calculation via REST API.\n","properties":{"calc_id":{"description":"Calculator ID which intervals will be used as a reference for this selector","minimum":1,"type":"integer","x-flespi-acl":"gw/calcs","x-view-selector":"calcs"},"invert":{"$ref":"#/definitions/container.interval.selector.invert"},"max_active":{"$ref":"#/definitions/container.interval.selector.max_active"},"max_inactive":{"$ref":"#/definitions/container.interval.selector.max_inactive"},"max_messages_time_diff":{"$ref":"#/definitions/container.interval.selector.max_messages_time_diff"},"min_active":{"$ref":"#/definitions/container.interval.selector.min_active"},"min_duration":{"$ref":"#/definitions/container.interval.selector.min_duration"},"type":{"const":"calc","default":"calc","description":"Intervals are detected based on another calculator intervals.\nThis type of selector can be used only in calculators and not available in on-demand intervals calculation via REST API.\n","readOnly":true,"type":"string"},"validate_interval":{"description":"Optional [expression](https://flespi.com/kb/expressions) to validate intervals that will be used for referencing this selector.","format":"expression-telematics","maxLength":1024,"type":"string"}},"required":["type","calc_id"],"title":"Calculator","type":"object","x-view-order":["type","calc_id","min_active","min_duration","max_inactive","max_messages_time_diff","max_active","invert","validate_interval"],"x-view-shrink-field":"name"},"container.interval.selector.datetime":{"description":"Interval selection with time & date change according to selected or default timezone. Can be used to split messages on intervals per each day or month.","properties":{"max_messages_time_diff":{"$ref":"#/definitions/container.interval.selector.max_messages_time_diff"},"merge_message_after":{"$ref":"#/definitions/container.interval.selector.merge_message_after"},"merge_message_before":{"$ref":"#/definitions/container.interval.selector.merge_message_before"},"name":{"$ref":"#/definitions/container.interval.selector.name"},"split":{"default":"day","description":"Defines criteria, upon which interval will be automatically splitted","enum":["hour","day","week_monday","week_sunday","month","year"],"type":"string","x-view-enum-labels":["Hour","Day","Week (from Monday)","Week (from Sunday)","Month","Year"]},"type":{"const":"datetime","default":"datetime","description":"Interval selection with time & date change according to selected or default timezone. Can be used to split messages on intervals per each day or month.","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type"],"title":"Date or Time","type":"object","x-view-order":["type","split","name","max_messages_time_diff","merge_message_before","merge_message_after","validate_message"],"x-view-shrink-field":"name"},"container.interval.selector.expression":{"description":"Interval selection via non-zero expression that references message properties","properties":{"expression":{"description":"[Expression](https://flespi.com/kb/expressions) that defines is given message belong to the interval or not.\nIn expression you may reference values of message parameters, e.g.: (param1+param2)>=1 | (param3-param4)!=0\n","format":"expression-complex","maxLength":1024,"minLength":1,"type":"string","x-view-type":"expression"},"invert":{"$ref":"#/definitions/container.interval.selector.invert"},"max_active":{"$ref":"#/definitions/container.interval.selector.max_active"},"max_inactive":{"$ref":"#/definitions/container.interval.selector.max_inactive"},"max_messages_time_diff":{"$ref":"#/definitions/container.interval.selector.max_messages_time_diff"},"merge_message_after":{"$ref":"#/definitions/container.interval.selector.merge_message_after"},"merge_message_before":{"$ref":"#/definitions/container.interval.selector.merge_message_before"},"merge_unknown":{"$ref":"#/definitions/container.interval.selector.merge_unknown"},"method":{"default":"boolean","description":"Defines the way how expression result will be evaluated for the interval.\n- boolean method expects non-zero value to activate/continue interval and zero to stop it\n- change method will setup new interval each time expression result is different from previous\n","enum":["boolean","change"],"type":"string"},"min_active":{"$ref":"#/definitions/container.interval.selector.min_active"},"min_duration":{"$ref":"#/definitions/container.interval.selector.min_duration"},"name":{"$ref":"#/definitions/container.interval.selector.name"},"type":{"const":"expression","default":"expression","description":"Interval selection via non-zero expression that references message properties","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type","expression"],"title":"Expression","type":"object","x-view-order":["type","expression","method","name","min_active","min_duration","max_inactive","max_messages_time_diff","max_active","merge_message_before","merge_message_after","merge_unknown","invert","validate_message"],"x-view-shrink-field":"name"},"container.interval.selector.geofence":{"description":"Create intervals based on the geofence inside/outside status.\n\nBy default it will return ON status for the message when it is inside of assigned or configured geofences. When geofence is changed it will return ON_NEW status.\n\nTo create intervals when device is outside of assigned or configured geofences use invert=true option which will return ON status for each message outside of assigned or configured geofences.\n\nFor more precise control of geofences status you may use interval selector of type expression and within expression test for geofence availability: \"geofence() != null\" or simple expression=\"geofence()\" (returns the name of assigned geofence of null) and method=\"change\".\n\nWhich geofences to use is determined by 'geofences' option.\nIf you leave it unspecified in the selector configuration, all geofences assigned to calculator will be used automatically.\nIf you will explicitly specify geofences in selector configuration only these geofences will be controlled.\n","properties":{"geofences":{"description":"Explicit configuration of geofences for entrance/exit detection.\n\nWhen geofences configuration provided explicitly with this parameter the selector will use only their configuration ignoring any geofence entity that is linked to the device or calculator.\n\nTo avoid any misinterpretation and unlock extra functionality we recommend to avoid explicit geofences configuration (leave 'geofences' unconfigured in the interval selector) and only use geofences that are linked to the device or calculator.\n","items":{"anyOf":[{"$ref":"#/definitions/geoset.circle"},{"$ref":"#/definitions/geoset.polygon"},{"$ref":"#/definitions/geoset.corridor"}],"x-key-property":"type"},"maxItems":64,"minItems":1,"type":"array"},"invert":{"$ref":"#/definitions/container.interval.selector.invert"},"max_active":{"$ref":"#/definitions/container.interval.selector.max_active"},"max_inactive":{"$ref":"#/definitions/container.interval.selector.max_inactive"},"max_messages_time_diff":{"$ref":"#/definitions/container.interval.selector.max_messages_time_diff"},"merge_message_after":{"$ref":"#/definitions/container.interval.selector.merge_message_after"},"merge_message_before":{"$ref":"#/definitions/container.interval.selector.merge_message_before"},"merge_unknown":{"$ref":"#/definitions/container.interval.selector.merge_unknown"},"min_active":{"$ref":"#/definitions/container.interval.selector.min_active"},"min_duration":{"$ref":"#/definitions/container.interval.selector.min_duration"},"name":{"$ref":"#/definitions/container.interval.selector.name"},"type":{"const":"geofence","default":"geofence","description":"Create intervals based on the geofence inside/outside status.\n\nBy default it will return ON status for the message when it is inside of assigned or configured geofences. When geofence is changed it will return ON_NEW status.\n\nTo create intervals when device is outside of assigned or configured geofences use invert=true option which will return ON status for each message outside of assigned or configured geofences.\n\nFor more precise control of geofences status you may use interval selector of type expression and within expression test for geofence availability: \"geofence() != null\" or simple expression=\"geofence()\" (returns the name of assigned geofence of null) and method=\"change\".\n\nWhich geofences to use is determined by 'geofences' option.\nIf you leave it unspecified in the selector configuration, all geofences assigned to calculator will be used automatically.\nIf you will explicitly specify geofences in selector configuration only these geofences will be controlled.\n","readOnly":true,"type":"string"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["type"],"title":"Geofences","type":"object","x-view-order":["type","geofences","name","min_active","min_duration","max_inactive","max_messages_time_diff","max_active","merge_message_before","merge_message_after","merge_unknown","invert","validate_message"],"x-view-shrink-field":"name"},"container.interval.selector.inactive":{"description":"Interval selection based on the inactivity of telemetry data reception.\nWith this selector it is both possible to detect delays of telemetry data from device in realtime and analyze historical intervals when such delays occurred.\n","properties":{"delay_threshold":{"description":"Minimum latency in telemetry data retrieval to start interval, in seconds.\nTelemetry latency for each message can be calculated as (server.timestamp - timestamp).\nInterval will automatically start the from latest message below specified threshold and finish on the last message below threshold.\n","format":"uint32","maximum":315360000,"minimum":60,"type":"number"},"name":{"$ref":"#/definitions/container.interval.selector.name"},"type":{"const":"inactive","default":"inactive","description":"Interval selection based on the inactivity of telemetry data reception.\nWith this selector it is both possible to detect delays of telemetry data from device in realtime and analyze historical intervals when such delays occurred.\n","readOnly":true,"type":"string"}},"required":["type","delay_threshold"],"title":"Inactive","type":"object","x-view-order":["type","name","delay_threshold"],"x-view-shrink-field":"name"},"container.interval.selector.invert":{"description":"when true, evaluation of interval state for the message should be inverted, e.g. ON will become OFF. For example if you have a geofence selector and want to detect when a device leaves this geofence (in contrast to detecting when a device gets into the geofence), you want to enable the \"invert\" property.","type":"boolean"},"container.interval.selector.max_active":{"description":"if non-zero (in seconds), during sequential interval detection when the duration of a currently detected interval exceeds the specified value in seconds, the new interval will be started.","format":"uint32","maximum":864000,"type":"integer"},"container.interval.selector.max_inactive":{"description":"if non-zero (in seconds), inactive parts of intervals with duration shorter than the specified number of seconds will count towards the current interval and will be merged with the preceding and following active parts. Also, this property can timeout an active interval for the assigned device.","format":"uint32","maximum":864000,"type":"integer"},"container.interval.selector.max_messages_time_diff":{"description":"if non-zero, specifies a maximum timestamps difference between the two consecutive messages to include into the same interval, in seconds","format":"uint32","maximum":864000,"type":"integer"},"container.interval.selector.merge_message_after":{"description":"when true, the interval will be automatically extended by one message after with OFF/UNKNOWN state.","type":"boolean"},"container.interval.selector.merge_message_before":{"description":"when true, the interval will be automatically extended by one message earlier with OFF/UNKNOWN state.","type":"boolean"},"container.interval.selector.merge_unknown":{"description":"when true, if we have an active interval and the current message state is unknown, it will be appended to the active interval. The unknown state can appear in an expression type selector when a message does not contain a parameter specified in the expression or in a geofence type selector when there are no coordinates in the message.","type":"boolean"},"container.interval.selector.min_active":{"description":"if non-zero (in seconds), all intervals with duration in seconds less than specified will be skipped.","format":"uint32","maximum":86400,"type":"integer"},"container.interval.selector.min_duration":{"description":"minimum final(merged) duration for the generated interval, in seconds","format":"uint32","maximum":86400,"type":"integer"},"container.interval.selector.name":{"description":"custom description for interval selector","maxLength":256,"type":"string"},"container.interval.selectors":{"description":"[Intervals selectors](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors), specify the way to extract intervals from messages.\n","items":{"$ref":"#/definitions/container.interval.selector"},"maxItems":3,"minItems":1,"type":"array"},"container.interval.timezone":{"default":"UTC","description":"Default timezone used in all date/time related operations in selectors and counters, optional","enum":["UTC","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"],"type":"string"},"container.interval.validate_interval":{"description":"[Expression](https://flespi.com/kb/expressions) for validating generated interval referencing values of its counters, e.g.: (counter1-counter2) > counter3.\nprevious(\"counter_name\") function, if used in expression will return the value of counter_name counter from previously calculated and stored interval.\n**Note: Do not use this field to filter intervals by duration (e.g., 'duration > X'). Instead, use the `min_active` and `min_duration` parameters in interval selectors.**\n","format":"expression-complex","maxLength":1024,"type":"string","x-view-type":"expression"},"container.interval.validate_message":{"description":"[Expression](https://flespi.com/kb/expressions) validating messages for selector/counter/calculator, e.g. value of 'position.valid == 1' will skip all messages where position.valid property is not defined or not 1(true)\n","format":"expression-complex","maxLength":1024,"type":"string","x-view-type":"expression"},"container.intervals.calculate":{"description":"intervals calculation configuration","properties":{"counters":{"$ref":"#/definitions/container.interval.counters"},"extend":{"$ref":"#/definitions/container.intervals.calculate.extend"},"from":{"$ref":"#/definitions/container.intervals.calculate.from"},"selectors":{"$ref":"#/definitions/container.interval.selectors"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"to":{"$ref":"#/definitions/container.intervals.calculate.to"},"validate_interval":{"$ref":"#/definitions/container.interval.validate_interval"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["selectors"],"title":"intervals configuration from REST parameters","type":"object","x-view-order":["from","to","extend","selectors","counters","timezone","validate_message","validate_interval"]},"container.intervals.calculate.extend":{"description":"if true, then interval will be extended up to one next message after 'to' and include it in its calculations, usually used together with merge_messages_after=true for interval selectors","type":"boolean"},"container.intervals.calculate.from":{"description":"UNIX timestamp of left time border for messages. Use 0 to ignore left bound.","minimum":0,"type":"number","x-view-type":"datetime"},"container.intervals.calculate.to":{"description":"UNIX timestamp of right time border for messages. Use 0 to ignore right bound.","minimum":0,"type":"number","x-view-type":"datetime"},"error":{"properties":{"code":{"description":"Error code.","type":"integer"},"id":{"$ref":"#/definitions/item.id"},"reason":{"description":"Error description.","type":"string"}},"type":"object"},"errors":{"description":"Errors occurred while processing the request.","items":{"$ref":"#/definitions/error"},"type":"array"},"errors.result":{"description":"Canonical flespi response envelope used for non-2xx responses (and also when a 200 response carries per-item errors). 'result' is empty when 'errors' is populated.","properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Always empty on error-only responses.","items":{},"type":"array"}},"type":"object"},"geoset.circle":{"description":"Circular region","properties":{"center":{"$ref":"#/definitions/container.interval.geofence.coordinate"},"name":{"$ref":"#/definitions/container.interval.geofence.name"},"radius":{"description":"Radius in kilometers","maximum":1000,"minimum":0.001,"type":"number"},"type":{"const":"circle","default":"circle","description":"Circle","readOnly":true,"type":"string"}},"required":["type","center","radius"],"title":"Circle","type":"object","x-view-order":["type","name","center","radius"],"x-view-shrink-field":"name","x-view-type":"geofence"},"geoset.corridor":{"description":"Corridor of certain width that consists from multiple sequentially connected points","properties":{"name":{"$ref":"#/definitions/container.interval.geofence.name"},"path":{"description":"Series of coordinates","items":{"$ref":"#/definitions/container.interval.geofence.coordinate"},"maxItems":1000,"minItems":2,"type":"array"},"type":{"const":"corridor","default":"corridor","description":"Corridor of certain width","readOnly":true,"type":"string"},"width":{"description":"Corridor width, maximum allowed distance till centerline between two neighbor points, in kilometers","maximum":1000,"minimum":0.001,"type":"number"}},"required":["type","path","width"],"title":"Corridor","type":"object","x-view-order":["type","name","width","path"],"x-view-shrink-field":"name","x-view-type":"geofence"},"geoset.polygon":{"description":"Area enclosed by a closed path","properties":{"name":{"$ref":"#/definitions/container.interval.geofence.name"},"path":{"description":"Series of coordinates","items":{"$ref":"#/definitions/container.interval.geofence.coordinate"},"maxItems":1024,"minItems":3,"type":"array"},"type":{"const":"polygon","default":"polygon","description":"Closed path","readOnly":true,"type":"string"}},"required":["type","path"],"title":"Polygon","type":"object","x-view-order":["type","name","path"],"x-view-shrink-field":"name","x-view-type":"geofence"},"id.result":{"properties":{"result":{"description":"Element's ID list.","items":{"$ref":"#/definitions/item.id"},"type":"array"}},"type":"object"},"item.blocked":{"description":"Active block code for item","type":"integer"},"item.btime":{"description":"Item birth timestamp","type":"double"},"item.cid":{"description":"owner ID","format":"uint32","type":"integer"},"item.enabled":{"description":"Enable or disable item","type":"boolean"},"item.enabled-default":{"default":true,"description":"Enable or disable item","type":"boolean"},"item.id":{"description":"unique item ID","format":"uint32","minimum":1,"type":"integer"},"item.mtime":{"description":"Item last modification timestamp","type":"double"},"item.name":{"description":"Item name","maxLength":1024,"minLength":1,"type":"string"},"item.packets":{"description":"packet data","properties":{"conn":{"description":"Connection ID","minimum":0,"type":"integer"},"data":{"description":"base64 representation of binary data for the packet","maxLength":4194240,"minLength":1,"type":"string"},"timestamp":{"description":"UNIX timestamp of the event","minimum":1,"type":"number","x-view-type":"datetime"},"type":{"description":"3 least significant bits - traffic event type (enum):\n  * 0 - connection is opened\n  * 1 - connection is closed\n  * 2 - incoming data\n  * 3 - outgoing data\n  * 4 - peer identified\nbits 3...7 - traffic transport type bitmask:\n  * 0x00 - tcp\n  * 0x10 - channel\n  * 0x20 - mqtt\n  * 0x40 - http\n  * 0x80 - udp\n","minimum":0,"type":"number"}},"type":"object"},"item.packets.get":{"description":"parameter to filter packets selection","properties":{"count":{"default":10000000,"description":"The number of packets to be returned\n","format":"uint32","maximum":10000000,"minimum":1,"type":"integer"},"filter":{"description":"optional filter string to return only packets conforming to specific filtering rules","maxLength":1024,"type":"string"},"from":{"description":"UNIX timestamp of left time border for packets. Use 0 to ignore left bound.\n","minimum":0,"type":"number","x-view-type":"datetime"},"reverse":{"default":false,"description":"time sorting parameter (true/false), use false to list packets from end to beginning","type":"boolean"},"to":{"description":"UNIX timestamp of right time border for packets. Use 0 to ignore right bound.","minimum":0,"type":"number","x-view-type":"datetime"}},"type":"object"},"item.priority":{"description":"Item priority. The high priority item is processed first.","maximum":100,"minimum":0,"type":"integer"},"item.priority-default":{"default":0,"description":"Item priority. The high priority item is processed first.","maximum":100,"minimum":0,"type":"integer"},"logmessage":{"additionalProperties":true,"description":"Log record. It contains fixed fields described below and additional fields based on log record type.","properties":{"event_code":{"description":"Log record code.","type":"integer"},"event_origin":{"description":"Log record origin name.","type":"string"},"event_text":{"description":"Log record text.","type":"string"},"timestamp":{"description":"Log record UNIX timestamp.","type":"number","x-view-type":"datetime"}},"type":"object"},"logs.get":{"description":"filter returned log records","properties":{"count":{"default":10000000,"description":"limit number of logs to be returned","format":"uint32","maximum":10000000,"minimum":1,"type":"integer"},"fields":{"description":"CSV-formatted list of parameters to be returned in response message list. If message does not contain any of the specified fields, it will be skipped.\n","maxLength":4096,"type":"string"},"filter":{"description":"Optional filter string to return only logs conforming to specific filtering rules. You can use flespi [expressions](https://flespi.com/kb/expressions) and reference log fields inside them.","maxLength":1024,"type":"string"},"from":{"description":"start momemnt's UNIX timestamp to limit log sample from beginning. use 0 to ignore left bound","minimum":0,"type":"number","x-view-type":"datetime"},"reverse":{"default":false,"description":"time sorting parameter (true/false), use false to list logs from end to beginning","type":"boolean"},"to":{"description":"end moment's UNIX timestamp to limit log sample to end. use 0 to ignore right bound","minimum":0,"type":"number","x-view-type":"datetime"}},"type":"object"},"message":{"description":"MQTT message information","properties":{"cid":{"$ref":"#/definitions/item.cid"},"content_type":{"description":"Content type","maxLength":128,"minLength":1,"type":"string"},"correlation_data":{"description":"Base64 encoded data","maxLength":1024,"minLength":1,"type":"string"},"expiry_interval":{"description":"Message expiry interval, seconds","format":"uint32","type":"integer"},"payload":{"description":"Message payload either base64 text for binary data (type=1) or text data as is (type=2)","maxLength":20000000,"minLength":1,"type":"string"},"payload_format_indicator":{"description":"Payload format indicator","enum":[0,1],"format":"uint32","type":"number"},"response_topic":{"description":"Message response topic","maxLength":8700,"minLength":1,"type":"string"},"timestamp":{"$ref":"#/definitions/message.timestamp"},"token_id":{"description":"ID of the token used for MQTT authorization when the message was published.","format":"uint32","type":"integer"},"topic":{"description":"Message topic","maxLength":8700,"minLength":1,"type":"string"},"type":{"default":2,"description":"Payload format. It little bit differs from payload format indicator described in MQTT v5.0 standard. base64 - 1, text - 2","maximum":2,"minimum":1,"type":"integer"},"user_properties":{"description":"User properties array","items":{"description":"User property name/value pair","properties":{"name":{"maxLength":8700,"minLength":1,"type":"string"},"value":{"maxLength":8700,"type":"string"}},"required":["name","value"],"type":"object"},"maxItems":32,"type":"array"}},"title":"Message","type":"object"},"message.fields.shared":{"properties":{"content_type":{"description":"Content type","maxLength":128,"minLength":1,"type":"string"},"correlation_data":{"description":"Base64 encoded data","maxLength":1024,"minLength":1,"type":"string"},"expiry_interval":{"description":"Message expiry interval, seconds","format":"uint32","type":"integer"},"payload":{"description":"Message payload either base64 text for binary data (type=1) or text data as is (type=2)","maxLength":20000000,"minLength":1,"type":"string"},"payload_format_indicator":{"description":"Payload format indicator","enum":[0,1],"format":"uint32","type":"number"},"response_topic":{"description":"Message response topic","maxLength":8700,"minLength":1,"type":"string"},"timestamp":{"$ref":"#/definitions/message.timestamp"},"topic":{"description":"Message topic","maxLength":8700,"minLength":1,"type":"string"},"type":{"default":2,"description":"Payload format. It little bit differs from payload format indicator described in MQTT v5.0 standard. base64 - 1, text - 2","maximum":2,"minimum":1,"type":"integer"},"user_properties":{"description":"User properties array","items":{"description":"User property name/value pair","properties":{"name":{"maxLength":8700,"minLength":1,"type":"string"},"value":{"maxLength":8700,"type":"string"}},"required":["name","value"],"type":"object"},"maxItems":32,"type":"array"}},"type":"object"},"message.post":{"properties":{"content_type":{"description":"Content type","maxLength":128,"minLength":1,"type":"string"},"correlation_data":{"description":"Base64 encoded data","maxLength":1024,"minLength":1,"type":"string"},"expiry_interval":{"description":"Message expiry interval, seconds","format":"uint32","type":"integer"},"payload":{"description":"Message payload either base64 text for binary data (type=1) or text data as is (type=2)","maxLength":20000000,"minLength":1,"type":"string"},"payload_format_indicator":{"description":"Payload format indicator","enum":[0,1],"format":"uint32","type":"number"},"response_topic":{"description":"Message response topic","maxLength":8700,"minLength":1,"type":"string"},"retained":{"description":"retained flag for published message","type":"boolean"},"timestamp":{"$ref":"#/definitions/message.timestamp"},"topic":{"description":"Message topic","maxLength":8700,"minLength":1,"type":"string"},"type":{"default":2,"description":"Payload format. It little bit differs from payload format indicator described in MQTT v5.0 standard. base64 - 1, text - 2","maximum":2,"minimum":1,"type":"integer"},"user_properties":{"description":"User properties array","items":{"description":"User property name/value pair","properties":{"name":{"maxLength":8700,"minLength":1,"type":"string"},"value":{"maxLength":8700,"type":"string"}},"required":["name","value"],"type":"object"},"maxItems":32,"type":"array"}},"required":["topic"],"title":"Message","type":"object"},"message.timestamp":{"description":"UNIX timestamp of message modification time","minimum":0,"type":"number","x-view-type":"datetime"},"messages.array":{"additionalItems":true,"items":{"$ref":"#/definitions/message"},"maxItems":1000,"minItems":1,"title":"Messages array","type":"array"},"messages.delete":{"description":"Only messages wich modification UNIX timestamp is less than or equal to passed value will be deleted. Zero value will be converted to current time.","properties":{"timestamp":{"$ref":"#/definitions/message.timestamp"}},"type":"object"},"messages.get":{"properties":{"modified_since":{"$ref":"#/definitions/message.timestamp"},"payload_filter":{"description":"Payload filter. Treat the payload as JSON, string, number, boolean, or null and check if the expression evaluates to a positive result.\nThe expression syntax is the same as any other expression/filter/selector in the system. Use the \"$\" sign to access the payload without JSON. Examples:\nPayload is 10, '$>10' is false, '$<=10' is true.\nPayload is {\"abc\":10}, 'abc>10' is false, 'abc<=10' is true.\n","maxLength":4096,"minLength":1,"type":"string","x-view-type":"expression"},"recursive":{"default":true,"description":"Fetch subaccount messages too.","type":"boolean"}},"type":"object"},"messages.post.array":{"additionalItems":true,"items":{"$ref":"#/definitions/message.post"},"maxItems":1000,"minItems":1,"title":"Messages array","type":"array"},"metadata":{"additionalProperties":true,"description":"Set of name/value pairs. Can be used for storing additional information about the item.","format":"metadata","type":"object"},"metadata.patch":{"additionalProperties":true,"description":"Set of name/value pairs. Can be used for storing additional information about the item.","format":"metadata","type":"object"},"session":{"description":"MQTT session properties","properties":{"bytes_in":{"$ref":"#/definitions/session.bytes_in"},"bytes_out":{"$ref":"#/definitions/session.bytes_out"},"bytes_out_queue":{"$ref":"#/definitions/session.bytes_out_queue"},"cid":{"$ref":"#/definitions/item.cid"},"clean":{"$ref":"#/definitions/session.clean"},"client_id":{"$ref":"#/definitions/session.client_id"},"connected":{"$ref":"#/definitions/session.connected"},"expires":{"description":"Session expiration UTC timestamp, zero while connected.","format":"uint32","type":"integer","x-view-type":"datetime"},"expiry_interval":{"$ref":"#/definitions/session.expiry_interval"},"id":{"$ref":"#/definitions/session.id"},"inflight_msgs_size":{"$ref":"#/definitions/session.inflight_msgs_size"},"ip":{"description":"IP address of the connected MQTT client.","type":"string"},"last_active":{"$ref":"#/definitions/session.last_active"},"pub_count":{"$ref":"#/definitions/session.pub_count"},"puback_queue":{"$ref":"#/definitions/session.puback_queue"},"size":{"$ref":"#/definitions/session.size"},"sub_count":{"$ref":"#/definitions/session.sub_count"},"subscriptions_count":{"$ref":"#/definitions/session.subscriptions_count"},"token_id":{"description":"ID of the token used for MQTT authorization.","format":"uint32","type":"integer"},"version":{"$ref":"#/definitions/session.version"}},"type":"object"},"session.bytes_in":{"description":"Total bytes received by the session.","type":"number"},"session.bytes_out":{"description":"Total bytes sent by the session.","type":"number"},"session.bytes_out_queue":{"description":"Size of outgoing message queue, in bytes.","type":"number"},"session.clean":{"description":"Session type, true if session is clean.","type":"boolean"},"session.client_id":{"description":"Session client_id provided by client or automatically generated.\n","type":"string"},"session.connected":{"description":"Session connection status, true if connected now.","type":"boolean"},"session.expiry_interval":{"description":"Session expiry interval, in seconds.","type":"number"},"session.id":{"description":"Session id.","format":"uint32","type":"integer"},"session.inflight_msgs_size":{"description":"Total size of in-flight messages, in bytes.","type":"number"},"session.last_active":{"description":"Timestamp of last session activity.","type":"number","x-view-type":"datetime"},"session.post":{"properties":{"client_id":{"$ref":"#/definitions/session.client_id"}},"required":["client_id"],"type":"object"},"session.pub_count":{"description":"Number of PUBLISH messages processed.","type":"number"},"session.puback_queue":{"description":"Number of messages awaiting PUBACK.","type":"number"},"session.size":{"description":"Persistent session storage size, in KB.","type":"integer"},"session.sub_count":{"description":"Number of active subscriptions.","type":"number"},"session.subscriptions_count":{"description":"Number of active subscriptions.","type":"integer"},"session.version":{"description":"MQTT protocol version of the session.","type":"number"},"sessions.result":{"properties":{"result":{"description":"Sessions collection.","items":{"$ref":"#/definitions/session"},"type":"array"}},"type":"object"},"subitem.auto_created":{"description":"Flag is set to true when the item is assigned automatically due to belonging to any group","type":"boolean"},"subitem.fields":{"additionalProperties":true,"description":"Auxiliary fields attached to subitem","type":"object"},"subitems.array":{"description":"List of items to which a subitem is added","items":{"properties":{"id":{"$ref":"#/definitions/item.id"},"name":{"$ref":"#/definitions/item.name"}},"type":"object"},"type":"array"},"subscription":{"description":"MQTT session topic subscription properties","properties":{"cid":{"description":"Customer ID used to filter subscriptions by subaccount assignment.","type":"integer"},"client_id":{"$ref":"#/definitions/session.client_id"},"id":{"$ref":"#/definitions/subscription.id"},"no_local":{"$ref":"#/definitions/subscription.no_local"},"qos":{"$ref":"#/definitions/subscription.qos"},"rap":{"$ref":"#/definitions/subscription.rap"},"recursive":{"$ref":"#/definitions/subscription.recursive"},"retain_handling":{"$ref":"#/definitions/subscription.retain_handling"},"session_id":{"$ref":"#/definitions/subscription.session_id"},"subscription_id":{"$ref":"#/definitions/subscription.subscription_id"},"topic":{"$ref":"#/definitions/subscription.topic"}},"type":"object"},"subscription.id":{"description":"Subscription id.","format":"uint32","minimum":1,"type":"integer"},"subscription.no_local":{"description":"If the value is true, Application Messages MUST NOT be forwarded to a connection with a ClientID equal to the ClientID of the publishing connection.","type":"boolean"},"subscription.post":{"properties":{"no_local":{"$ref":"#/definitions/subscription.no_local"},"qos":{"$ref":"#/definitions/subscription.qos"},"rap":{"$ref":"#/definitions/subscription.rap"},"retain_handling":{"$ref":"#/definitions/subscription.retain_handling"},"subscription_id":{"$ref":"#/definitions/subscription.subscription_id"},"topic":{"$ref":"#/definitions/subscription.topic"}},"required":["topic"],"type":"object"},"subscription.qos":{"description":"Subscription QoS level.","format":"uint32","maximum":1,"minimum":0,"type":"integer"},"subscription.rap":{"description":"Retain as published. If true, Application Messages forwarded using this subscription keep the RETAIN flag they were published with. If 0, Application Messages forwarded using this subscription have the RETAIN flag set to 0.\n","type":"boolean"},"subscription.recursive":{"description":"If true, subscription is recursive, meaning that it applies to all subaccounts of the customer.\n","type":"boolean"},"subscription.retain_handling":{"description":"0 = Send retained messages at the time of the subscribe\n1 = Send retained messages at subscribe only if the subscription does not currently exist\n2 = Do not send retained messages at the time of the subscribe\n","maximum":2,"minimum":0,"type":"integer"},"subscription.session_id":{"description":"Session id.","format":"uint32","type":"integer"},"subscription.subscription_id":{"description":"Subscription identifier is associated with any subscription created or modified as the result of this SUBSCRIBE packet.","format":"uint32","maximum":268435455,"type":"integer"},"subscription.topic":{"description":"Subscription topic.","minLength":1,"type":"string"},"subscriptions":{"properties":{"errors":{"description":"Errors list.","items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"Subscriptions collection.","items":{"$ref":"#/definitions/subscription"},"type":"array"}},"type":"object"},"timezone.enum":{"default":"UTC","description":"Timezone specification","enum":["UTC","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"],"type":"string"},"timezone.enum.base":{"default":"UTC","enum":["UTC","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"],"type":"string"}},"host":"flespi.io","info":{"description":"This API provides a set of methods to operate flespi MQTT broker using [REST API](https://flespi.com/kb/flespi-api-basics#rest-api) interface\nwith possibilities to manage sessions and subscriptions, post messages, get and delete retained messages, and fetch broker logs.\n\nTo identify each REST request FlespiToken key has to be passed in the HTTP call via a header: **Authorization: FlespiToken XXXXXXXXXX**.\nThe list of tokens available to you is provided in the [control panel](https://flespi.io).\n\nDetailed information about the flespi MQTT broker can be found at [flespi.com](https://flespi.com/mqtt-broker).\n\nAlso learn how to use flespi [MQTT API](https://flespi.com/kb/flespi-api-basics#mqtt-api) with the **flespi platform**.\n","title":"flespi MQTT Broker REST API","version":"0.9"},"parameters":{"cid-header":{"description":"Operate as given subaccount.","in":"header","name":"x-flespi-cid","type":"integer","x-view-selector":"subaccounts"},"force-header":{"description":"Set to 1 in order to force operation completion ignoring some checks","enum":[0,1],"in":"header","name":"x-flespi-force","type":"integer"},"limit":{"description":"Maximum number of items to return.\n","in":"query","name":"limit","required":false,"type":"integer"},"message-fields":{"collectionFormat":"csv","description":"All possible fields available for the MQT message. If this parameter is specified in the query path of API call each returned MQTT message will consists only from JSON object with specified fields. If this parameter is not specified each MQTT message will be returned as JSON object with default fields.","in":"query","items":{"enum":["topic","payload","response_topic","correlation_data","content_type","payload_format_indicator","user_properties","expiry_interval","timestamp","token_id","cid","type"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/message"}},"messages-selector":{"description":"Selector is compatible with MQTT topic subscription format and should be urlencoded.\n","in":"path","name":"messages-selector","required":true,"type":"string"},"offset":{"description":"Number of items to skip before starting to return results.\n","in":"query","name":"offset","required":false,"type":"integer"},"session-fields":{"collectionFormat":"csv","description":"All possible fields available for the MQTT session. If this parameter is specified in the query path of API call each returned MQTT session will consists only from JSON object with specified fields. If this parameter is not specified each grant MQTT session be returned as JSON object with default fields.","in":"query","items":{"enum":["id","client_id","connected","size","clean","ip","cid","expires","token_id","version","expiry_interval","last_active","bytes_in","bytes_out","pub_count","sub_count","bytes_out_queue","puback_queue","inflight_msgs_size","subscriptions_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/session"}},"sessions-selector":{"collectionFormat":"csv","description":"Select MQTT session for the API operation.\n\nSome samples you may use in sessions-selector:\n  - **all** - select all existing MQTT sessions available for the user(token), this is special selector format\n  - **1,2,3,4** - select session with ID 1,2,3 and 4, this is special selector format\n  - **connected=true** - select currently connected MQTT sessions\n  - **client_id=\"XXX\\*\"** - select MQTT sessions which client_id starts from XXX, by field 'client_id' with wildcards\n  - **{cid=123 || cid=456}** - select MQTT sessions from subaccounts with id 123 and 456, by using expression and 'cid' field (subaccount assignment)\n\nSample API calls:\n  - **GET /mqtt/sessions/all?fields=client_id,size,connected** - select all available MQTT sessions and return their client ID, connection state and size of pending messages buffer\n  - **GET /platform/grants/client_id=\"ABC\"?fields=connected** - select MQTT session with ID client ID \"ABC\" and return its current connection status\n","in":"path","items":{"type":"string"},"name":"sessions-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/session"}},"subscription-fields":{"collectionFormat":"csv","description":"CSV-formatted list of fields to be returned in reply collection.\n","in":"query","items":{"enum":["id","session_id","client_id","cid","topic","qos","subscription_id","no_local","rap","retain_handling","recursive"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/subscription"}},"subscriptions-selector":{"collectionFormat":"csv","description":"Select subscription for the operation.\n\nUsually to identiy the subscription you pass in selector urlencoded topic filter.\nHowever you can use more specific subscriptions selectors. For example use keyword **\"all\"** to select all subscriptions.\nOr select subscriptions filtering them by any field specifically: client_id, topic, qos, subscription_id, no_local, rap, retain_handling.\n","in":"path","items":{"type":"string"},"name":"subscriptions-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/subscription"}}},"paths":{"/changelog-posts":{"get":{"description":"Retrieve changelog posts accumulated for the flespi MQTT broker system, sorted by publication time.\n\nEach post published in a forum changelog topic of the MQTT broker system is stored by the platform and available with this method.\nThe 'name' field of the post carries the name of the specific changelog it belongs to, e.g. 'mqtt-broker', 'mqtt-tiles' or 'mqtt-board'.\nNew posts are also published in realtime into 'flespi/message/mqtt/changelog' MQTT topic.\n\nAll filtering parameters should be wrapped inside data={...} argument, for example to return only the latest post use:\n**GET /mqtt/changelog-posts?data={\"reverse\":true,\"count\":1}**\n\nCall format: **GET /mqtt/changelog-posts**\n\nBoth the MQTT topic and this method are accessible with any token of the account, including ACL tokens, no extra permissions required.\n","parameters":[{"in":"query","name":"data","schema":{"$ref":"#/definitions/changelog.get"}}],"responses":{"200":{"description":"Changelog posts array.","schema":{"$ref":"#/definitions/changelog.posts"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Fetch changelog posts of the MQTT broker system","tags":["changelog"],"x-view-group":"Changelog"}},"/logs":{"get":{"description":"Get specified MQTT Broker logs. The request without parameters will return all MQTT Broker logs.\n\nReply contains MQTT Broker logs sorted by timestamp.\n\nTo improve the performance of the call try always to specify 'from' and 'to' parameters with corresponding UNIX timestamps for which you want to retrieve MQTT logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in MQTT Broker which on large volumes may slow down your operation.\n\n'filter' parameter can be used to select only subset of logs. In filter you can utilize powerful [flespi expressions](https://flespi.com/kb/expressions).\n\nCall format: **GET /mqtt/logs**.\n","parameters":[{"description":"Parameters to filter retrieved logs","in":"query","name":"data","required":true,"schema":{"$ref":"#/definitions/logs.get"}}],"responses":{"200":{"description":"Log messages array","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Logs collection","items":{"$ref":"#/definitions/logmessage"},"type":"array"}},"type":"object"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Get MQTT broker logs records\n","tags":["logs"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}},"parameters":[{"$ref":"#/parameters/cid-header"}]},"/logs/calculate":{"get":{"description":"Calculate intervals from logs for MQTT Broker.\n\nCall format: **GET /mqtt/logs/calculate**.\n","parameters":[{"description":"Parameters for interval calculation","in":"query","name":"data","required":true,"schema":{"$ref":"#/definitions/container.intervals.calculate"}}],"responses":{"200":{"description":"Calculated intervals","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Calculated intervals collection","type":"array"}},"type":"object"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Calculate intervals from MQTT broker logs\n","tags":["logs"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}},"parameters":[{"$ref":"#/parameters/cid-header"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /mqtt/logs/calculate** instead.\n\nCalculate intervals from logs for MQTT Broker.\n\nCall format: **POST /mqtt/logs/calculate**.\n","parameters":[{"description":"Parameters for interval calculation","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/container.intervals.calculate"}}],"responses":{"200":{"description":"Calculated intervals","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Calculated intervals collection","type":"array"}},"type":"object"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Calculate intervals from MQTT broker logs\n","tags":["logs"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}}},"/messages":{"post":{"description":"Publish MQTT messages directly into MQTT bus. This call simulates normal MQTT message publication without active MQTT session.\nAll MQTT message PUB features like retain flag and and expiration period are available.\n\nMessage will be delivered to the MQTT sessions with appropriate subscriptions.\n\nDirect messages publication to system MQTT topics (those that start from \"flespi/\") is not possible.\n\nCall format: **POST /mqtt/messages**.\n","parameters":[{"$ref":"#/parameters/cid-header"},{"description":"Messages to publish","in":"body","name":"data","required":true,"schema":{"anyOf":[{"$ref":"#/definitions/messages.post.array"},{"$ref":"#/definitions/message.post"}]}}],"responses":{"200":{"description":"Successfully published messages indexes","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"items":{"format":"uint32","type":"integer"},"type":"array"}},"type":"object"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Publish MQTT message","tags":["messages"],"x-flespi-extra-parameters":{"grant-access":"operate-as","uri-prefix":"mqtt"}}},"/messages/{messages-selector}":{"delete":{"description":"Delete retained messages stored by MQTT broker under the specified topic in MQTT subscription format (e.g. use simple # to delete all user messages).\n\nBroker won't generate associated null payload per each deleted message, but silently delete them from retained storage.\n\nUse with caution!\n\nNormal way of deleting retained message is by publishing into its original topic MQTT message with empty payload.\nIn such way broker will delete it and all subscribers also will receive notification.\n\nYou can recursively delete topic and all its descendants via this method using MQTT-subscribe style topics with wildcards (e.g. 'user/+/data/#' topic will delete everything you would expect subscribing to this topic).\n\nRemember that deletion MQTT topic in '{messages-selector}' should be urlencoded.\n\nCall format: **DELETE /mqtt/messages/{messages-selector}**\n","parameters":[{"description":"Deletion parameters","in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/messages.delete"}}],"responses":{"200":{"description":"All matched messages were removed. The response carries the customer IDs whose retained-message storage was affected (the master account plus any subaccounts when `recursive=true`).\n","schema":{"properties":{"result":{"description":"Customer IDs whose retained-message storage was touched.","items":{"$ref":"#/definitions/item.cid"},"type":"array"}},"type":"object"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Delete retained MQTT messages","tags":["messages"],"x-flespi-extra-parameters":{"grant-access":"operate-as","uri-prefix":"mqtt"}},"get":{"description":"Retrieve all retained messages stored by MQTT broker under the specified topic in MQTT subscription format (e.g. use simple # to receive all messages).\n\nRemember that subscription topic in '{messages-selector}' should be urlencoded.\n\nCall format: **GET /mqtt/messages/{messages-selector}?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/message-fields"},{"description":"Message fetching parameters","in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/messages.get"}}],"responses":{"200":{"description":"Retained messages array.","schema":{"properties":{"result":{"items":{"$ref":"#/definitions/message"},"type":"array"}},"type":"object"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Get retained messages","tags":["messages"],"x-flespi-extra-parameters":{"grant-access":"operate-as","uri-prefix":"mqtt"}},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/messages-selector"}]},"/sessions":{"post":{"description":"Create new persistent MQTT session via REST (offline). You pass JSON array with session configuration objects - one object per each session to create.\n\nCall format: **POST /mqtt/sessions?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created MQTT session\n","parameters":[{"$ref":"#/parameters/cid-header"},{"in":"body","name":"data","required":true,"schema":{"anyOf":[{"$ref":"#/definitions/session.post"},{"items":{"$ref":"#/definitions/session.post"},"maxItems":100,"minItems":1,"type":"array"}]}}],"responses":{"200":{"description":"Sessions collection.","schema":{"$ref":"#/definitions/sessions.result"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Create persistent MQTT session","tags":["sessions"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}}},"/sessions/{sessions-selector}":{"delete":{"description":"Delete selected MQTT sessions. Use with caution!\n\nIf MQTT session was online it will be disconnected so consider this method as an efficient possibility to disconnect MQTT sessions via REST API.\n\nUse special keyword \"all\" to delete all MQTT sessions. Specify filtering conditions within path in 'sessions-selector' to delete only sessions that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for sessions that will be deleted by calling corresponding GET method.\n\nCall format: **DELETE /mqtt/sessions/{sessions-selector}**.\n","responses":{"200":{"description":"Result contains ID of deleted items.","schema":{"$ref":"#/definitions/id.result"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Delete MQTT session","tags":["sessions"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}},"get":{"description":"Get collection of MQTT sessions operated by user (both online and offline).\n\nUse special keyword \"all\" to retrieve all MQTT sessions. Specify filtering conditions within path in 'sessions-selector' to retrieve only sessions that conforms to specified criterias.\n\nCall format: **GET /mqtt/sessions/{sessions-selector}?fields=field1,field2,field3&limit=10&offset=0**\nwhere fields, limit and offset are optional arguments to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/session-fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Sessions collection.","schema":{"$ref":"#/definitions/sessions.result"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Retrieve MQTT sessions","tags":["sessions"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/sessions-selector"}]},"/sessions/{sessions-selector}/subscriptions":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/sessions-selector"}],"post":{"description":"Use REST to create subscription(s) for selected MQTT sessions.\n\nUse this method to create subscription via REST for selected MQTT session(s).\n\nCall format: **POST /mqtt/sessions/{sessions-selector}/subscriptions**\n","parameters":[{"$ref":"#/parameters/subscription-fields"},{"in":"body","name":"data","required":true,"schema":{"anyOf":[{"$ref":"#/definitions/subscription.post"},{"items":{"$ref":"#/definitions/subscription.post"},"type":"array"}]}}],"responses":{"200":{"description":"Subscriptions collection.","schema":{"$ref":"#/definitions/id.result"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Subscribe MQTT session to a topic","tags":["sessions"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}}},"/sessions/{sessions-selector}/subscriptions/{subscriptions-selector}":{"delete":{"description":"Unsubscribe MQTT session from certain subscribtion topic.\n\nUse this method to unsubscribe MQTT session from topic using REST. You may pass **all** in subscriptions selector to unsubscribe session from all topics or select specific subscription to delete (unsubscribe).\n\nCall format: **DELETE /mqtt/sessions/{sessions-selector}/subscriptions/{subscriptions-selector}**\n","responses":{"200":{"description":"Result contains ID of deleted items.","schema":{"$ref":"#/definitions/id.result"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Unsubscribe MQTT session from topic","tags":["sessions"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}},"get":{"description":"Retrieve all or selected subscriptions for MQTT selected session(s).\n\nUse this method to list topics to which given MQTT session is subscribed to. You may pass **all** in subscriptions selector to list all session subscriptions.\n\nCall format: **GET /mqtt/sessions/{sessions-selector}/subscriptions/{subscriptions-selector}**\n","parameters":[{"$ref":"#/parameters/subscription-fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Subscriptions collection.","schema":{"$ref":"#/definitions/subscriptions"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"401":{"description":"Header \"Authorization: FlespiToken XXXXXXXX\" required.\n","schema":{"$ref":"#/definitions/errors.result"}},"403":{"description":"Token or customer is blocked by the platform due to variety of reasons.\n","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Retrieve MQTT session subscriptions","tags":["sessions"],"x-flespi-extra-parameters":{"uri-prefix":"mqtt"}},"parameters":[{"$ref":"#/parameters/sessions-selector"},{"$ref":"#/parameters/subscriptions-selector"},{"$ref":"#/parameters/cid-header"}]}},"produces":["application/json"],"schemes":["https","http"],"securityDefinitions":{"FlespiToken":{"description":"Authorization through FlespiToken","in":"header","name":"Authorization","type":"apiKey"}},"swagger":"2.0","tags":[{"description":"Access to the MQTT broker logs. All broker operations are recorded to the [logs subsystem](/docs/#/platform/logs) with the following possible event codes:\n\nEvent code | Description\n-----|------\n    20|customer was blocked, see [customer](/docs/#/platform/customer) for more information\n    21|customer was unblocked, see [customer](/docs/#/platform/customer) for more information\n    500|session successfully connected to the gateway\n    501|session access prohibited due to blocking rules, [customer](/docs/#/platform/customer) for more information\n    502|session connection was rejected due to invalid credentials\n    503|session connection was closed\n    504|persistent session was overflowed and deleted\n    510|new subscription was created for MQTT session via REST API\n    511|session subscription was updated via REST API\n    512|session subscription was deleted via REST API\n    520|session subscribed to a topic\n    521|session unsubscribed from a topic\n    530|MQTT packet was sent\n    531|MQTT packet was received\n\nEvent codes 20 and 21 occur when a flespi account was blocked/unblocked due to MQTT and REST API traffic [limitations](https://flespi.com/terms-of-use#restrictions).\n\nEvent codes 500-503 have the following fixed fields in event payload:\n\nField name | Meaning\n----------------------|--------\ntoken_id        |token used to establish MQTT connection\nclient_id       |session client id\npublished       |number of messages published by session\nreceived        |number of messages received by session\npeer            |client connection IP address\n","name":"logs"},{"description":"Changelog posts of the flespi MQTT broker system and related applications.\n\nTo stay current with MQTT broker updates, subscribe to 'flespi/message/mqtt/changelog' MQTT topic delivering any new posts published in the system [changelog](https://forum.flespi.com/t/changelog) topics on the forum.\n\nThe accumulated history of such posts is available with the 'GET /mqtt/changelog-posts' request. Each post carries the 'title', 'url' and 'author' of the original forum post, its 'text' in markdown, the publication 'timestamp', and the 'name' of the specific changelog it belongs to:\n\nname | changelog | posts to expect\n-----|-----------|----------------\nmqtt-broker | [flespi MQTT Broker](https://forum.flespi.com/d/19-changelog-flespi-mqtt-broker) | MQTT Broker features and REST API updates\nmqtt-tiles | [MQTT Tiles](https://forum.flespi.com/d/4-changelog-mqtt-tiles) | MQTT Tiles release notes\nmqtt-board | [MQTT Board](https://forum.flespi.com/d/65-changelog-mqtt-board) | MQTT Board release notes\n","name":"changelog"},{"description":"Via REST API it is possible to list, delete all MQTT sessions and configure their MQTT subscriptions.\n\nYou can access one or multiple sessions using the client_id, like: **GET /mqtt/sessions/my-client1,my-client2** to select two sessions with client-id = my-client1 and my-client2.\n\nPlease see [MQTT API](https://flespi.com/kb/flespi-api-basics#mqtt-api) for more information.\n","name":"sessions"},{"description":"Provides a set of methods to publish MQTT messages into flespi MQTT Broker or subscribe to retain messages via the [REST API](https://flespi.com/kb/flespi-api-basics#rest-api).\n\nIt is possible to post MQTT messages directly into the MQTT bus (simulate normal MQTT message publication), fetch retained MQTT topics and their payloads or delete them.\n","name":"messages"}]}