{"basePath":"/gw","definitions":{"asset":{"description":"asset information","properties":{"active":{"$ref":"#/definitions/asset.interval"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs_count":{"description":"number of calculators this asset is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"description":"ID of the device currently linked to the asset.","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"groups_count":{"description":"number of groups this asset is assigned to","type":"integer"},"id":{"$ref":"#/definitions/item.id"},"intervals_ttl":{"$ref":"#/definitions/asset.intervals_ttl"},"last":{"$ref":"#/definitions/asset.interval"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"$ref":"#/definitions/item.priority"},"size":{"description":"Storage used by the asset's intervals, in KB.","type":"integer"}},"type":"object"},"asset.fields.shared":{"properties":{"active":{"$ref":"#/definitions/asset.interval"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs_count":{"description":"number of calculators this asset is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"description":"ID of the device currently linked to the asset.","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"groups_count":{"description":"number of groups this asset is assigned to","type":"integer"},"intervals_ttl":{"$ref":"#/definitions/asset.intervals_ttl"},"last":{"$ref":"#/definitions/asset.interval"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"$ref":"#/definitions/item.priority"},"size":{"description":"Storage used by the asset's intervals, in KB.","type":"integer"}},"type":"object"},"asset.interval":{"properties":{"asset_id":{"$ref":"#/definitions/asset.interval.asset_id"},"begin":{"$ref":"#/definitions/asset.interval.begin"},"device_id":{"$ref":"#/definitions/asset.interval.device_id"},"end":{"$ref":"#/definitions/asset.interval.end"},"meta":{"$ref":"#/definitions/asset.interval.meta"},"timestamp":{"$ref":"#/definitions/asset.interval.timestamp"}},"title":"interval information","type":"object"},"asset.interval.asset_id":{"description":"asset ID","type":"number","x-view-selector":"assets"},"asset.interval.begin":{"description":"interval begin time","minimum":0,"type":"number","x-view-type":"datetime"},"asset.interval.device_id":{"description":"device ID assigned on this interval, zero if unassigned","minimum":0,"type":"number","x-view-selector":"devices"},"asset.interval.end":{"description":"interval end time, zero if unlimited","minimum":0,"type":"number","x-view-type":"datetimezero"},"asset.interval.meta":{"additionalProperties":true,"description":"Any additional meta associated with this interval, can be accessed in filter operations later with \"json(meta, '/json-path')\" expression. Maximum 8KB of JSON size allowed.","maxProperties":100,"type":"object"},"asset.interval.post":{"description":"register interval event","properties":{"begin":{"$ref":"#/definitions/asset.interval.begin"},"device_id":{"$ref":"#/definitions/asset.interval.device_id"},"end":{"$ref":"#/definitions/asset.interval.end"},"meta":{"$ref":"#/definitions/asset.interval.meta"}},"required":["begin","end","device_id"],"type":"object"},"asset.interval.timestamp":{"description":"UNIX timestamp of the interval registration, if zero or not set current time will be used","minimum":0,"type":"number","x-view-type":"datetime"},"asset.intervals.count":{"description":"Maximum number of intervals to return, leave unspecified to prevent any limitation\n","format":"uint32","minimum":1,"type":"number"},"asset.intervals.fields":{"description":"Output only selected fields per each listed interval.\n","maxLength":4096,"type":"string"},"asset.intervals.filter":{"description":"Any arbitrary expression to select intervals based on their properties.\n","format":"expression","maxLength":1024,"type":"string"},"asset.intervals.get":{"description":"intervals selection specification","properties":{"begin":{"$ref":"#/definitions/asset.interval.begin"},"count":{"$ref":"#/definitions/asset.intervals.count"},"end":{"$ref":"#/definitions/asset.interval.end"},"fields":{"$ref":"#/definitions/asset.intervals.fields"},"filter":{"$ref":"#/definitions/asset.intervals.filter"},"reverse":{"$ref":"#/definitions/asset.intervals.reverse"}},"type":"object"},"asset.intervals.result":{"properties":{"result":{"items":{"$ref":"#/definitions/asset.interval"},"title":"array with intervals","type":"array"}},"type":"object"},"asset.intervals.reverse":{"description":"Retrieve intervals in reverse order, starting from the 'end' time and down to the 'begin' time\n","type":"boolean"},"asset.intervals_ttl":{"description":"Time to live for asset intervals in seconds.","format":"uint32","maximum":315360000,"minimum":86400,"title":"intervals TTL","type":"integer","x-view-divider":86400,"x-view-unit":"days"},"asset.intervals_ttl_default":{"default":31536000,"description":"Time to live for asset intervals in seconds.","format":"uint32","maximum":315360000,"minimum":86400,"title":"intervals TTL","type":"integer","x-view-divider":86400,"x-view-unit":"days"},"asset.post":{"properties":{"enabled":{"$ref":"#/definitions/item.enabled-default"},"intervals_ttl":{"$ref":"#/definitions/asset.intervals_ttl_default"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"$ref":"#/definitions/item.priority-default"}},"required":["name"],"title":"Asset","type":"object","x-view-order":["name","enabled","priority","intervals_ttl","metadata"]},"asset.subitem.put":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"}},"type":"object"},"assets.post":{"items":{"$ref":"#/definitions/asset.post"},"maxItems":128,"minItems":1,"title":"Assets array","type":"array"},"assets.put":{"properties":{"enabled":{"$ref":"#/definitions/item.enabled"},"intervals_ttl":{"$ref":"#/definitions/asset.intervals_ttl"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"$ref":"#/definitions/item.priority"}},"type":"object","x-view-order":["name","enabled","priority","intervals_ttl","metadata"]},"assets.result":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Assets collection.","items":{"$ref":"#/definitions/asset"},"type":"array"}},"type":"object"},"calc":{"description":"Calculator information","properties":{"assets_count":{"description":"Number of assets assigned to the calculator","type":"integer"},"blocked":{"$ref":"#/definitions/calc.blocked"},"cid":{"$ref":"#/definitions/item.cid"},"counters":{"$ref":"#/definitions/calc.interval.counters"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"description":"Attached devices count","type":"integer"},"geofences_count":{"description":"Number of geofences assigned to the calculator","type":"integer"},"groups_count":{"description":"Number of groups assigned to the calculator","type":"integer"},"id":{"$ref":"#/definitions/calc.id"},"intervals_rotate":{"$ref":"#/definitions/calc.intervals_rotate"},"intervals_size":{"description":"Storage used by all devices of given calculator, in KB.","type":"integer"},"intervals_ttl":{"$ref":"#/definitions/calc.intervals_ttl-nodefault"},"messages_source":{"$ref":"#/definitions/calc.messages_source"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/calc.name"},"selectors":{"$ref":"#/definitions/calc.interval.selectors"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"update_delay":{"$ref":"#/definitions/calc.update_delay-nodefault"},"update_onchange":{"$ref":"#/definitions/calc.update_onchange-nodefault"},"update_period":{"$ref":"#/definitions/calc.update_period-nodefault"},"validate_interval":{"$ref":"#/definitions/container.interval.validate_interval"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"},"version":{"description":"Auto-incrementing version of calculator configuration","format":"uint32","type":"integer"}},"type":"object"},"calc.asset":{"description":"information about asset inside calculator","properties":{"active":{"$ref":"#/definitions/asset.interval"},"asset_id":{"$ref":"#/definitions/item.id"},"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calc_id":{"$ref":"#/definitions/item.id"},"calcs_count":{"description":"number of calculators this asset is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"description":"ID of the device currently linked to the asset.","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/subitem.fields"},"groups_count":{"description":"number of groups this asset is assigned to","type":"integer"},"intervals_ttl":{"$ref":"#/definitions/asset.intervals_ttl"},"last":{"$ref":"#/definitions/asset.interval"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"$ref":"#/definitions/item.priority"},"size":{"description":"Storage used by the asset's intervals, in KB.","type":"integer"}},"type":"object"},"calc.assets":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Calc assets collection","items":{"$ref":"#/definitions/calc.asset"},"type":"array"}},"type":"object"},"calc.blocked":{"description":"Block code for calculator, if non-zero means calculator is currently blocked and not operating","format":"uint32","type":"integer"},"calc.device":{"description":"properties of device assigned to calculator","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/calc.device.blocked"},"calc_id":{"$ref":"#/definitions/calc.id"},"calc_name":{"$ref":"#/definitions/calc.name"},"calcs":{"$ref":"#/definitions/device.calcs"},"calcs_count":{"$ref":"#/definitions/device.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"commands":{"$ref":"#/definitions/device.commands"},"commands_queue":{"$ref":"#/definitions/device.commands_queue"},"configuration":{"$ref":"#/definitions/device.configuration"},"connected":{"$ref":"#/definitions/device.connected"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"$ref":"#/definitions/device.id"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"device_type_name":{"$ref":"#/definitions/device.device_type_name"},"enabled":{"$ref":"#/definitions/calc.device.enabled"},"geofences_count":{"$ref":"#/definitions/device.geofences_count"},"groups":{"$ref":"#/definitions/device.groups"},"groups_count":{"$ref":"#/definitions/device.groups_count"},"intervals_size":{"$ref":"#/definitions/calc.device.intervals_size"},"last_active":{"$ref":"#/definitions/device.last_active"},"media_blocked":{"$ref":"#/definitions/device.media_blocked"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_size":{"$ref":"#/definitions/device.media_size"},"media_traffic":{"$ref":"#/definitions/device.media_traffic"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages":{"$ref":"#/definitions/device.messages"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_size":{"$ref":"#/definitions/device.messages_size"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"},"plugins":{"$ref":"#/definitions/device.plugins"},"plugins_count":{"$ref":"#/definitions/device.plugins_count"},"protocol_id":{"$ref":"#/definitions/device.protocol_id"},"protocol_name":{"$ref":"#/definitions/device.protocol_name"},"settings":{"$ref":"#/definitions/device.settings"},"streams":{"$ref":"#/definitions/device.streams"},"streams_count":{"$ref":"#/definitions/device.streams_count"},"synced":{"$ref":"#/definitions/calc.device.synced"},"telemetry":{"$ref":"#/definitions/device.telemetry"},"time_begin":{"$ref":"#/definitions/calc.device.time_begin"},"time_end":{"$ref":"#/definitions/calc.device.time_end"},"tline_id":{"description":"ID of the timeline this calc-device subitem belongs to.","type":"integer"},"traffic":{"$ref":"#/definitions/device.traffic"}},"type":"object"},"calc.device.blocked":{"description":"Active block code for device. Non-zero code means device is blocked for intervals registration and not operatable.","format":"uint32","type":"integer"},"calc.device.enabled":{"description":"Enabled/disabled state for assigned device. Assigned to calculator device operates in background and updates intervals upon new messages arrivals only when enabled.","type":"boolean"},"calc.device.group.fields":{"default":{},"description":"fields to be specified in calculated device assignment when auto assigning it to calculator via group","properties":{"enabled":{"$ref":"#/definitions/calc.device.enabled"},"time_begin_offset":{"description":"Positive or negative offset in seconds, starting from the current time, used to set the boundaries of the calculation time range.","type":"integer"},"time_end_offset":{"description":"Positive or negative offset in seconds, starting from the current time, used to set the boundaries of the calculation time range.","type":"integer","x-view-type":"seconds"}},"type":"object","x-view-order":["time_begin_offset","time_end_offset","enabled"]},"calc.device.interval":{"additionalProperties":true,"description":"Interval parameters","maxProperties":1000,"properties":{"begin":{"$ref":"#/definitions/calc.device.interval.begin"},"end":{"$ref":"#/definitions/calc.device.interval.end"},"id":{"$ref":"#/definitions/calc.device.interval.id"},"timestamp":{"$ref":"#/definitions/calc.device.interval.timestamp"}},"required":["id","begin","end"],"type":"object"},"calc.device.interval.begin":{"description":"interval begin time","minimum":1,"type":"number"},"calc.device.interval.end":{"description":"interval end time","minimum":1,"type":"number"},"calc.device.interval.id":{"description":"unique for this device interval ID, used for interval selection or identification","minimum":1,"type":"integer"},"calc.device.interval.timestamp":{"description":"interval modification (via background recalculation job) timestamp","type":"number"},"calc.device.intervals.filter":{"description":"Interval filter string in form property|operand|value, e.g. timestamp>12345 or device.id=1","maxLength":1024,"type":"string"},"calc.device.intervals.get":{"properties":{"begin":{"$ref":"#/definitions/calc.device.intervals.time_selector"},"count":{"description":"maximum quantity of intervals to return per device, unlimited if not specified","format":"uint32","minimum":1,"type":"integer"},"end":{"$ref":"#/definitions/calc.device.intervals.time_selector"},"fields":{"description":"Return intervals with specified fields only. Wildcard for field names can be used. Empty intervals will be skipped.\n","maxLength":4096,"type":"string"},"filter":{"$ref":"#/definitions/calc.device.intervals.filter"},"reverse":{"default":false,"description":"true ⇒ return intervals in reverse mode, from end time to begin time","type":"boolean"}},"type":"object"},"calc.device.intervals.put":{"additionalProperties":true,"description":"Associated array of parameters where parameter name is a key and parameter value is data.\nIt is not allowed to update auto-generated by the system properties of intervals like begin, end, id, duration, timestamp and all configured calculator counter names.\ntimestamp key is used to identify timestamp of modification operation and will override all stored parameters with same or above timestamp.\nIn order to remove parameter you may register null value.\n","maxProperties":1000,"minProperties":1,"properties":{"timestamp":{"$ref":"#/definitions/calc.device.interval.timestamp"}},"type":"object"},"calc.device.intervals.result":{"properties":{"result":{"description":"selected intervals","items":{"$ref":"#/definitions/calc.device.interval"},"type":"array"}},"type":"object"},"calc.device.intervals.time_selector":{"description":"interval by time selector, inclusive to interval begin/end times","minimum":0,"type":"number"},"calc.device.intervals_size":{"description":"Storage size used by intervals for given device calculator, in KB.","format":"uint32","type":"integer"},"calc.device.put":{"description":"parameters for device assignment to calculator","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"enabled":{"$ref":"#/definitions/calc.device.enabled"},"time_begin":{"$ref":"#/definitions/calc.device.time_begin"},"time_end":{"$ref":"#/definitions/calc.device.time_end"}},"type":"object"},"calc.device.synced":{"description":"Current synced state for the device, set by automatic calculation system. Set to true when the system calculated intervals at least once and currently track any changes in device messages.","format":"uint32","type":"boolean"},"calc.device.time_begin":{"description":"Minimum inclusive time border (UNIX timestamp) of messages where calculator checking intervals, zero if unlimited","format":"uint32","type":"integer","x-view-type":"datetimezero"},"calc.device.time_end":{"description":"Maximum inclusive time border (UNIX timestamp) of messages where calculator checking intervals, zero if unlimited","format":"uint32","type":"integer","x-view-type":"datetimezero"},"calc.devices":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Collection of devices assigned to calculator, their bindings","items":{"$ref":"#/definitions/calc.device"},"type":"array"}},"type":"object"},"calc.devices.post":{"description":"parameters for device assignment to calculator","properties":{"enabled":{"$ref":"#/definitions/item.enabled-default"},"time_begin":{"$ref":"#/definitions/calc.device.time_begin"},"time_end":{"$ref":"#/definitions/calc.device.time_end"}},"type":"object","x-view-order":["time_begin","time_end","enabled"]},"calc.devices.recalculate.post":{"properties":{"from":{"description":"Minimum inclusive time border (UNIX timestamp) of messages which should be recalculated according to current configuration of calculator, zero if not specified","minimum":0,"type":"number","x-view-type":"datetime"},"to":{"description":"Maximum inclusive time border (UNIX timestamp) of messages which should be recalculated according to current configuration of calculator, zero if not specified","minimum":0,"type":"number","x-view-type":"datetime"}},"type":"object","x-view-order":["from","to"]},"calc.geofence":{"description":"information about geofence inside calculator","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calc_id":{"$ref":"#/definitions/item.id"},"calcs":{"$ref":"#/definitions/subitems.array"},"calcs_count":{"description":"Number of calculators the geofence is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices":{"$ref":"#/definitions/subitems.array"},"devices_count":{"description":"Number of devices the geofence is assigned to","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/subitem.fields"},"geofence_id":{"$ref":"#/definitions/item.id"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"groups":{"$ref":"#/definitions/subitems.array"},"groups_count":{"description":"Number of groups the geofence is assigned to","type":"integer"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"plugins":{"$ref":"#/definitions/subitems.array"},"plugins_count":{"description":"Number of plugins the geofence is assigned to","type":"integer"},"priority":{"$ref":"#/definitions/geofence.priority"},"streams":{"$ref":"#/definitions/subitems.array"},"streams_count":{"description":"Number of streams the geofence is assigned to","type":"integer"}},"type":"object"},"calc.geofences":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Calc geofences collection","items":{"$ref":"#/definitions/calc.geofence"},"type":"array"}},"type":"object"},"calc.group":{"description":"calculator group information","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calc_id":{"$ref":"#/definitions/calc.id"},"calcs_count":{"$ref":"#/definitions/group.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"$ref":"#/definitions/group.devices_count"},"fields":{"$ref":"#/definitions/calc.device.group.fields"},"geofences_count":{"$ref":"#/definitions/group.geofences_count"},"group_id":{"$ref":"#/definitions/group.id"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/group.name"},"plugins_count":{"$ref":"#/definitions/group.plugins_count"},"streams_count":{"$ref":"#/definitions/group.streams_count"}},"type":"object"},"calc.groups":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Calculator groups collection","items":{"$ref":"#/definitions/calc.group"},"type":"array"}},"type":"object"},"calc.groups.post":{"properties":{"fields":{"$ref":"#/definitions/calc.device.group.fields"}},"type":"object","x-view-order":["fields"]},"calc.id":{"description":"Unique calculator ID","minimum":1,"type":"integer","x-flespi-acl":"gw/calcs","x-view-selector":"calcs"},"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"},"calc.intervals_rotate":{"description":"Circular buffer size for the calculator events in device, when size is larger than specified older events will be auto-erased. In KB, zero values means buffer rotation is disabled.","format":"uint32","title":"Intervals rotation size","type":"integer","x-view-divider":1024,"x-view-unit":"MB"},"calc.intervals_ttl-default":{"default":31536000,"description":"Storage duration for calculator events in device, in seconds.","format":"uint32","maximum":315360000,"minimum":86400,"type":"integer","x-view-divider":86400,"x-view-unit":"days"},"calc.intervals_ttl-nodefault":{"description":"Storage duration for calculator events in device, in seconds.","format":"uint32","maximum":315360000,"minimum":86400,"type":"integer","x-view-divider":86400,"x-view-unit":"days"},"calc.messages_source":{"anyOf":[{"$ref":"#/definitions/calc.messages_source.device"},{"$ref":"#/definitions/calc.messages_source.calc"}],"description":"Messages source for the calculator","x-key-property":"source"},"calc.messages_source.calc":{"properties":{"calc_id":{"description":"Unique calculator ID from which to take source messages for this calculator","minimum":1,"type":"integer","x-flespi-acl":"gw/calcs","x-view-selector":"calcs"},"source":{"const":"calc","default":"calc","description":"Perform calculation over messages generated by another calculator attached to devices.\nUsually this source type is used to calculate aggregated interval messages over some time period.\nFor example you may have normal calculator that calculates trips and per each trip generate interval message.\nAnd than create another calculator that will use intervals generated by this calculator as message source but aggregate them into one interval message based on datetime selector, e.g. daily.\nIn that case you may have detailed trips in one calculator and daily trips aggregated in one interval message.\nPlease note that in selectors and counters of such calculators you do not access to original message fields and may only use counters from source calculator.\n","readOnly":true,"type":"string"}},"required":["source","calc_id"],"title":"intervals from another calculator","type":"object","x-view-order":["source","calc_id"]},"calc.messages_source.device":{"properties":{"source":{"const":"device","default":"device","description":"Perform calculation over raw messages from device\n","readOnly":true,"type":"string"}},"required":["source"],"title":"device messages","type":"object","x-view-order":["source"]},"calc.name":{"description":"Calculator name","maxLength":256,"type":"string"},"calc.post":{"description":"Information for calculator creation","properties":{"counters":{"$ref":"#/definitions/calc.interval.counters"},"intervals_rotate":{"$ref":"#/definitions/calc.intervals_rotate"},"intervals_ttl":{"$ref":"#/definitions/calc.intervals_ttl-default"},"messages_source":{"$ref":"#/definitions/calc.messages_source"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/calc.name"},"selectors":{"$ref":"#/definitions/calc.interval.selectors"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"update_delay":{"$ref":"#/definitions/calc.update_delay-default"},"update_onchange":{"$ref":"#/definitions/calc.update_onchange-default"},"update_period":{"$ref":"#/definitions/calc.update_period-default"},"validate_interval":{"$ref":"#/definitions/container.interval.validate_interval"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"required":["selectors"],"type":"object","x-view-order":["name","messages_source","update_period","update_delay","update_onchange","intervals_ttl","intervals_rotate","selectors","counters","validate_interval","validate_message","timezone","metadata"]},"calc.put":{"description":"Calculator update information","properties":{"counters":{"$ref":"#/definitions/calc.interval.counters"},"intervals_rotate":{"$ref":"#/definitions/calc.intervals_rotate"},"intervals_ttl":{"$ref":"#/definitions/calc.intervals_ttl-nodefault"},"messages_source":{"$ref":"#/definitions/calc.messages_source"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/calc.name"},"selectors":{"$ref":"#/definitions/calc.interval.selectors"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"update_delay":{"$ref":"#/definitions/calc.update_delay-nodefault"},"update_onchange":{"$ref":"#/definitions/calc.update_onchange-nodefault"},"update_period":{"$ref":"#/definitions/calc.update_period-nodefault"},"validate_interval":{"$ref":"#/definitions/container.interval.validate_interval"},"validate_message":{"$ref":"#/definitions/container.interval.validate_message"}},"type":"object","x-view-order":["name","messages_source","update_period","update_delay","update_onchange","intervals_ttl","intervals_rotate","selectors","counters","validate_interval","validate_message","timezone","metadata"]},"calc.update_delay-default":{"default":30,"description":"Minimum update delay in seconds between arrival of new message and calc.device operation. Can be used to lower frequency of interval events generation.","format":"uint32","maximum":3600,"minimum":1,"type":"integer"},"calc.update_delay-nodefault":{"description":"Minimum update delay in seconds between arrival of new message and calc.device operation. Can be used to lower frequency of interval events generation.","format":"uint32","maximum":3600,"minimum":1,"type":"integer"},"calc.update_onchange-default":{"default":true,"description":"If set to true - automatically synchronize existing intervals within 'update_period' for assigned devices when the calculator configuration changes (selectors, counters, validation rules, timezone) or when the geofences, assets or device metadata used by the calculator change.\nIf set to false - none of these changes recalculates existing intervals, the new state is applied only to intervals that receive new messages from device.\n","type":"boolean"},"calc.update_onchange-nodefault":{"description":"If set to true - automatically synchronize existing intervals within 'update_period' for assigned devices when the calculator configuration changes (selectors, counters, validation rules, timezone) or when the geofences, assets or device metadata used by the calculator change.\nIf set to false - none of these changes recalculates existing intervals, the new state is applied only to intervals that receive new messages from device.\n","type":"boolean"},"calc.update_period-default":{"default":864000,"description":"Maximum time range for the update from current moment. No interval updates where interval end time is outside specified range will be issued either due to messages updates or to calculator change.\nThis parameter can be used to specify persistance moment of calculator - when generated intervals can not be automatically changed anymore.\nWhenever you need to force full intervals recalculation due to calculator change or other reasons keep in mind that any interval that ends before specified period from current moment of time will be ignored.\n","format":"uint32","maximum":315360000,"minimum":86400,"type":"integer","x-view-divider":86400,"x-view-unit":"days"},"calc.update_period-nodefault":{"description":"Maximum time range for the update from current moment. No interval updates where interval end time is outside specified range will be issued either due to messages updates or to calculator change.\nThis parameter can be used to specify persistance moment of calculator - when generated intervals can not be automatically changed anymore.\nWhenever you need to force full intervals recalculation due to calculator change or other reasons keep in mind that any interval that ends before specified period from current moment of time will be ignored.\n","format":"uint32","maximum":315360000,"minimum":86400,"type":"integer","x-view-divider":86400,"x-view-unit":"days"},"calcs":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Calculators collection","items":{"$ref":"#/definitions/calc"},"type":"array"}},"type":"object"},"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 registry item 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":{"errors":{"items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"changelog posts sorted by publication time within each selected item","items":{"$ref":"#/definitions/changelog.post"},"type":"array"}},"type":"object"},"changelog.system.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.system.posts":{"properties":{"result":{"description":"changelog posts sorted by publication time","items":{"$ref":"#/definitions/changelog.system.post"},"type":"array"}},"type":"object"},"channel":{"description":"Channel information","properties":{"blocked":{"$ref":"#/definitions/channel.blocked"},"cid":{"$ref":"#/definitions/item.cid"},"configuration":{"$ref":"#/definitions/channel.configuration"},"connections_count":{"$ref":"#/definitions/channel.connections_count"},"created":{"$ref":"#/definitions/item.btime"},"enabled":{"$ref":"#/definitions/item.enabled"},"id":{"$ref":"#/definitions/channel.id"},"idents":{"$ref":"#/definitions/channel.idents"},"messages":{"description":"Messages generated by the channel within last minute.","format":"uint32","type":"integer"},"messages_size":{"$ref":"#/definitions/channel.messages_size"},"messages_ttl":{"$ref":"#/definitions/channel.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/channel.name"},"protocol_features":{"$ref":"#/definitions/channel.protocol_features"},"protocol_id":{"$ref":"#/definitions/channel.protocol_id"},"protocol_name":{"$ref":"#/definitions/channel.protocol_name"},"secondary_uri":{"$ref":"#/definitions/channel.secondary_uri"},"streams_count":{"description":"Number of active streams for the channel.","format":"uint32","type":"integer"},"traffic":{"description":"Total traffic generated by all channel connections within last minute, in bytes.","type":"number"},"udp_packets":{"description":"UDP packets processed by the channel within last minute.","format":"uint32","type":"integer"},"uri":{"$ref":"#/definitions/channel.uri"}},"type":"object"},"channel.blocked":{"description":"If non-zero, contain block code (reason of) for the channel","type":"integer"},"channel.configuration":{"additionalProperties":true,"description":"Protocol dependent configuration parameters. Object schema is defined by the protocol, you may retrieve it with **GET /gw/channel-protocols/{protocol_id}** call.","type":"object","x-view-schema":"configuration"},"channel.connection":{"description":"Channel connection information","properties":{"channel_id":{"$ref":"#/definitions/channel.connection.channel_id"},"connection_id":{"$ref":"#/definitions/channel.connection.id"},"device_id":{"$ref":"#/definitions/channel.connection.device_id"},"established":{"$ref":"#/definitions/channel.connection.established"},"id":{"$ref":"#/definitions/channel.connection.id"},"ident":{"$ref":"#/definitions/channel.connection.ident"},"ip":{"$ref":"#/definitions/channel.connection.ip"},"meta":{"$ref":"#/definitions/channel.connection.meta"},"secondary":{"description":"True for secondary connections (typically used for media transfer alongside the primary connection).","type":"boolean"},"source":{"$ref":"#/definitions/channel.connection.source"},"transport":{"description":"Connection transport (e.g. tcp, udp, http).","type":"string"}},"type":"object"},"channel.connection.channel_id":{"description":"hosting connection channel ID.","minimum":1,"type":"integer"},"channel.connection.device_id":{"description":"Device ID.","type":"integer"},"channel.connection.established":{"description":"Connection establishment time.","type":"integer"},"channel.connection.id":{"description":"Unique TCP connection identifier.","minimum":1,"type":"integer"},"channel.connection.ident":{"description":"Tracking device identification string(may be IMEI, phone number, serial number, etc.)","maxLength":255,"type":"string"},"channel.connection.ids":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"items":{"$ref":"#/definitions/channel.connection.id"},"type":"array"}},"type":"object"},"channel.connection.ip":{"description":"Tracking device IP address.","maxLength":255,"type":"string"},"channel.connection.meta":{"description":"Meta information associated with the connection.","type":"object"},"channel.connection.source":{"description":"Tracking device source address.","maxLength":255,"type":"string"},"channel.connections_count":{"description":"TCP connections count established to the channel now.","format":"uint32","type":"integer"},"channel.id":{"description":"Unique channel ID","minimum":1,"type":"integer","x-flespi-acl":"gw/channels","x-view-selector":"channels"},"channel.ident":{"description":"Channel ident information","properties":{"channel_id":{"$ref":"#/definitions/channel.ident.channel_id"},"device_id":{"description":"ID of the device currently associated with this ident, if any.","type":"integer"},"ident":{"$ref":"#/definitions/channel.ident.ident"},"last_active":{"$ref":"#/definitions/channel.ident.last_active"},"source":{"$ref":"#/definitions/channel.ident.source"}},"type":"object"},"channel.ident.channel_id":{"description":"channel ID for the ident","minimum":1,"type":"integer"},"channel.ident.ident":{"description":"Tracking device identification string(may be IMEI, serial number, etc.)","maxLength":255,"minimum":1,"type":"string"},"channel.ident.last_active":{"description":"Time when there was any communication between channel and given ident, UNIX timestamp","type":"integer"},"channel.ident.source":{"description":"Tracking device source address.","maxLength":255,"type":"string"},"channel.idents":{"additionalProperties":{"properties":{"device_id":{"$ref":"#/definitions/device.id"},"last_active":{"description":"Last time the ident was active in the channel","format":"uint32","type":"integer"},"source":{"description":"Source of the ident","type":"string"}},"type":"object"},"description":"List of idents that the channel has ever received messages from","type":"object"},"channel.idents.result":{"properties":{"result":{"items":{"$ref":"#/definitions/channel.ident"},"type":"array"}},"type":"object"},"channel.message":{"description":"Message data. Associated array of message parameters. Parameter name is a key and parameter data is a value in associated array. Parameter value may be presented by any of base types: string, number, boolean. Complex types (e.g. JSON object or array) are supported only by several pre-defined parameter names.\n","type":"object"},"channel.messages.get":{"anyOf":[{"properties":{"curr_key":{"description":"next_key value taken from previous request, so only new messages will be returned, you may use zero for the first request","minimum":0,"type":"integer"},"delete":{"description":"Mark messages with key **curr_key** and less as processed, so it can be deleted by the system.\nUsed to delete already read messages from previous request and decrease message buffer size.\n","type":"boolean"},"limit_count":{"$ref":"#/definitions/channel.messages.limit_count"},"limit_size":{"default":100000000,"description":"Limit returning messages size. Will be returned this or slightly larger size of messages, depending on how much messages are passed through channel per second.","format":"uint32","maximum":100000000,"type":"integer"},"timeout":{"description":"Timeout for request in a push mode (in case if there is no messages in the channel at the moment).","format":"uint32","maximum":30,"type":"integer"}},"title":"pull-based access mode for channel messages, the request can be hold on the server while there are new messages if positive timeout is specified","type":"object"},{"properties":{"count":{"$ref":"#/definitions/channel.messages.limit_count"},"fields":{"description":"CSV-formatted list of parameters to be returned in response message list in form \"server.timestamp,*can*,position.*\".\nIf message does not contain all specified fields, it will be skipped.\n","maxLength":4096,"type":"string"},"filter":{"description":"Optional filter string to return only messages conforming to specific filtering rules. You can use flespi [expressions](https://flespi.com/kb/expressions) and reference message parameters inside them.\n","maxLength":1024,"type":"string","x-view-type":"expression"},"from":{"description":"Minimum time when messages where registered to the channel, in UNIX time, 0 - not specified","minimum":0,"type":"number","x-view-type":"datetime"},"reverse":{"default":false,"description":"false => return messages left to right, if true => return messages in right to left mode, starting from 'from' time value","type":"boolean"},"to":{"description":"Maximum time when messages where registered to the channel, in UNIX time, 0 - not specified","minimum":0,"type":"number","x-view-type":"datetime"}},"title":"serial based instant access to channel messages with possibility to filter them, traverse with timestamps or even in reverse order","type":"object"}]},"channel.messages.limit_count":{"default":1000000,"description":"Limit returning messages quantity. Will be returned this or slightly higher quantity of messages, depending on how much messages are passed through channel per second.","format":"uint32","maximum":1000000,"minimum":1,"type":"integer"},"channel.messages_size":{"description":"Size of channel messages queue, in KB","format":"uint32","type":"integer"},"channel.messages_ttl-default":{"anyOf":[{"default":86400,"description":"Messages lifetime. Messages will be automatically removed after specified amount of seconds. if 0 new messages can be streamed or received via API but will not be stored, all existing messages will be automatically removed.","format":"uint32","maximum":2592000,"minimum":60,"title":"Messages TTL","type":"integer","x-view-divider":3600,"x-view-unit":"hours"},{"default":0,"description":"The channel does not have an explicit message expiration interval.","format":"uint32","maximum":0,"minimum":0,"readOnly":true,"title":"Without TTL","type":"integer","x-view-hidden":true}]},"channel.messages_ttl-nodefault":{"anyOf":[{"description":"Messages lifetime. Messages will be automatically removed after specified amount of seconds. if 0 new messages can be streamed or received via API but will not be stored, all existing messages will be automatically removed.","format":"uint32","maximum":2592000,"minimum":60,"title":"Messages TTL","type":"integer","x-view-divider":3600,"x-view-unit":"hours"},{"description":"The channel does not have an explicit message expiration interval.","format":"uint32","maximum":0,"minimum":0,"readOnly":true,"title":"Without TTL","type":"integer","x-view-hidden":true}]},"channel.name":{"description":"channel's short string descriptor.","maxLength":255,"minLength":2,"type":"string"},"channel.post":{"properties":{"configuration":{"$ref":"#/definitions/channel.configuration"},"enabled":{"$ref":"#/definitions/item.enabled-default"},"messages_ttl":{"$ref":"#/definitions/channel.messages_ttl-default"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/channel.name"},"protocol_id":{"$ref":"#/definitions/channel.protocol_id"}},"required":["name","protocol_id"],"title":"create with protocol ID","type":"object","x-view-order":["name","enabled","messages_ttl","protocol_id","configuration","metadata"]},"channel.post.name":{"properties":{"configuration":{"$ref":"#/definitions/channel.configuration"},"enabled":{"$ref":"#/definitions/item.enabled-default"},"messages_ttl":{"$ref":"#/definitions/channel.messages_ttl-default"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/channel.name"},"protocol_name":{"$ref":"#/definitions/channel.protocol_name"}},"required":["name","protocol_name"],"title":"create with protocol name","type":"object"},"channel.protocol_features":{"description":"Features provided by the protocol to the channel of such type and to its device types","type":"object"},"channel.protocol_id":{"description":"ID of a channel protocol. You may retrieve available channel protocols with [GET /gw/channel-protocols/all](https://flespi.io/docs/#/gw/protocols/get_channel_protocols_channel_protocols_selector) API call","minimum":1,"type":"integer","x-view-dict":"protocols"},"channel.protocol_name":{"description":"name of the protocol corresponding to protocol_id","maxLength":255,"minLength":1,"type":"string"},"channel.put":{"properties":{"configuration":{"$ref":"#/definitions/channel.configuration"},"enabled":{"$ref":"#/definitions/item.enabled"},"messages_ttl":{"$ref":"#/definitions/channel.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/channel.name"},"protocol_id":{"$ref":"#/definitions/channel.protocol_id"}},"type":"object","x-view-order":["name","enabled","messages_ttl","protocol_id","configuration","metadata"]},"channel.secondary_uri":{"description":"Channel's secondary listening address:\n* used by some protocols and only for secondary connections with special purposes such as tachograph or video data upload\n* is unique and available to specific flespi user only\n* format: \"host:port\"\n","maxLength":255,"minLength":3,"type":"string"},"channel.uri":{"description":"Channel's listening address:\n* is unique and available to specific flespi user only\n* format: \"host:port\"\n","maxLength":255,"minLength":3,"type":"string"},"channels":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Channels collection.","items":{"$ref":"#/definitions/channel"},"type":"array"}},"type":"object"},"channels.id":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Channels identifiers collection.","items":{"$ref":"#/definitions/channel.id"},"type":"array"}},"type":"object"},"channels.post":{"items":{"anyOf":[{"$ref":"#/definitions/channel.post"},{"$ref":"#/definitions/channel.post.name"}]},"maxItems":1000,"minItems":1,"type":"array"},"command":{"properties":{"address":{"$ref":"#/definitions/command.address"},"description":{"$ref":"#/definitions/command.description"},"examples":{"$ref":"#/definitions/command.examples"},"name":{"$ref":"#/definitions/command.name"},"schema":{"$ref":"#/definitions/command.schema"},"tab":{"$ref":"#/definitions/command.tab"},"tags":{"$ref":"#/definitions/command.tags"},"title":{"$ref":"#/definitions/command.title"}},"type":"object"},"command.address":{"description":"Command address - method used to deliver the command. There are two ways to deliver command to the device. 'connection' - over TCP as soon as device connects to channel host. 'sms' - send command over SMS with modem","items":{"enum":["connection","sms"],"type":"string"}},"command.description":{"description":"Command purpose description.","maxLength":1024,"type":"string"},"command.examples":{"description":"Command's parameters examples","items":{"properties":{"description":{"description":"Command example description","type":"string"},"properties":{"additionalProperties":true,"description":"Example of command parameters","type":"object"}},"type":"object"},"type":"array"},"command.name":{"description":"Command name, unique for parent protocol (used as command identifier in channels and command-queues).","maxLength":255,"minLength":1,"type":"string"},"command.schema":{"additionalProperties":true,"description":"Command's description JSON-scheme. The command must correspond the scheme to be put in the command-queue.","type":"object"},"command.tab":{"description":"UI tab to display command or setting","type":"string"},"command.tags":{"additionalProperties":true,"description":"Object with command tags","type":"object"},"command.title":{"description":"Command title name.","maxLength":255,"type":"string"},"commands":{"description":"Collection of the commands available to execute for the device","items":{"$ref":"#/definitions/command"},"type":"array"},"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"},"device":{"description":"Device information","properties":{"blocked":{"$ref":"#/definitions/device.blocked"},"calcs":{"$ref":"#/definitions/device.calcs"},"calcs_count":{"$ref":"#/definitions/device.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"commands":{"$ref":"#/definitions/device.commands"},"commands_queue":{"$ref":"#/definitions/device.commands_queue"},"configuration":{"$ref":"#/definitions/device.configuration"},"connected":{"$ref":"#/definitions/device.connected"},"created":{"$ref":"#/definitions/item.btime"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"device_type_name":{"$ref":"#/definitions/device.device_type_name"},"enabled":{"$ref":"#/definitions/item.enabled"},"geofences_count":{"$ref":"#/definitions/device.geofences_count"},"groups":{"$ref":"#/definitions/device.groups"},"groups_count":{"$ref":"#/definitions/device.groups_count"},"id":{"$ref":"#/definitions/device.id"},"intervals_size":{"$ref":"#/definitions/device.intervals_size"},"last_active":{"$ref":"#/definitions/device.last_active"},"media_blocked":{"$ref":"#/definitions/device.media_blocked"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_size":{"$ref":"#/definitions/device.media_size"},"media_traffic":{"$ref":"#/definitions/device.media_traffic"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages":{"$ref":"#/definitions/device.messages"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_size":{"$ref":"#/definitions/device.messages_size"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"},"plugins":{"$ref":"#/definitions/device.plugins"},"plugins_count":{"$ref":"#/definitions/device.plugins_count"},"protocol_id":{"$ref":"#/definitions/device.protocol_id"},"protocol_name":{"$ref":"#/definitions/device.protocol_name"},"settings":{"$ref":"#/definitions/device.settings"},"streams":{"$ref":"#/definitions/device.streams"},"streams_count":{"$ref":"#/definitions/device.streams_count"},"telemetry":{"$ref":"#/definitions/device.telemetry"},"traffic":{"$ref":"#/definitions/device.traffic"}},"type":"object"},"device.blocked":{"description":"Active block code for device. Non-zero code means device is blocked and is not available for messages registration, media upload and subset of other operations.","format":"uint32","type":"integer"},"device.calcs":{"description":"List of calculators the device is assigned to.","items":{"$ref":"#/definitions/device.subitem"},"type":"array"},"device.calcs_count":{"description":"Number of calculators the device is assigned to","type":"integer"},"device.command.address":{"default":"connection","enum":["sms","connection"],"type":"string"},"device.command.condition":{"description":"[Expression](https://flespi.com/kb/expressions) validating the device telemetry before command execution.\nIf the expression evaluates to true, the command will be sent to the device; if false, the command will be holded in the queue until the condition becomes true or the command expires.\n","format":"expression-complex","maxLength":1024,"type":"string","x-view-type":"expression"},"device.command.device_id":{"description":"Command recipient.","type":"integer"},"device.command.expires":{"description":"Command expiration UTC timestamp. If no timestamp is set, the command expires in 30 days.","format":"uint32","type":"integer","x-view-type":"datetimezero"},"device.command.id":{"description":"Unique id assigned to given instance of command by the flespi.","format":"uint32","minimum":1,"type":"integer"},"device.command.max_attempts":{"default":3,"description":"Maximum number of attempts to deliver the command to the device.","format":"uint32","maximum":10000,"minimum":1,"type":"integer"},"device.command.meta":{"additionalProperties":true,"description":"Set of name/value pairs. Can be used for storing additional information about the command. Maximum 8KB of JSON size allowed.","maxProperties":100,"type":"object"},"device.command.name":{"description":"Command name according to the protocol specifications.","maxLength":255,"minLength":1,"type":"string"},"device.command.properties":{"additionalProperties":true,"description":"Command properties, defined by the schema. You can [construct correct command properties](https://flespi.com/kb/commands-and-settings) using UI for simplicity.","type":"object"},"device.command.timeout":{"default":30,"description":"Suspend the processing of the request until the command completes or times out.","format":"uint32","maximum":60,"minimum":5,"type":"integer"},"device.command.timestamp":{"description":"Command UTC timestamp.","format":"uint32","type":"integer","x-view-type":"datetimezero"},"device.commands":{"$ref":"#/definitions/commands"},"device.commands_queue":{"description":"Information about commands currently in the device's queue.","items":{"$ref":"#/definitions/devices.commands-queue.item"},"type":"array"},"device.configuration":{"additionalProperties":true,"description":"Device configuration, containing fields like \"ident\", \"phone\", etc. The schema of this object are defined by device type.\n\"ident\" is the most significant property defined by most of device types. Usually 'ident' corresponds to device IMEI, custom number or whatever hardware device is using to identify itself to flespim during protocol-specific connection.\n","title":"Device configuration","type":"object","x-view-schema":"device_configuration"},"device.connected":{"description":"Current device connection status","type":"boolean"},"device.device_type_id":{"description":"Device type. In order flespi platform is able to communicate with this device you should have at least one channel that is working on the device type's protocol.\n","minimum":0,"title":"Device type ID","type":"integer","x-view-dict":"device_types"},"device.device_type_name":{"description":"Device type name. In order flespi platform is able to communicate with this device you should have at least one channel that is working on the device type's protocol.\n","title":"Device type name.","type":"string"},"device.fields.shared":{"properties":{"blocked":{"$ref":"#/definitions/device.blocked"},"calcs":{"$ref":"#/definitions/device.calcs"},"calcs_count":{"$ref":"#/definitions/device.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"commands":{"$ref":"#/definitions/device.commands"},"commands_queue":{"$ref":"#/definitions/device.commands_queue"},"configuration":{"$ref":"#/definitions/device.configuration"},"connected":{"$ref":"#/definitions/device.connected"},"created":{"$ref":"#/definitions/item.btime"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"device_type_name":{"$ref":"#/definitions/device.device_type_name"},"enabled":{"$ref":"#/definitions/item.enabled"},"geofences_count":{"$ref":"#/definitions/device.geofences_count"},"groups":{"$ref":"#/definitions/device.groups"},"groups_count":{"$ref":"#/definitions/device.groups_count"},"intervals_size":{"$ref":"#/definitions/device.intervals_size"},"last_active":{"$ref":"#/definitions/device.last_active"},"media_blocked":{"$ref":"#/definitions/device.media_blocked"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_size":{"$ref":"#/definitions/device.media_size"},"media_traffic":{"$ref":"#/definitions/device.media_traffic"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages":{"$ref":"#/definitions/device.messages"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_size":{"$ref":"#/definitions/device.messages_size"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"},"plugins":{"$ref":"#/definitions/device.plugins"},"plugins_count":{"$ref":"#/definitions/device.plugins_count"},"protocol_id":{"$ref":"#/definitions/device.protocol_id"},"protocol_name":{"$ref":"#/definitions/device.protocol_name"},"settings":{"$ref":"#/definitions/device.settings"},"streams":{"$ref":"#/definitions/device.streams"},"streams_count":{"$ref":"#/definitions/device.streams_count"},"telemetry":{"$ref":"#/definitions/device.telemetry"},"traffic":{"$ref":"#/definitions/device.traffic"}},"type":"object"},"device.geofence":{"description":"information about geofence inside device","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs":{"$ref":"#/definitions/subitems.array"},"calcs_count":{"description":"Number of calculators the geofence is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"$ref":"#/definitions/item.id"},"devices":{"$ref":"#/definitions/subitems.array"},"devices_count":{"description":"Number of devices the geofence is assigned to","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/subitem.fields"},"geofence_id":{"$ref":"#/definitions/item.id"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"groups":{"$ref":"#/definitions/subitems.array"},"groups_count":{"description":"Number of groups the geofence is assigned to","type":"integer"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"plugins":{"$ref":"#/definitions/subitems.array"},"plugins_count":{"description":"Number of plugins the geofence is assigned to","type":"integer"},"priority":{"$ref":"#/definitions/geofence.priority"},"streams":{"$ref":"#/definitions/subitems.array"},"streams_count":{"description":"Number of streams the geofence is assigned to","type":"integer"}},"type":"object"},"device.geofences":{"properties":{"errors":{"description":"Errors occurred while processing the request.","items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"Plugin geofences collection","items":{"$ref":"#/definitions/device.geofence"},"type":"array"}},"type":"object"},"device.geofences_count":{"description":"Number of geofences the device is assigned to","type":"integer"},"device.groups":{"description":"List of groups the device is assigned to.","items":{"$ref":"#/definitions/device.subitem"},"type":"array"},"device.groups_count":{"description":"Number of groups the device is assigned to","type":"integer"},"device.id":{"description":"Unique device ID","minimum":1,"type":"integer","x-flespi-acl":"gw/devices","x-view-selector":"devices"},"device.intervals_size":{"description":"Total size of intervals stored across all calculators this device is assigned to, in KB.","format":"uint32","type":"integer"},"device.last_active":{"description":"UNIX timestamp of the last data received from device by the channel, updated in realtime when there a traffic in corresponding device connection.\nThis field is more durable way to determine the connected device comparing with 'connected' property because it updates whenever we have a new traffic in the channel associated with given device and also works perfect for UDP sockets or connectionless channels.\nTo retrieve list of devices that did not reported to flespi for more than 1 hour just use '{last_active < now() - 3600}' in 'dev-selector'.\n","type":"number"},"device.media_blocked":{"description":"Active block code for device media storage. Non-zero means media operations are blocked.","type":"integer"},"device.media_rotate":{"description":"Circular buffer size for device media storage, when size is larger than specified older messages will be auto-erased. In KB, zero value means media data rotation is disabled.","format":"uint32","maximum":10240000,"title":"Media files rotation size","type":"integer","x-view-divider":1024,"x-view-unit":"MB"},"device.media_size":{"description":"Total size of media files used by device, in KB. Storage of deleted and expired files is reclaimed in background, so the size may reflect their removal up to an hour later.","format":"uint32","type":"integer"},"device.media_traffic":{"description":"Media traffic(videos, photos, tacho etc.) requested from device media storage within last minute, in bytes.","format":"uint32","type":"integer"},"device.media_ttl-default":{"default":31536000,"description":"The lifetime of device media files. The files will be automatically removed after specified amount of seconds.","format":"uint32","maximum":315360000,"minimum":86400,"title":"Media files TTL","type":"integer","x-view-divider":86400,"x-view-unit":"days"},"device.media_ttl-nodefault":{"description":"The lifetime of device media files. The files will be automatically removed after specified amount of seconds.","format":"uint32","maximum":315360000,"minimum":86400,"title":"Media files TTL","type":"integer","x-view-divider":86400,"x-view-unit":"days"},"device.message":{"additionalProperties":true,"description":"Device message information","maxProperties":1000,"properties":{"timestamp":{"description":"UTC timestamp in seconds. Values below 1000000 are reserved for internal use.","minimum":1000000,"type":"number"}},"type":"object"},"device.message.filter":{"description":"Select only messages that correspond to the supplied filter. You can use flespi [expressions](https://flespi.com/kb/expressions) and reference device message parameters inside them.","maxLength":1024,"type":"string"},"device.messages":{"description":"Total number of messages received from device within last minute.","format":"uint32","type":"integer"},"device.messages.array":{"additionalItems":true,"items":{"$ref":"#/definitions/device.message"},"maxItems":1000,"minItems":1,"title":"array of device messages","type":"array"},"device.messages.get":{"description":"Optional filter for device messages retrieval","properties":{"count":{"default":10000000,"description":"limit number of messages 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 in form \"timestamp,*can*,position.*\".\nIf message does not contain all specified fields, it will be skipped.\n","maxLength":4096,"type":"string"},"filter":{"$ref":"#/definitions/device.message.filter"},"from":{"description":"UNIX timestamp of left time border for messages. Use 0 to ignore left bound.","minimum":0,"type":"number","x-view-type":"datetime"},"generalize":{"description":"Generalization interval. Only timestamps that are multiple to specified generalization interval will be returned with recalculated parameter values according to\nspecified generalization method. It may be possible that first returned timestamp will be less than specified 'from' timestamp if 'from' timestamp is not a multiple of generalization interval.\n\nAll numeriсal parameter values within the **generalization** interval will be calculated into one value according to the specified method. For non-numerical parameters, the first encountered value will be returned.\n","format":"uint32","maximum":1000000,"minimum":10,"type":"integer"},"method":{"default":"average","description":"Generalization method. Applicable only when valid generalize interval specified in request.\n\nThe methods for calculating numeric parameter values in the **generalized** message are as follows:\n * average – returns the average value within the generalization interval\n * minimum – returns the minimum value within the generalization interval\n * maximum – returns the maximum value within the generalization interval\n * summary – returns the sum of values within the generalization interval\n * difference – returns the sum of differences of a specific parameter value between each two consecutive messages within the generalization interval (can be used for sensors that record the cumulative value, e.g. motor hours counter or CAN mileage counter).\n","enum":["average","minimum","maximum","summary","difference"],"type":"string"},"reverse":{"default":false,"description":"time sorting parameter (true/false), use 'false' to list messages from end to beginning and 'true' to return them backwards - from latest to oldest","type":"boolean"},"to":{"description":"UNIX timestamp of right time border for messages. Use 0 to ignore right bound.","minimum":0,"type":"number","x-view-type":"datetime"}},"type":"object"},"device.messages_rotate":{"description":"Device messages circular buffer size, when size is larger than specified older messages will be auto-erased. In KB, zero value means messages rotation is disabled.","format":"uint32","maximum":10240000,"title":"Messages rotation size","type":"integer","x-view-divider":1024,"x-view-unit":"MB"},"device.messages_size":{"description":"Device messages size, including meta-data, in KB.","format":"uint32","type":"integer"},"device.messages_ttl-default":{"default":31536000,"description":"Device messages lifetime. Messages will be automatically removed after specified amount of seconds.","format":"uint32","maximum":315360000,"minimum":0,"title":"Messages TTL","type":"integer","x-view-divider":86400,"x-view-unit":"days"},"device.messages_ttl-nodefault":{"description":"Device messages lifetime. Messages will be automatically removed after specified amount of seconds.","format":"uint32","maximum":315360000,"minimum":0,"title":"Messages TTL","type":"integer","x-view-divider":86400,"x-view-unit":"days"},"device.name":{"description":"Name of the device","maxLength":255,"title":"Device name","type":"string"},"device.patch":{"description":"Device properties with corresponding new values to update. Will be applied for devices specified in REST API call selector.","properties":{"configuration":{"$ref":"#/definitions/device.configuration"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"enabled":{"$ref":"#/definitions/item.enabled"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata.patch"},"name":{"$ref":"#/definitions/device.name"}},"type":"object","x-view-order":["name","enabled","device_type_id","configuration","messages_ttl","messages_rotate","media_ttl","media_rotate","metadata"]},"device.plugins":{"description":"List of plugins assigned to the device.","items":{"$ref":"#/definitions/device.subitem"},"type":"array"},"device.plugins_count":{"description":"Number of plugins the device is assigned to","type":"integer"},"device.post":{"description":"Properties of device to create.","properties":{"configuration":{"$ref":"#/definitions/device.configuration"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"enabled":{"$ref":"#/definitions/item.enabled-default"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-default"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-default"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"}},"required":["device_type_id","configuration"],"type":"object","x-view-order":["name","enabled","device_type_id","configuration","messages_ttl","messages_rotate","media_ttl","media_rotate","metadata"]},"device.protocol_id":{"description":"Device protocol. In order flespi platform is able to communicate with this device you should have at least one channel that is working on the device type's protocol.\n","title":"Device protocol ID (mapped to device type ID)","type":"integer","x-view-dict":"protocols"},"device.protocol_name":{"description":"Device protocol name. In order flespi platform is able to communicate with this device you should have at least one channel that is working on the device type's protocol.\n","title":"Device protocol name.","type":"string"},"device.put":{"description":"Device properties with corresponding new values to update. Will be applied for devices specified in REST API call selector.","properties":{"configuration":{"$ref":"#/definitions/device.configuration"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"enabled":{"$ref":"#/definitions/item.enabled"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"}},"type":"object","x-view-order":["name","enabled","device_type_id","configuration","messages_ttl","messages_rotate","media_ttl","media_rotate","metadata"]},"device.settings":{"additionalProperties":true,"description":"Settings and their values available for device. Property key is setting name and property value is an object with 'current' and 'pending' keys that contain corresponding setting values.\nMore details on the setting object structure you can find in '#/definitions/setting' within this schema.\n","type":"object"},"device.streams":{"description":"List of streams the device is assigned to.","items":{"$ref":"#/definitions/device.subitem"},"type":"array"},"device.streams_count":{"description":"Number of streams the device is assigned to","type":"integer"},"device.subitem":{"description":"Reference to a subitem (group, plugin, stream, or calc) the device is assigned to. The 'fields' member is present when the assignment carries per-device subitem fields (e.g. plugin or calc configuration).","properties":{"fields":{"$ref":"#/definitions/subitem.fields"},"id":{"$ref":"#/definitions/item.id"},"name":{"$ref":"#/definitions/item.name"}},"type":"object"},"device.telemetry":{"additionalProperties":true,"description":"Device telemetry - last know values of each parameter received from device. Telemetry fields are updated automatically from messages with fresher timestamp.\nProperty key is telemetry field name and property value is telemetry field value. It corressponds to the lastest value of given parameter sent by device.\n","type":"object"},"device.telemetry.delete":{"properties":{"timestamp":{"description":"UNIX timestamp. Only telemetry fields wich modification UNIX timestamp is less than or equal to passed value will be deleted. Zero value will be converted to current time.","minimum":0,"type":"number","x-view-type":"datetime"}},"type":"object"},"device.traffic":{"description":"Total combined traffic generated by device connections within last minute, in bytes.","format":"uint32","type":"integer"},"device_type":{"description":"Device type information","properties":{"commands":{"description":"Collection of the commands available to execute for the device of that type","items":{"properties":{"address":{"description":"Ways to send command - through connection, sms etc.","items":{"enum":["connection","sms"],"type":"string"},"type":"array"},"examples":{"$ref":"#/definitions/command.examples"},"name":{"description":"Command name","type":"string"},"schema":{"description":"Command properties JSON schema.","type":"object"},"tab":{"description":"UI tab to display command or setting","type":"string"},"tags":{"description":"Tags for the command or setting","type":"object"}},"type":"object"},"type":"array"},"configuration":{"description":"Schema for device configuration. The configuration values are stored in devices of that device type.\n","type":"object"},"features":{"description":"Capability flags for this device type - the protocol-level flags plus device-type-specific ones.","properties":{"assistance":{"description":"Device type has indexed documentation available for AI assistance.","type":"boolean"},"media_commands":{"description":"Protocol supports media commands (request_video, take_photo, etc.).","type":"boolean"},"media_data":{"description":"Protocol can process media payloads (photos, video files).","type":"boolean"},"raw_packets":{"description":"Channel with this protocol can store raw traffic packets.","type":"boolean"},"shared_connection":{"description":"A single connection to the channel can be shared between multiple device idents.","type":"boolean"},"tacho_commands":{"description":"Protocol supports tachograph commands (request_tachograph_file).","type":"boolean"},"tls":{"description":"Protocol supports a TLS-secured transport.","type":"boolean"}},"type":"object"},"id":{"$ref":"#/definitions/device_type.id"},"name":{"description":"Device type name. Device type name is unique within its protocol","type":"string"},"protocol_id":{"description":"Protocol ID to which this device type is linked to","type":"integer"},"protocol_name":{"description":"Helper field with protocol name to which this device type is linked to","type":"string"},"settings":{"description":"Set of settings that can be used in devices of this type","items":{"properties":{"address":{"description":"Ways to update setting - through connection, sms etc.","items":{"enum":["connection","sms"],"type":"string"},"type":"array"},"mode":{"description":"Bitmask with setting read/write capabilities.\n0x0 - neither read/write is possible\n0x1 - it is possible to read current setting value from device\n0x2 - it is possible to write a new setting value into device\n","format":"uint32","type":"integer"},"name":{"description":"Setting short name.","type":"string"},"schema":{"description":"Setting properties JSON schema.","type":"object"}},"type":"object"},"type":"array"},"title":{"description":"Device type title that usually consists from protocol manufacturer name and device type","type":"string"}},"type":"object"},"device_type.id":{"description":"Unique device type ID","minimum":1,"type":"integer"},"device_types":{"properties":{"errors":{"description":"Errors occurred while processing the request","items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"Device types collection","items":{"$ref":"#/definitions/device_type"},"type":"array"}},"type":"object"},"devices":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Devices collection.","items":{"$ref":"#/definitions/device"},"type":"array"}},"type":"object"},"devices.commands-queue.array":{"items":{"$ref":"#/definitions/devices.commands-queue.item"},"type":"array"},"devices.commands-queue.item":{"description":"Queued command information","properties":{"command_id":{"$ref":"#/definitions/device.command.id"},"condition":{"$ref":"#/definitions/device.command.condition"},"device_id":{"$ref":"#/definitions/device.command.device_id"},"expires":{"$ref":"#/definitions/device.command.expires"},"id":{"$ref":"#/definitions/device.command.id"},"max_attempts":{"$ref":"#/definitions/device.command.max_attempts"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"priority":{"$ref":"#/definitions/item.priority-default"},"properties":{"$ref":"#/definitions/device.command.properties"},"timestamp":{"$ref":"#/definitions/device.command.timestamp"}},"type":"object"},"devices.commands-queue.post":{"anyOf":[{"properties":{"condition":{"$ref":"#/definitions/device.command.condition"},"max_attempts":{"$ref":"#/definitions/device.command.max_attempts"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"priority":{"$ref":"#/definitions/item.priority-default"},"properties":{"$ref":"#/definitions/device.command.properties"}},"required":["name","properties"],"title":"Schedule a command to run with a maximum expiration time.","type":"object","x-view-order":["name","properties","condition","priority","max_attempts","meta"]},{"properties":{"condition":{"$ref":"#/definitions/device.command.condition"},"expires":{"$ref":"#/definitions/device.command.expires"},"max_attempts":{"$ref":"#/definitions/device.command.max_attempts"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"priority":{"$ref":"#/definitions/item.priority-default"},"properties":{"$ref":"#/definitions/device.command.properties"}},"required":["name","properties","expires"],"title":"Schedule command execution with a precise expiration date.","type":"object","x-view-order":["name","properties","condition","priority","max_attempts","expires","meta"]},{"properties":{"condition":{"$ref":"#/definitions/device.command.condition"},"max_attempts":{"$ref":"#/definitions/device.command.max_attempts"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"priority":{"$ref":"#/definitions/item.priority-default"},"properties":{"$ref":"#/definitions/device.command.properties"},"ttl":{"description":"TTL of the scheduled command.","format":"uint32","maximum":2592000,"minimum":60,"type":"integer","x-view-divider":60,"x-view-unit":"min."}},"required":["name","properties","ttl"],"title":"Schedule command execution with TTL period.","type":"object","x-view-order":["name","properties","condition","priority","max_attempts","ttl","meta"]}]},"devices.commands.array":{"items":{"description":"Executed command.","properties":{"command_id":{"$ref":"#/definitions/device.command.id"},"condition":{"$ref":"#/definitions/device.command.condition"},"device_id":{"$ref":"#/definitions/device.command.device_id"},"executed":{"description":"Command execution status.","type":"boolean"},"id":{"$ref":"#/definitions/device.command.id"},"max_attempts":{"$ref":"#/definitions/device.command.max_attempts"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"priority":{"$ref":"#/definitions/item.priority-default"},"properties":{"$ref":"#/definitions/device.command.properties"},"response":{"description":"Response to the command by the device.","type":"object"},"timestamp":{"$ref":"#/definitions/device.command.timestamp"}},"type":"object"},"type":"array"},"devices.commands.executed":{"description":"Realtime device command execution result","properties":{"command_id":{"$ref":"#/definitions/device.command.id"},"device_id":{"$ref":"#/definitions/device.command.device_id"},"executed":{"description":"True when the command was executed by the device.","type":"boolean"},"id":{"$ref":"#/definitions/device.command.id"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"response":{"additionalProperties":true,"description":"Device response payload returned for the executed command.","type":"object"},"timestamp":{"description":"UNIX timestamp of command execution.","type":"number","x-view-type":"datetime"}},"type":"object"},"devices.commands.post":{"properties":{"condition":{"$ref":"#/definitions/device.command.condition"},"max_attempts":{"$ref":"#/definitions/device.command.max_attempts"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"priority":{"$ref":"#/definitions/item.priority-default"},"properties":{"$ref":"#/definitions/device.command.properties"},"timeout":{"$ref":"#/definitions/device.command.timeout"}},"required":["name","properties"],"title":"Realtime command over connected device","type":"object"},"devices.id":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"IDs collection.","items":{"$ref":"#/definitions/device.id"},"type":"array"}},"type":"object"},"devices.sms.any":{"properties":{"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"properties":{"$ref":"#/definitions/device.command.properties"}},"required":["name","properties"],"title":"SMS message command","type":"object"},"devices.sms.array":{"items":{"description":"Sent SMS.","properties":{"device_id":{"$ref":"#/definitions/device.command.device_id"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"properties":{"$ref":"#/definitions/device.command.properties"},"sent":{"description":"SMS status.","type":"boolean"},"text":{"description":"SMS message text. You can send it manually if message was not sent.","type":"string"},"type":{"description":"Message format is textual or binary.","enum":["text","hex"],"type":"string"}},"type":"object"},"type":"array"},"devices.telemetry":{"description":"Array with devices and their telemetry values","items":{"properties":{"id":{"$ref":"#/definitions/device.id"},"telemetry":{"$ref":"#/definitions/device.telemetry"}},"type":"object"},"type":"array"},"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"},"geofence":{"description":"geofence information","properties":{"blocked":{"$ref":"#/definitions/item.blocked"},"calcs":{"$ref":"#/definitions/subitems.array"},"calcs_count":{"description":"Number of calculators the geofence is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices":{"$ref":"#/definitions/subitems.array"},"devices_count":{"description":"Number of devices the geofence is assigned to","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"groups":{"$ref":"#/definitions/subitems.array"},"groups_count":{"description":"Number of groups the geofence is assigned to","type":"integer"},"id":{"$ref":"#/definitions/item.id"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"plugins":{"$ref":"#/definitions/subitems.array"},"plugins_count":{"description":"Number of plugins the geofence is assigned to","type":"integer"},"priority":{"$ref":"#/definitions/geofence.priority"},"streams":{"$ref":"#/definitions/subitems.array"},"streams_count":{"description":"Number of streams the geofence is assigned to","type":"integer"}},"type":"object"},"geofence.fields.shared":{"properties":{"blocked":{"$ref":"#/definitions/item.blocked"},"calcs":{"$ref":"#/definitions/subitems.array"},"calcs_count":{"description":"Number of calculators the geofence is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices":{"$ref":"#/definitions/subitems.array"},"devices_count":{"description":"Number of devices the geofence is assigned to","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"groups":{"$ref":"#/definitions/subitems.array"},"groups_count":{"description":"Number of groups the geofence is assigned to","type":"integer"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"plugins":{"$ref":"#/definitions/subitems.array"},"plugins_count":{"description":"Number of plugins the geofence is assigned to","type":"integer"},"priority":{"$ref":"#/definitions/geofence.priority"},"streams":{"$ref":"#/definitions/subitems.array"},"streams_count":{"description":"Number of streams the geofence is assigned to","type":"integer"}},"type":"object"},"geofence.geometry":{"anyOf":[{"$ref":"#/definitions/geofence.geometry.circle"},{"$ref":"#/definitions/geofence.geometry.polygon"},{"$ref":"#/definitions/geofence.geometry.corridor"}],"x-key-property":"type"},"geofence.geometry.circle":{"description":"Circular region","properties":{"center":{"$ref":"#/definitions/container.interval.geofence.coordinate"},"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","center","radius"],"x-view-type":"geofence"},"geofence.geometry.corridor":{"description":"Corridor of certain width that consists from multiple sequentially connected points","properties":{"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","width","path"],"x-view-type":"geofence"},"geofence.geometry.polygon":{"description":"Area enclosed by a closed path","properties":{"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","path"],"x-view-type":"geofence"},"geofence.post":{"properties":{"enabled":{"$ref":"#/definitions/item.enabled-default"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"default":0,"description":"Geofence order. The high priority geofence is returned first.","maximum":100,"minimum":0,"type":"integer"}},"required":["name","geometry"],"title":"Geofence","type":"object","x-view-order":["name","priority","enabled","geometry","metadata"]},"geofence.priority":{"description":"Geofence order. The high priority geofence is returned first.","maximum":100,"minimum":0,"type":"integer"},"geofence.subitem.put":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"}},"type":"object"},"geofences.post":{"items":{"$ref":"#/definitions/geofence.post"},"maxItems":128,"minItems":1,"title":"Geofences array","type":"array"},"geofences.put":{"properties":{"enabled":{"$ref":"#/definitions/item.enabled"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"$ref":"#/definitions/geofence.priority"}},"type":"object","x-view-order":["name","priority","enabled","geometry","metadata"]},"geofences.result":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Geofences collection.","items":{"$ref":"#/definitions/geofence"},"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"},"group":{"description":"group information","properties":{"blocked":{"$ref":"#/definitions/item.blocked"},"calcs_count":{"$ref":"#/definitions/group.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"$ref":"#/definitions/group.devices_count"},"geofences_count":{"$ref":"#/definitions/group.geofences_count"},"id":{"$ref":"#/definitions/group.id"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/group.name"},"plugins_count":{"$ref":"#/definitions/group.plugins_count"},"streams_count":{"$ref":"#/definitions/group.streams_count"}},"type":"object"},"group.asset":{"description":"information about asset inside group","properties":{"active":{"$ref":"#/definitions/asset.interval"},"asset_id":{"$ref":"#/definitions/item.id"},"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs_count":{"description":"number of calculators this asset is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"description":"ID of the device currently linked to the asset.","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/subitem.fields"},"group_id":{"$ref":"#/definitions/item.id"},"groups_count":{"description":"number of groups this asset is assigned to","type":"integer"},"intervals_ttl":{"$ref":"#/definitions/asset.intervals_ttl"},"last":{"$ref":"#/definitions/asset.interval"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"priority":{"$ref":"#/definitions/item.priority"},"size":{"description":"Storage used by the asset's intervals, in KB.","type":"integer"}},"type":"object"},"group.assets":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Group assets collection","items":{"$ref":"#/definitions/group.asset"},"type":"array"}},"type":"object"},"group.calcs_count":{"description":"Number of calculators assigned to the group","type":"integer"},"group.device":{"description":"information about device inside group","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/device.blocked"},"calcs":{"$ref":"#/definitions/device.calcs"},"calcs_count":{"$ref":"#/definitions/device.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"commands":{"$ref":"#/definitions/device.commands"},"commands_queue":{"$ref":"#/definitions/device.commands_queue"},"configuration":{"$ref":"#/definitions/device.configuration"},"connected":{"$ref":"#/definitions/device.connected"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"$ref":"#/definitions/device.id"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"device_type_name":{"$ref":"#/definitions/device.device_type_name"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/group.device.fields"},"geofences_count":{"$ref":"#/definitions/device.geofences_count"},"group_id":{"$ref":"#/definitions/group.id"},"groups":{"$ref":"#/definitions/device.groups"},"groups_count":{"$ref":"#/definitions/device.groups_count"},"intervals_size":{"$ref":"#/definitions/device.intervals_size"},"last_active":{"$ref":"#/definitions/device.last_active"},"media_blocked":{"$ref":"#/definitions/device.media_blocked"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_size":{"$ref":"#/definitions/device.media_size"},"media_traffic":{"$ref":"#/definitions/device.media_traffic"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages":{"$ref":"#/definitions/device.messages"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_size":{"$ref":"#/definitions/device.messages_size"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"},"plugins":{"$ref":"#/definitions/device.plugins"},"plugins_count":{"$ref":"#/definitions/device.plugins_count"},"protocol_id":{"$ref":"#/definitions/device.protocol_id"},"protocol_name":{"$ref":"#/definitions/device.protocol_name"},"settings":{"$ref":"#/definitions/device.settings"},"streams":{"$ref":"#/definitions/device.streams"},"streams_count":{"$ref":"#/definitions/device.streams_count"},"telemetry":{"$ref":"#/definitions/device.telemetry"},"traffic":{"$ref":"#/definitions/device.traffic"}},"type":"object"},"group.device.fields":{"additionalProperties":true,"description":"Item fields.","type":"object"},"group.device_type":{"description":"Item type, see [platform logs](https://flespi.io/docs/#/platform/logs). Currently only gw/devices is allowed for the item type.","enum":[11],"type":"integer","x-view-enum-labels":["gw/devices"]},"group.devices":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Items collection","items":{"$ref":"#/definitions/group.device"},"type":"array"}},"type":"object"},"group.devices_count":{"description":"Number of devices assigned to the group","type":"integer"},"group.fields.shared":{"properties":{"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/group.name"}},"type":"object"},"group.geofence":{"description":"information about geofence inside group","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs":{"$ref":"#/definitions/subitems.array"},"calcs_count":{"description":"Number of calculators the geofence is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices":{"$ref":"#/definitions/subitems.array"},"devices_count":{"description":"Number of devices the geofence is assigned to","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/subitem.fields"},"geofence_id":{"$ref":"#/definitions/item.id"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"group_id":{"$ref":"#/definitions/item.id"},"groups":{"$ref":"#/definitions/subitems.array"},"groups_count":{"description":"Number of groups the geofence is assigned to","type":"integer"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"plugins":{"$ref":"#/definitions/subitems.array"},"plugins_count":{"description":"Number of plugins the geofence is assigned to","type":"integer"},"priority":{"$ref":"#/definitions/geofence.priority"},"streams":{"$ref":"#/definitions/subitems.array"},"streams_count":{"description":"Number of streams the geofence is assigned to","type":"integer"}},"type":"object"},"group.geofences":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Group geofences collection","items":{"$ref":"#/definitions/group.geofence"},"type":"array"}},"type":"object"},"group.geofences_count":{"description":"Number of geofences assigned to the group","type":"integer"},"group.id":{"description":"Group unique ID.","minimum":1,"type":"integer","x-flespi-acl":"gw/groups","x-view-selector":"groups"},"group.name":{"description":"Group name","maxLength":255,"minLength":1,"type":"string"},"group.plugins_count":{"description":"Number of plugins assigned to the group","type":"integer"},"group.post":{"properties":{"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/group.name"}},"required":["name"],"title":"Group","type":"object","x-view-order":["name","metadata"]},"group.streams_count":{"description":"Number of streams assigned to the group","type":"integer"},"groups.post":{"items":{"$ref":"#/definitions/group.post"},"maxItems":16,"minItems":1,"title":"Groups array","type":"array"},"groups.put":{"properties":{"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/group.name"}},"type":"object","x-view-order":["name","metadata"]},"groups.result":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Groups collection.","items":{"$ref":"#/definitions/group"},"type":"array"}},"type":"object"},"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"},"media.file":{"properties":{"created":{"$ref":"#/definitions/media.file.created"},"meta":{"$ref":"#/definitions/media.file.meta"},"mime":{"$ref":"#/definitions/media.file.mime"},"modified":{"$ref":"#/definitions/media.file.modified"},"name":{"$ref":"#/definitions/media.file.name"},"protected":{"$ref":"#/definitions/media.file.protected"},"shared":{"$ref":"#/definitions/media.file.shared"},"size":{"$ref":"#/definitions/media.file.size"},"uploaded":{"$ref":"#/definitions/media.file.uploaded"},"uuid":{"$ref":"#/definitions/media.file.uuid"}},"title":"device media file information","type":"object"},"media.file.created":{"description":"Time when file was created, UNIX timestamp","minimum":0,"type":"number","x-view-type":"datetime"},"media.file.meta":{"anyOf":[{"$ref":"#/definitions/media.file.meta.type-image"},{"$ref":"#/definitions/media.file.meta.type-video"},{"$ref":"#/definitions/media.file.meta.type-tacho"}],"description":"Additional file information. Actual attributes depend on media file type."},"media.file.meta.channel":{"description":"Camera channel number","type":"number"},"media.file.meta.command_id":{"description":"ID of command sent to request media file","type":"number"},"media.file.meta.height":{"description":"Picture frame height","type":"number"},"media.file.meta.path":{"description":"Uploaded media file path","type":"string"},"media.file.meta.type-image":{"properties":{"channel":{"$ref":"#/definitions/media.file.meta.channel"},"command_id":{"$ref":"#/definitions/media.file.meta.command_id"},"height":{"$ref":"#/definitions/media.file.meta.height"},"path":{"$ref":"#/definitions/media.file.meta.path"},"type":{"const":"image","description":"type: \"image\" indicates image file","readOnly":true,"type":"string"},"width":{"$ref":"#/definitions/media.file.meta.width"}},"title":"Image file","type":"object"},"media.file.meta.type-tacho":{"properties":{"command_id":{"$ref":"#/definitions/media.file.meta.command_id"},"driver_first_name":{"description":"driver first name","type":"string"},"driver_id":{"description":"driver identification number","type":"string"},"driver_last_name":{"description":"driver last name","type":"string"},"plate_number":{"description":"vehicle plate number","type":"string"},"region":{"description":"region code","type":"string"},"type":{"const":"tacho","description":"type: \"tacho\" indicates tacho DDD file","readOnly":true,"type":"string"},"vin":{"description":"vehicle identification number","type":"string"}},"title":"Tacho file","type":"object"},"media.file.meta.type-video":{"properties":{"channel":{"$ref":"#/definitions/media.file.meta.channel"},"command_id":{"$ref":"#/definitions/media.file.meta.command_id"},"duration":{"description":"Video duration in seconds","type":"number"},"has_audio":{"description":"Audio track presence flag","type":"boolean"},"height":{"$ref":"#/definitions/media.file.meta.height"},"path":{"$ref":"#/definitions/media.file.meta.path"},"type":{"const":"video","description":"type: \"video\" indicates video file","readOnly":true,"type":"string"},"video_codec":{"description":"Video codec","type":"string"},"width":{"$ref":"#/definitions/media.file.meta.width"}},"title":"Video file","type":"object"},"media.file.meta.width":{"description":"Picture frame width","type":"number"},"media.file.mime":{"description":"MIME file type","maxLength":128,"minLength":3,"type":"string"},"media.file.modified":{"description":"Time when file data was modified, UNIX timestamp","minimum":0,"type":"number","x-view-type":"datetime"},"media.file.name":{"description":"file name, set during upload","maxLength":512,"minLength":1,"type":"string"},"media.file.post":{"anyOf":[{"$ref":"#/definitions/media.file.post.type-video"},{"$ref":"#/definitions/media.file.post.type-image"},{"$ref":"#/definitions/media.file.post.type-tacho"}],"description":"upload file options"},"media.file.post.type-image":{"properties":{"message_params":{"additionalProperties":true,"description":"Additional parameters to be attached to messages generated by uploaded media file","maxProperties":1000,"type":"object"},"meta":{"description":"Additional file information","properties":{"channel":{"description":"camera channel number","type":"number"},"created":{"$ref":"#/definitions/media.file.created"},"name":{"description":"file name","type":"string"},"path":{"description":"file path on device","type":"string"}},"type":"object"},"params":{"$ref":"#/definitions/media.files.params"},"type":{"const":"image","default":"image","readOnly":true,"type":"string"}},"required":["type"],"title":"Image file upload","type":"object"},"media.file.post.type-tacho":{"properties":{"message_params":{"additionalProperties":true,"description":"Additional parameters to be attached to messages generated by uploaded media file","maxProperties":1000,"type":"object"},"meta":{"description":"Additional file information","properties":{"created":{"$ref":"#/definitions/media.file.created"},"driver_first_name":{"description":"driver first name","type":"string"},"driver_id":{"description":"driver identification number","type":"string"},"driver_last_name":{"description":"driver last name","type":"string"},"name":{"description":"file name","type":"string"},"plate_number":{"description":"vehicle plate number","type":"string"},"region":{"description":"region code","type":"string"},"vin":{"description":"vehicle identification number","type":"string"}},"type":"object"},"params":{"$ref":"#/definitions/media.files.params"},"type":{"const":"tacho","default":"tacho","readOnly":true,"type":"string"}},"required":["type"],"title":"Tacho file upload","type":"object"},"media.file.post.type-video":{"properties":{"message_params":{"additionalProperties":true,"description":"Additional parameters to be attached to messages generated by uploaded media file","maxProperties":1000,"type":"object"},"meta":{"description":"Additional file information","properties":{"channel":{"description":"camera channel number","type":"number"},"created":{"$ref":"#/definitions/media.file.created"},"name":{"description":"file name","type":"string"},"path":{"description":"file path on device","type":"string"}},"type":"object"},"params":{"$ref":"#/definitions/media.files.params"},"type":{"const":"video","default":"video","readOnly":true,"type":"string"}},"required":["type"],"title":"Video file upload","type":"object"},"media.file.protected":{"description":"Protection attribute for the file to prevent it from automatic deletion by ttl or rotate","type":"boolean"},"media.file.shared":{"description":"If set to true - file is available via public link with UUID inside.","type":"boolean"},"media.file.size":{"description":"file size in bytes","minimum":0,"type":"integer"},"media.file.update":{"description":"file update specification","properties":{"params":{"$ref":"#/definitions/media.files.params"},"protected":{"$ref":"#/definitions/media.file.protected"},"uuid":{"$ref":"#/definitions/media.file.uuid"}},"required":["uuid"],"type":"object"},"media.file.uploaded":{"description":"Time when file was uploaded, UNIX timestamp","minimum":0,"type":"number","x-view-type":"datetime"},"media.file.uuid":{"description":"file UUID, this is unique global media file identificator","maxLength":64,"minLength":64,"pattern":"^[0-9A-F]+$","type":"string"},"media.files.delete":{"description":"file deletion specification","properties":{"filter":{"$ref":"#/definitions/media.files.filter"},"uuid":{"$ref":"#/definitions/media.file.uuid"}},"type":"object"},"media.files.fields":{"description":"Output only selected fields per each listed file.\n","maxLength":4096,"type":"string"},"media.files.filter":{"description":"Any arbitrary expression to select files based on their properties. You can use flespi [expressions](https://flespi.com/kb/expressions) and reference media file parameters inside them.\n","format":"expression","maxLength":1024,"type":"string"},"media.files.list":{"description":"file selection specification","properties":{"fields":{"$ref":"#/definitions/media.files.fields"},"filter":{"$ref":"#/definitions/media.files.filter"},"uuid":{"$ref":"#/definitions/media.file.uuid"}},"type":"object"},"media.files.params":{"additionalProperties":true,"description":"Any extra parameters that you want to attach to media file to be used in listing and deletion operations.\nFew parameter names are reserved to be used by media internaly: uuid, name, size, mime, created, modified, uploaded, modified, protected, shared\n","maxProperties":100,"type":"object"},"media.files.result":{"properties":{"result":{"items":{"$ref":"#/definitions/media.file"},"title":"array of files information","type":"array"}},"type":"object"},"media.files.upload.result":{"properties":{"result":{"items":{"$ref":"#/definitions/media.file"},"title":"array of uploaded files information","type":"array"}},"type":"object"},"message_parameter":{"description":"Message parameter information","properties":{"id":{"$ref":"#/definitions/message_parameter.id"},"info":{"$ref":"#/definitions/message_parameter.info"},"name":{"$ref":"#/definitions/message_parameter.name"},"sources":{"$ref":"#/definitions/message_parameter.sources"},"type":{"$ref":"#/definitions/message_parameter.type"},"unit":{"$ref":"#/definitions/message_parameter.unit"}},"type":"object"},"message_parameter.id":{"description":"Message parameter unique index.","minimum":1,"type":"integer"},"message_parameter.info":{"description":"Message parameter description.","type":"string"},"message_parameter.name":{"description":"Message parameter unique name.","type":"string"},"message_parameter.sources":{"description":"Message parameter sources - various protocol-specific sources like AVL IDs or packet types from which given parameter appears in the message.\nThis field is used to identify protocol-specific origins from which given parameter is sourced.\n","items":{"type":"string"},"type":"array"},"message_parameter.type":{"description":"Message parameter type - double, boolean, string etc.","type":"string"},"message_parameter.unit":{"description":"Message parameter measurments unit.","type":"string"},"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"},"modem":{"description":"modem information","properties":{"blocked":{"$ref":"#/definitions/modem.blocked"},"cid":{"$ref":"#/definitions/item.cid"},"configuration":{"$ref":"#/definitions/modem.configuration-nodefault"},"connected":{"$ref":"#/definitions/modem.connected"},"created":{"$ref":"#/definitions/item.btime"},"enabled":{"$ref":"#/definitions/item.enabled"},"id":{"$ref":"#/definitions/modem.id"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/modem.name"},"priority":{"$ref":"#/definitions/modem.priority-nodefault"}},"type":"object"},"modem.blocked":{"description":"Active block code for modem.","format":"uint32","type":"integer"},"modem.configuration-default":{"anyOf":[{"$ref":"#/definitions/modem.configuration.flespi"},{"$ref":"#/definitions/modem.configuration.clickatell"},{"$ref":"#/definitions/modem.configuration.smpp-default"},{"$ref":"#/definitions/modem.configuration.jasper"},{"$ref":"#/definitions/modem.configuration.pod-iot-suite"},{"$ref":"#/definitions/modem.configuration.one_nce"}],"x-key-property":"protocol"},"modem.configuration-nodefault":{"anyOf":[{"$ref":"#/definitions/modem.configuration.flespi"},{"$ref":"#/definitions/modem.configuration.clickatell"},{"$ref":"#/definitions/modem.configuration.smpp-nodefault"},{"$ref":"#/definitions/modem.configuration.jasper"},{"$ref":"#/definitions/modem.configuration.pod-iot-suite"},{"$ref":"#/definitions/modem.configuration.one_nce"}],"x-key-property":"protocol"},"modem.configuration.clickatell":{"properties":{"api_key":{"description":"Clickatell API key SMS integration","maxLength":255,"minLength":1,"type":"string"},"protocol":{"const":"clickatell","default":"clickatell","description":"Clickatell SMS integration via REST API: https://www.clickatell.com/developers/api-documentation/rest-api-send-message/\nIn order to use it, please register clickatell account and create REST API integration (please not use HTTP API, only REST API is supported).\n\nModem can send SMS only if device specifies phone_number in international format (starts with '+') within its configuration field.\n","readOnly":true,"type":"string"}},"required":["protocol","api_key"],"title":"clickatell","type":"object","x-view-order":["protocol","api_key"]},"modem.configuration.flespi":{"properties":{"protocol":{"const":"flespi","default":"flespi","description":"Send SMS messages through flespi built-in modem. Only limited quantity of SMS messages can be send, see [pricing](https://flespi.com/pricing) for details.\n\nModem can send SMS only if device specifies phone_number in international format (starts with '+') within its configuration field.\n","readOnly":true,"type":"string"}},"required":["protocol"],"title":"flespi","type":"object","x-view-order":["protocol"]},"modem.configuration.jasper":{"properties":{"api_key":{"description":"Each user with Jasper API access has a unique API key that they must use in the function calls. You can generate it on the User Profile or User Details page.","maxLength":255,"minLength":1,"type":"string"},"host":{"description":"Host to send requests to. E.g. https://restapi1.jasper.com","maxLength":255,"minLength":10,"pattern":"^https?:\\/\\/[-a-zA-Z0-9@:%._\\+~#=/]+","type":"string"},"protocol":{"const":"jasper","default":"jasper","description":"To send Jasper formatted API calls.\n\nModem can send SMS only if device specifies phone_number as ICCID within its configuration field.\n","readOnly":true,"type":"string"},"username":{"description":"Username used to log in to Jasper account. base64 encoded \"username:api_key\" is used as Basic Authorization token in HTTP API requests to Jasper.","maxLength":255,"minLength":1,"type":"string"}},"required":["protocol","api_key","username","host"],"title":"jasper","type":"object","x-view-order":["protocol","api_key","username","host"]},"modem.configuration.one_nce":{"properties":{"password":{"description":"1NCE API password SMS integration","maxLength":255,"minLength":1,"type":"string","x-view-type":"password"},"protocol":{"const":"one_nce","default":"one_nce","description":"1NCE SMS integration via REST API: https://help.1nce.com/dev-hub/docs/examples-mt-sms\nIn order to use it, please register 1NCE account and create REST API integration (please not use HTTP API, only REST API is supported).\n\nModem can send SMS only if device specifies phone_number as ICCID within its configuration field.\n","readOnly":true,"type":"string"},"source_address":{"description":"Sender address/phone number, is used for validation of the SMS source","maxLength":255,"minLength":1,"type":"string"},"uri":{"default":"https://api.1nce.com","description":"1NCE API server URI","maxLength":255,"minLength":1,"type":"string"},"username":{"description":"1NCE API username SMS integration","maxLength":255,"minLength":1,"type":"string"}},"required":["protocol","uri","username","password"],"title":"1NCE","type":"object","x-view-order":["protocol","uri","username","password","source_address"]},"modem.configuration.pod-iot-suite":{"properties":{"account_id":{"description":"POD IoT Suite Account ID","maxLength":255,"minLength":1,"type":"string"},"host":{"description":"Host to send requests to. E.g. https://api.podiotsuite.com","maxLength":255,"minLength":10,"pattern":"^https?:\\/\\/[-a-zA-Z0-9@:%._\\+~#=/]+","type":"string"},"protocol":{"const":"pod_iot_suite","default":"pod_iot_suite","description":"POD IoT Suite SMS integration via REST API: https://api.podiotsuite.com/v3/docs/swagger/index.html\n\nModem can send SMS only if device specifies phone_number as ICCID within its configuration field.\n","readOnly":true,"type":"string"},"token":{"description":"POD IoT Suite API access token","maxLength":255,"minLength":1,"type":"string"}},"required":["protocol","token","account_id","host"],"title":"POD IoT Suite","type":"object","x-view-order":["protocol","token","account_id","host"]},"modem.configuration.smpp-base":{"required":["protocol","uri","username","password"],"title":"smpp","type":"object","x-view-order":["protocol","uri","ssl","username","password","source_addr","timeout","coding"]},"modem.configuration.smpp-common-properties":{"coding":{"default":"UCS2","description":"Data coding type for outgoung SMS messages","enum":["UCS2","ASCII"],"type":"string"},"password":{"description":"Authorization password.","maxLength":255,"type":"string","x-view-type":"password"},"protocol":{"const":"smpp","default":"smpp","description":"SMPP gateway. Use SMPP modem to connect to any SMS gateway provider with SMPP protocol and send unlimited quantity of SMS messages.\n\nModem can send SMS only if device specifies phone_number in international format (starts with '+') within its configuration field.\n","readOnly":true,"type":"string"},"source_addr":{"description":"Source address for outgoung SMS messages.","maxLength":255,"type":"string"},"ssl":{"description":"Use SSL connection to the SMPP server","type":"boolean"},"uri":{"description":"IP or DNS hostname + port (usually 2775 is used) of the SMPP-server","maxLength":255,"pattern":"^[\\w\\.\\-]+:\\d+$","type":"string","x-schema-errors":{"pattern":"invalid uri format"}},"username":{"description":"Authorization username.","maxLength":255,"minLength":1,"type":"string"}},"modem.configuration.smpp-default":{"properties":{"coding":{"default":"UCS2","description":"Data coding type for outgoung SMS messages","enum":["UCS2","ASCII"],"type":"string"},"password":{"description":"Authorization password.","maxLength":255,"type":"string","x-view-type":"password"},"protocol":{"const":"smpp","default":"smpp","description":"SMPP gateway. Use SMPP modem to connect to any SMS gateway provider with SMPP protocol and send unlimited quantity of SMS messages.\n\nModem can send SMS only if device specifies phone_number in international format (starts with '+') within its configuration field.\n","readOnly":true,"type":"string"},"source_addr":{"description":"Source address for outgoung SMS messages.","maxLength":255,"type":"string"},"ssl":{"description":"Use SSL connection to the SMPP server","type":"boolean"},"timeout":{"$ref":"#/definitions/modem.configuration.smpp.timeout-default"},"uri":{"description":"IP or DNS hostname + port (usually 2775 is used) of the SMPP-server","maxLength":255,"pattern":"^[\\w\\.\\-]+:\\d+$","type":"string","x-schema-errors":{"pattern":"invalid uri format"}},"username":{"description":"Authorization username.","maxLength":255,"minLength":1,"type":"string"}},"required":["protocol","uri","username","password"],"title":"smpp","type":"object","x-view-order":["protocol","uri","ssl","username","password","source_addr","timeout","coding"]},"modem.configuration.smpp-nodefault":{"properties":{"coding":{"default":"UCS2","description":"Data coding type for outgoung SMS messages","enum":["UCS2","ASCII"],"type":"string"},"password":{"description":"Authorization password.","maxLength":255,"type":"string","x-view-type":"password"},"protocol":{"const":"smpp","default":"smpp","description":"SMPP gateway. Use SMPP modem to connect to any SMS gateway provider with SMPP protocol and send unlimited quantity of SMS messages.\n\nModem can send SMS only if device specifies phone_number in international format (starts with '+') within its configuration field.\n","readOnly":true,"type":"string"},"source_addr":{"description":"Source address for outgoung SMS messages.","maxLength":255,"type":"string"},"ssl":{"description":"Use SSL connection to the SMPP server","type":"boolean"},"timeout":{"$ref":"#/definitions/modem.configuration.smpp.timeout-nodefault"},"uri":{"description":"IP or DNS hostname + port (usually 2775 is used) of the SMPP-server","maxLength":255,"pattern":"^[\\w\\.\\-]+:\\d+$","type":"string","x-schema-errors":{"pattern":"invalid uri format"}},"username":{"description":"Authorization username.","maxLength":255,"minLength":1,"type":"string"}},"required":["protocol","uri","username","password"],"title":"smpp","type":"object","x-view-order":["protocol","uri","ssl","username","password","source_addr","timeout","coding"]},"modem.configuration.smpp.timeout-default":{"default":20,"description":"SMPP send message timeout","maximum":60,"minimum":10,"type":"integer"},"modem.configuration.smpp.timeout-nodefault":{"description":"SMPP send message timeout","maximum":60,"minimum":10,"type":"integer"},"modem.connected":{"description":"Current modem status. If true - modem is active and ready to deliver SMS messages.","type":"boolean"},"modem.id":{"description":"Modem's unique ID.","type":"integer"},"modem.name":{"description":"Modem's name.","maxLength":255,"minLength":1,"type":"string"},"modem.post":{"properties":{"configuration":{"$ref":"#/definitions/modem.configuration-default"},"enabled":{"$ref":"#/definitions/item.enabled-default"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/modem.name"},"priority":{"$ref":"#/definitions/modem.priority-default"}},"required":["name","configuration"],"type":"object","x-view-order":["name","enabled","priority","configuration","metadata"]},"modem.priority-default":{"default":5,"description":"Modem priority, used for selecting modem for SMS dispatching. Higher priority modem will be used first.","maximum":10,"minimum":0,"type":"integer"},"modem.priority-nodefault":{"description":"Modem priority, used for selecting modem for SMS dispatching. Higher priority modem will be used first.","maximum":10,"minimum":0,"type":"integer"},"modem.put":{"properties":{"configuration":{"$ref":"#/definitions/modem.configuration-nodefault"},"enabled":{"$ref":"#/definitions/item.enabled"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/modem.name"},"priority":{"$ref":"#/definitions/modem.priority-nodefault"}},"type":"object","x-view-order":["name","enabled","priority","configuration","metadata"]},"modems.id":{"properties":{"result":{"description":"ID's collection.","items":{"description":"elements ID.","type":"integer"},"type":"array"}},"type":"object"},"modems.result":{"properties":{"result":{"description":"modems collection. returned data according to 'fields' parameter.","items":{"$ref":"#/definitions/modem"},"type":"array"}},"type":"object"},"plugin":{"description":"plugin information","properties":{"blocked":{"$ref":"#/definitions/plugin.blocked"},"cid":{"$ref":"#/definitions/item.cid"},"configuration":{"$ref":"#/definitions/plugin.configuration"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"description":"Number of devices assigned to the plugin","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"geofences_count":{"description":"Number of geofences assigned to the plugin","type":"integer"},"groups_count":{"description":"Number of groups assigned to the plugin","type":"integer"},"id":{"$ref":"#/definitions/plugin.id"},"item_schema":{"$ref":"#/definitions/plugin.item_schema"},"item_type":{"$ref":"#/definitions/plugin.item_type"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/plugin.name"},"priority":{"$ref":"#/definitions/plugin.priority"},"required":{"$ref":"#/definitions/plugin.required"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"type_id":{"$ref":"#/definitions/plugin.type_id"},"type_name":{"$ref":"#/definitions/plugin.type_name"},"validate_message":{"$ref":"#/definitions/plugin.validate_message"}},"type":"object"},"plugin-type":{"description":"plugin type information","properties":{"changelog":{"$ref":"#/definitions/plugin-type.changelog"},"configuration":{"$ref":"#/definitions/plugin-type.configuration"},"description":{"$ref":"#/definitions/plugin-type.description"},"id":{"$ref":"#/definitions/plugin-type.id"},"item_types":{"$ref":"#/definitions/plugin-type.item_types"},"name":{"$ref":"#/definitions/plugin-type.name"}},"type":"object"},"plugin-type.changelog":{"description":"Link to the plugin type changelog. New changelog posts are re-published into 'flespi/message/gw/plugin-types/{id}/changelog' MQTT topic and accumulated in the platform, available with 'GET /gw/plugin-types/{id}/changelog-posts' request.","type":"string"},"plugin-type.configuration":{"description":"Plugin type configuration","type":"object"},"plugin-type.description":{"description":"Plugin type description","type":"string"},"plugin-type.id":{"description":"Plugin type id","type":"integer"},"plugin-type.item_types":{"description":"Item types to which this plugin type can be applied. 'gw/devices' means that plugin can be applied to devices.","type":"array"},"plugin-type.name":{"description":"Unique plugin type name","minLength":1,"type":"string"},"plugin-types":{"properties":{"errors":{"description":"Errors list.","items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"Plugin types collection","items":{"$ref":"#/definitions/plugin-type"},"type":"array"}},"type":"object"},"plugin.blocked":{"description":"Active block code for plugin. Zero code means plugin is not blocked and ready to process messages.","format":"uint32","type":"integer"},"plugin.configuration":{"additionalProperties":true,"description":"Plugin configuration according to the plugin type. Each plugin type defines own schema for configuration field, you may retrieve it with [GET /gw/plugin-types/all](https://flespi.io/docs/#/gw/protocols/get_plugin_types_plugin_types_selector) API call.","type":"object","x-view-schema":"plugin_configuration"},"plugin.device":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/device.blocked"},"calcs":{"$ref":"#/definitions/device.calcs"},"calcs_count":{"$ref":"#/definitions/device.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"commands":{"$ref":"#/definitions/device.commands"},"commands_queue":{"$ref":"#/definitions/device.commands_queue"},"configuration":{"$ref":"#/definitions/device.configuration"},"connected":{"$ref":"#/definitions/device.connected"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"$ref":"#/definitions/device.id"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"device_type_name":{"$ref":"#/definitions/device.device_type_name"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/plugin.device.fields"},"geofences_count":{"$ref":"#/definitions/device.geofences_count"},"groups":{"$ref":"#/definitions/device.groups"},"groups_count":{"$ref":"#/definitions/device.groups_count"},"intervals_size":{"$ref":"#/definitions/device.intervals_size"},"last_active":{"$ref":"#/definitions/device.last_active"},"media_blocked":{"$ref":"#/definitions/device.media_blocked"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_size":{"$ref":"#/definitions/device.media_size"},"media_traffic":{"$ref":"#/definitions/device.media_traffic"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages":{"$ref":"#/definitions/device.messages"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_size":{"$ref":"#/definitions/device.messages_size"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"},"plugin_id":{"$ref":"#/definitions/plugin.id"},"plugins":{"$ref":"#/definitions/device.plugins"},"plugins_count":{"$ref":"#/definitions/device.plugins_count"},"protocol_id":{"$ref":"#/definitions/device.protocol_id"},"protocol_name":{"$ref":"#/definitions/device.protocol_name"},"settings":{"$ref":"#/definitions/device.settings"},"streams":{"$ref":"#/definitions/device.streams"},"streams_count":{"$ref":"#/definitions/device.streams_count"},"telemetry":{"$ref":"#/definitions/device.telemetry"},"traffic":{"$ref":"#/definitions/device.traffic"}},"type":"object"},"plugin.device.fields":{"additionalProperties":true,"description":"Device fields.","type":"object"},"plugin.device.put":{"anyOf":[{"properties":{"fields":{"additionalProperties":true,"description":"Device fields.","type":"object"}},"title":"Fields list","type":"object"},{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"}},"title":"Group control","type":"object"}]},"plugin.devices":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Devices collection","items":{"$ref":"#/definitions/plugin.device"},"type":"array"}},"type":"object"},"plugin.devices.post":{"properties":{"fields":{"additionalProperties":true,"default":{},"description":"Device fields.","type":"object"}},"type":"object","x-view-order":["fields"]},"plugin.fields.shared":{"properties":{"blocked":{"$ref":"#/definitions/plugin.blocked"},"configuration":{"$ref":"#/definitions/plugin.configuration"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"description":"Number of devices assigned to the plugin","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"geofences_count":{"description":"Number of geofences assigned to the plugin","type":"integer"},"groups_count":{"description":"Number of groups assigned to the plugin","type":"integer"},"item_type":{"$ref":"#/definitions/plugin.item_type"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/plugin.name"},"priority":{"$ref":"#/definitions/plugin.priority"},"required":{"$ref":"#/definitions/plugin.required"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"type_id":{"$ref":"#/definitions/plugin.type_id"},"type_name":{"$ref":"#/definitions/plugin.type_name"},"validate_message":{"$ref":"#/definitions/plugin.validate_message"}},"type":"object"},"plugin.geofence":{"description":"information about geofence inside plugin","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs":{"$ref":"#/definitions/subitems.array"},"calcs_count":{"description":"Number of calculators the geofence is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices":{"$ref":"#/definitions/subitems.array"},"devices_count":{"description":"Number of devices the geofence is assigned to","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/subitem.fields"},"geofence_id":{"$ref":"#/definitions/item.id"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"groups":{"$ref":"#/definitions/subitems.array"},"groups_count":{"description":"Number of groups the geofence is assigned to","type":"integer"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"plugin_id":{"$ref":"#/definitions/item.id"},"plugins":{"$ref":"#/definitions/subitems.array"},"plugins_count":{"description":"Number of plugins the geofence is assigned to","type":"integer"},"priority":{"$ref":"#/definitions/geofence.priority"},"streams":{"$ref":"#/definitions/subitems.array"},"streams_count":{"description":"Number of streams the geofence is assigned to","type":"integer"}},"type":"object"},"plugin.geofences":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Plugin geofences collection","items":{"$ref":"#/definitions/plugin.geofence"},"type":"array"}},"type":"object"},"plugin.group":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs_count":{"$ref":"#/definitions/group.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"$ref":"#/definitions/group.devices_count"},"fields":{"$ref":"#/definitions/plugin.device.fields"},"geofences_count":{"$ref":"#/definitions/group.geofences_count"},"group_id":{"$ref":"#/definitions/group.id"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/group.name"},"plugin_id":{"$ref":"#/definitions/plugin.id"},"plugins_count":{"$ref":"#/definitions/group.plugins_count"},"streams_count":{"$ref":"#/definitions/group.streams_count"}},"type":"object"},"plugin.groups":{"properties":{"errors":{"description":"Errors occurred while processing the request.","items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"Plugin groups collection","items":{"$ref":"#/definitions/plugin.group"},"type":"array"}},"type":"object"},"plugin.id":{"description":"Unique plugin ID","minimum":1,"type":"integer","x-flespi-acl":"gw/plugins","x-view-selector":"plugins"},"plugin.item_schema":{"description":"Optional JSON schema of item fields. The platform doesn't use it to verify item fields when attaching data to device to plugin assignment.","type":"object"},"plugin.item_type":{"description":"Item type — integer category of flespi entities the plugin processes. Currently only 11 is accepted (the UI renders this value as the label 'gw/devices').\n","enum":[11],"type":"integer","x-view-enum-labels":["gw/devices"]},"plugin.name":{"description":"Plugin title","maxLength":255,"minLength":1,"type":"string"},"plugin.post":{"properties":{"configuration":{"$ref":"#/definitions/plugin.configuration"},"enabled":{"$ref":"#/definitions/item.enabled-default"},"item_type":{"$ref":"#/definitions/plugin.item_type"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/plugin.name"},"priority":{"default":0,"description":"Plugin order. The high priority plugin is applied first.","maximum":100,"minimum":0,"type":"integer"},"required":{"$ref":"#/definitions/plugin.required"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"type_id":{"$ref":"#/definitions/plugin.type_id"},"validate_message":{"$ref":"#/definitions/plugin.validate_message"}},"required":["name","item_type","type_id","configuration"],"title":"Standard plugin","type":"object","x-view-order":["name","item_type","enabled","required","priority","timezone","validate_message","type_id","configuration","metadata"]},"plugin.priority":{"description":"Plugin order. The high priority plugin is applied first.","maximum":100,"minimum":0,"type":"integer"},"plugin.required":{"description":"If required flag is set to true, device message registration will be cancelled with error if any problem will occur during plugin processing.","type":"boolean"},"plugin.type_id":{"description":"Plugin type id. You may retrieve available plugin types with [GET /gw/plugin-types/all](https://flespi.io/docs/#/gw/protocols/get_plugin_types_plugin_types_selector) API call.","minimum":1,"type":"number","x-view-dict":"plugintypes"},"plugin.type_name":{"description":"Plugin type name. You may retrieve available plugin types with [GET /gw/plugin-types/all](https://flespi.io/docs/#/gw/protocols/get_plugin_types_plugin_types_selector) API call.","type":"string"},"plugin.validate_message":{"description":"This [expression](https://flespi.com/kb/expressions) will be applied to device message in order to determine should the plugin be applied to this message or not.\nIf expression will evaluate to false, plugin will ignore processing for given device message.\nIf the expression will evaluate to true or empty expression is specified in this field plugin will try to process the message.\n\nYou may use this validation expression to limit number of device messages to which plugin will be applied.\n","format":"expression-complex","maxLength":1024,"minLength":0,"type":"string","x-view-type":"expression"},"plugins.post":{"items":{"$ref":"#/definitions/plugin.post"},"maxItems":1000,"minItems":1,"title":"Plugins array","type":"array"},"plugins.put":{"properties":{"configuration":{"$ref":"#/definitions/plugin.configuration"},"enabled":{"$ref":"#/definitions/item.enabled"},"id":{"$ref":"#/definitions/plugin.id"},"item_type":{"$ref":"#/definitions/plugin.item_type"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/plugin.name"},"priority":{"$ref":"#/definitions/plugin.priority"},"required":{"$ref":"#/definitions/plugin.required"},"timezone":{"$ref":"#/definitions/container.interval.timezone"},"type_id":{"$ref":"#/definitions/plugin.type_id"},"validate_message":{"$ref":"#/definitions/plugin.validate_message"}},"title":"Standard plugin","type":"object","x-view-order":["name","item_type","enabled","required","priority","timezone","validate_message","type_id","configuration","metadata"]},"plugins.result":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Plugins collection.","items":{"$ref":"#/definitions/plugin"},"type":"array"}},"type":"object"},"protocol":{"description":"Channel protocol information","properties":{"changelog":{"$ref":"#/definitions/protocol.changelog"},"configuration":{"$ref":"#/definitions/protocol.configuration"},"description":{"$ref":"#/definitions/protocol.description"},"features":{"$ref":"#/definitions/protocol.features"},"id":{"$ref":"#/definitions/protocol.id"},"message_parameters":{"$ref":"#/definitions/protocol.message_parameters"},"modified":{"$ref":"#/definitions/protocol.modified"},"name":{"$ref":"#/definitions/protocol.name"},"transport":{"$ref":"#/definitions/protocol.transport"}},"type":"object"},"protocol.changelog":{"description":"Link to the protocol changelog. New changelog posts are re-published into 'flespi/message/gw/channel-protocols/{id}/changelog' MQTT topic and accumulated in the platform, available with 'GET /gw/channel-protocols/{id}/changelog-posts' request.","type":"string"},"protocol.configuration":{"description":"Scheme for custom protocol configuration. Exact configuration specified in configuration of channels that are using this protocol.\n","type":"object"},"protocol.description":{"description":"Protocol description.","format":"markdown","maxLength":1024,"type":"string"},"protocol.features":{"description":"Capability flags provided by the protocol to its channels and device types.","properties":{"media_commands":{"description":"Protocol supports media commands (request_video, take_photo, etc.).","type":"boolean"},"media_data":{"description":"Protocol can process media payloads (photos, video files).","type":"boolean"},"raw_packets":{"description":"Channel with this protocol can store raw traffic packets.","type":"boolean"},"shared_connection":{"description":"A single connection to the channel can be shared between multiple device idents.","type":"boolean"},"tacho_commands":{"description":"Protocol supports tachograph commands (request_tachograph_file).","type":"boolean"},"tls":{"description":"Protocol supports a TLS-secured transport.","type":"boolean"}},"type":"object"},"protocol.id":{"description":"Unique protocol ID.","minimum":1,"type":"integer"},"protocol.message_parameters":{"description":"Message parameters that can present in messages generated by the channel with this protocol. Some parameters can be registered only for messages from specific devices.","items":{"$ref":"#/definitions/message_parameter"},"type":"array"},"protocol.modified":{"description":"Last mofidication of the protocol timestamp.","format":"uint32","type":"number"},"protocol.name":{"description":"Protocol name that uniquely identify the protocol.\nThis usually corresponds to the protocol manufacturer name in lowercase for example 'teltonika', 'queclink', 'concox'.\nOnly one protocol with given name can exists in flespi.\n","maxLength":255,"minLength":1,"type":"string"},"protocol.transport":{"description":"Bitmask of available transports supported by the protocol:\n * 0x1 bit - listen to TCP connections\n * 0x2 bit - handle UDP packets\n * 0x4 bit - protocol channel operates as HTTP server\n * 0x8 bit - protocol handles SMS messages\n * 0x10 bit - protocol channel operates as MQTT transport\n * 0x20 bit - another tg channel as input\n * 0x40 bit - custom\n * 0x80 bit - protocol operates as FTP server/client\n","format":"uint32","type":"number"},"protocols":{"properties":{"errors":{"description":"Errors occurred while processing the request.","items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"Protocols collection.","items":{"$ref":"#/definitions/protocol"},"type":"array"}},"type":"object"},"setting":{"anyOf":[{"description":"Device setting information","properties":{"address":{"$ref":"#/definitions/setting.address"},"commands":{"description":"Mapping to the device-level command names for the setting get/set actions","type":"object"},"current":{"description":"Current setting value."},"device_id":{"$ref":"#/definitions/setting.device_id"},"mode":{"description":"Setting change mode bitmask.\nBit 1 says that setting value may be requested (get) from device, bit 2 says that setting value can be sent (set) to device.\n","format":"uint32","type":"number"},"name":{"$ref":"#/definitions/setting.name"},"pending":{"description":"Pending, setting value is not applied yet."},"schema":{"description":"JSON schema for current and pending setting value.","type":"object"},"status":{"description":"Setting current value and processing status bitmask.\n","format":"uint32","type":"number"},"tab":{"description":"Configurator interface tab name","type":"string"},"tags":{"description":"Setting tags in form of name-priority pairs","type":"object"},"updated":{"description":"UNIX timestamp of current setting value update (get or set).","format":"double","type":"number"}},"type":"object"},{"description":"Device setting information","properties":{"device_id":{"$ref":"#/definitions/setting.device_id"},"name":{"$ref":"#/definitions/setting.name"},"sent":{"description":"Sent SMS status.","type":"boolean"},"text":{"description":"SMS message text. You can send it manually if message was not sent.","type":"string"},"type":{"description":"Message format is textural or binary.","enum":["text","hex"],"type":"string"}},"type":"object"}]},"setting.address":{"description":"The way to be used to deliver a command to set/get setting (connection/SMS).","enum":["connection","sms"],"type":"string"},"setting.delete":{"properties":{"device_id":{"$ref":"#/definitions/setting.device_id"},"name":{"$ref":"#/definitions/setting.name"}},"type":"object"},"setting.device_id":{"description":"Device ID.","minimum":1,"type":"integer","x-view-selector":"devices"},"setting.name":{"description":"Setting name according to the channel protocol and corresponding device type","type":"string"},"setting.put":{"description":"New setting value.","properties":{"address":{"$ref":"#/definitions/setting.address"},"properties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"},{"type":"boolean"},{"type":"array"},{"additionalProperties":true,"type":"object"}],"description":"New setting value. You can [construct correct setting properties](https://flespi.com/kb/commands-and-settings) using UI for simplicity."}},"required":["address"],"type":"object"},"settings":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Settings collection.","items":{"$ref":"#/definitions/setting"},"type":"array"}},"type":"object"},"settings.delete":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Deleted settings collection.","items":{"$ref":"#/definitions/setting.delete"},"type":"array"}},"type":"object"},"stream":{"description":"stream information","properties":{"blocked":{"$ref":"#/definitions/stream.blocked"},"channels_count":{"description":"Number of channels assigned to the stream","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"configuration":{"$ref":"#/definitions/stream.configuration"},"connected":{"$ref":"#/definitions/stream.connected"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"description":"Number of devices assigned to the stream","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"errors":{"description":"Errors per minute.","format":"uint32","type":"integer"},"geofences_count":{"description":"Number of geofences assigned to the stream","type":"integer"},"groups_count":{"description":"Number of groups assigned to the stream","type":"integer"},"id":{"$ref":"#/definitions/stream.id"},"latency":{"description":"Message delivery latency.","type":"number"},"messages":{"description":"Messages delivered by the stream, per minute.","format":"uint32","type":"integer"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/stream.name"},"protocol_id":{"$ref":"#/definitions/stream.protocol_id"},"protocol_name":{"$ref":"#/definitions/stream.protocol_name"},"queue_size":{"$ref":"#/definitions/stream.queue_size"},"queue_ttl":{"$ref":"#/definitions/stream.queue_ttl-nodefault"},"traffic":{"description":"Traffic per minute, in bytes","type":"number"},"validate_message":{"$ref":"#/definitions/stream.validate_message"}},"type":"object"},"stream-protocol":{"description":"Stream protocol information","properties":{"changelog":{"$ref":"#/definitions/stream-protocol.changelog"},"configuration":{"$ref":"#/definitions/stream-protocol.configuration"},"description":{"$ref":"#/definitions/stream-protocol.description"},"id":{"$ref":"#/definitions/stream-protocol.id"},"name":{"$ref":"#/definitions/stream-protocol.name"}},"type":"object"},"stream-protocol.changelog":{"description":"Link to the stream protocol changelog. New changelog posts are re-published into 'flespi/message/gw/stream-protocols/{id}/changelog' MQTT topic and accumulated in the platform, available with 'GET /gw/stream-protocols/{id}/changelog-posts' request.","type":"string"},"stream-protocol.configuration":{"description":"Stream protocol configuration.","type":"object"},"stream-protocol.description":{"description":"Stream protocol description","type":"string"},"stream-protocol.id":{"description":"Stream protocol id","type":"integer"},"stream-protocol.name":{"description":"Unique stream protocol name","minLength":1,"type":"string"},"stream-protocols":{"properties":{"errors":{"description":"Errors list.","items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"description":"Stream protocols collection","items":{"$ref":"#/definitions/stream-protocol"},"type":"array"}},"type":"object"},"stream.blocked":{"description":"Active block code for stream. Zero code means stream is not blocked for new messages reception.","format":"uint32","type":"integer"},"stream.channel":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/channel.blocked"},"channel_id":{"$ref":"#/definitions/channel.id"},"cid":{"$ref":"#/definitions/item.cid"},"configuration":{"$ref":"#/definitions/channel.configuration"},"connections_count":{"$ref":"#/definitions/channel.connections_count"},"created":{"$ref":"#/definitions/item.btime"},"enabled":{"$ref":"#/definitions/item.enabled"},"idents":{"$ref":"#/definitions/channel.idents"},"messages":{"description":"Messages generated by the channel within last minute.","format":"uint32","type":"integer"},"messages_size":{"$ref":"#/definitions/channel.messages_size"},"messages_ttl":{"$ref":"#/definitions/channel.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/channel.name"},"protocol_features":{"$ref":"#/definitions/channel.protocol_features"},"protocol_id":{"$ref":"#/definitions/channel.protocol_id"},"protocol_name":{"$ref":"#/definitions/channel.protocol_name"},"secondary_uri":{"$ref":"#/definitions/channel.secondary_uri"},"stream_id":{"$ref":"#/definitions/stream.id"},"streams_count":{"description":"Number of active streams for the channel.","format":"uint32","type":"integer"},"traffic":{"description":"Traffic generated by all channel connections within last minute, in bytes.","type":"number"},"udp_packets":{"description":"UDP packets processed by the channel within last minute.","format":"uint32","type":"integer"},"uri":{"$ref":"#/definitions/channel.uri"}},"type":"object"},"stream.channel.post":{"properties":{"channel_id":{"$ref":"#/definitions/channel.id"}},"required":["channel_id"],"title":"Channel messages","type":"object"},"stream.channels":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Channels collection.","items":{"$ref":"#/definitions/stream.channel"},"type":"array"}},"type":"object"},"stream.channels.id":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"ID collection.","items":{"$ref":"#/definitions/channel.id"},"type":"array"}},"type":"object"},"stream.configuration":{"additionalProperties":true,"title":"Arbitrary configuration, its schema is defined by the selected stream protocol","type":"object","x-view-schema":"stream_configuration"},"stream.connected":{"description":"Stream connection status. true - stream is connected and streaming messages now.","type":"boolean"},"stream.device":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/device.blocked"},"calcs":{"$ref":"#/definitions/device.calcs"},"calcs_count":{"$ref":"#/definitions/device.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"commands":{"$ref":"#/definitions/device.commands"},"commands_queue":{"$ref":"#/definitions/device.commands_queue"},"configuration":{"$ref":"#/definitions/device.configuration"},"connected":{"$ref":"#/definitions/device.connected"},"created":{"$ref":"#/definitions/item.btime"},"device_id":{"$ref":"#/definitions/device.id"},"device_type_id":{"$ref":"#/definitions/device.device_type_id"},"device_type_name":{"$ref":"#/definitions/device.device_type_name"},"enabled":{"$ref":"#/definitions/item.enabled"},"geofences_count":{"$ref":"#/definitions/device.geofences_count"},"groups":{"$ref":"#/definitions/device.groups"},"groups_count":{"$ref":"#/definitions/device.groups_count"},"intervals_size":{"$ref":"#/definitions/device.intervals_size"},"last_active":{"$ref":"#/definitions/device.last_active"},"media_blocked":{"$ref":"#/definitions/device.media_blocked"},"media_rotate":{"$ref":"#/definitions/device.media_rotate"},"media_size":{"$ref":"#/definitions/device.media_size"},"media_traffic":{"$ref":"#/definitions/device.media_traffic"},"media_ttl":{"$ref":"#/definitions/device.media_ttl-nodefault"},"messages":{"$ref":"#/definitions/device.messages"},"messages_rotate":{"$ref":"#/definitions/device.messages_rotate"},"messages_size":{"$ref":"#/definitions/device.messages_size"},"messages_ttl":{"$ref":"#/definitions/device.messages_ttl-nodefault"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/device.name"},"plugins":{"$ref":"#/definitions/device.plugins"},"plugins_count":{"$ref":"#/definitions/device.plugins_count"},"protocol_id":{"$ref":"#/definitions/device.protocol_id"},"protocol_name":{"$ref":"#/definitions/device.protocol_name"},"settings":{"$ref":"#/definitions/device.settings"},"stream_id":{"$ref":"#/definitions/stream.id"},"streams":{"$ref":"#/definitions/device.streams"},"streams_count":{"$ref":"#/definitions/device.streams_count"},"telemetry":{"$ref":"#/definitions/device.telemetry"},"traffic":{"$ref":"#/definitions/device.traffic"}},"type":"object"},"stream.device.post":{"properties":{"device_id":{"$ref":"#/definitions/device.id"}},"required":["device_id"],"title":"Device messages","type":"object"},"stream.device.put":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"}},"type":"object"},"stream.devices":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Devices collection.","items":{"$ref":"#/definitions/stream.device"},"type":"array"}},"type":"object"},"stream.devices.id":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"ID collection.","items":{"$ref":"#/definitions/device.id"},"type":"array"}},"type":"object"},"stream.geofence":{"description":"information about geofence inside stream","properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs":{"$ref":"#/definitions/subitems.array"},"calcs_count":{"description":"Number of calculators the geofence is assigned to","type":"integer"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices":{"$ref":"#/definitions/subitems.array"},"devices_count":{"description":"Number of devices the geofence is assigned to","type":"integer"},"enabled":{"$ref":"#/definitions/item.enabled"},"fields":{"$ref":"#/definitions/subitem.fields"},"geofence_id":{"$ref":"#/definitions/item.id"},"geometry":{"$ref":"#/definitions/geofence.geometry"},"groups":{"$ref":"#/definitions/subitems.array"},"groups_count":{"description":"Number of groups the geofence is assigned to","type":"integer"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/item.name"},"plugins":{"$ref":"#/definitions/subitems.array"},"plugins_count":{"description":"Number of plugins the geofence is assigned to","type":"integer"},"priority":{"$ref":"#/definitions/geofence.priority"},"stream_id":{"$ref":"#/definitions/item.id"},"streams":{"$ref":"#/definitions/subitems.array"},"streams_count":{"description":"Number of streams the geofence is assigned to","type":"integer"}},"type":"object"},"stream.geofences":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Stream geofences collection","items":{"$ref":"#/definitions/stream.geofence"},"type":"array"}},"type":"object"},"stream.group":{"properties":{"auto_created":{"$ref":"#/definitions/subitem.auto_created"},"blocked":{"$ref":"#/definitions/item.blocked"},"calcs_count":{"$ref":"#/definitions/group.calcs_count"},"cid":{"$ref":"#/definitions/item.cid"},"created":{"$ref":"#/definitions/item.btime"},"devices_count":{"$ref":"#/definitions/group.devices_count"},"geofences_count":{"$ref":"#/definitions/group.geofences_count"},"group_id":{"$ref":"#/definitions/group.id"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/group.name"},"plugins_count":{"$ref":"#/definitions/group.plugins_count"},"stream_id":{"$ref":"#/definitions/stream.id"},"streams_count":{"$ref":"#/definitions/group.streams_count"}},"type":"object"},"stream.group.post":{"properties":{"group_id":{"$ref":"#/definitions/group.id"}},"required":["group_id"],"title":"Device messages","type":"object"},"stream.groups":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Devices collection.","items":{"$ref":"#/definitions/stream.group"},"type":"array"}},"type":"object"},"stream.groups.id":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"ID collection.","items":{"$ref":"#/definitions/group.id"},"type":"array"}},"type":"object"},"stream.id":{"description":"Stream ID","minimum":1,"type":"integer","x-flespi-acl":"gw/streams","x-view-selector":"streams"},"stream.messages.post":{"items":{"additionalProperties":true,"description":"Emulated device message that will be posted into stream","maxProperties":1000,"properties":{"timestamp":{"description":"UTC timestamp. This timestamp is required by the streams to format a valid message.","minimum":1,"type":"number","x-view-type":"datetimezero"}},"required":["timestamp"],"title":"Message parameters","type":"object"},"maxItems":10000,"minItems":1,"title":"Messages array","type":"array"},"stream.name":{"description":"Stream name to easily access certain streams using {stream.selector}","maxLength":255,"type":"string"},"stream.post":{"properties":{"configuration":{"$ref":"#/definitions/stream.configuration"},"enabled":{"$ref":"#/definitions/item.enabled-default"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/stream.name"},"protocol_id":{"$ref":"#/definitions/stream.protocol_id"},"queue_ttl":{"$ref":"#/definitions/stream.queue_ttl-default"},"validate_message":{"$ref":"#/definitions/stream.validate_message"}},"required":["protocol_id","configuration"],"title":"Stream with selectable protocol","type":"object","x-view-order":["name","enabled","queue_ttl","protocol_id","configuration","validate_message","metadata"]},"stream.protocol_id":{"description":"Stream protocol ID. You may retrieve available stream protocols with [GET /gw/stream-protocols/all](https://flespi.io/docs/#/gw/protocols/get_stream_protocols_stream_protocols_selector) API call.","minimum":1,"type":"integer","x-view-dict":"streamprotocols"},"stream.protocol_name":{"description":"Stream protocol name. You may retrieve available stream protocols with [GET /gw/stream-protocols/all](https://flespi.io/docs/#/gw/protocols/get_stream_protocols_stream_protocols_selector) API call.","minimum":1,"type":"integer"},"stream.put":{"properties":{"configuration":{"$ref":"#/definitions/stream.configuration"},"enabled":{"$ref":"#/definitions/item.enabled"},"metadata":{"$ref":"#/definitions/metadata"},"name":{"$ref":"#/definitions/stream.name"},"protocol_id":{"$ref":"#/definitions/stream.protocol_id"},"queue_ttl":{"$ref":"#/definitions/stream.queue_ttl-nodefault"},"validate_message":{"$ref":"#/definitions/stream.validate_message"}},"title":"Stream with selectable protocol","type":"object","x-view-order":["name","enabled","queue_ttl","protocol_id","configuration","validate_message","metadata"]},"stream.queue_size":{"description":"Current stream queue size, in KB. Updates periodically.","format":"uint32","type":"integer"},"stream.queue_ttl-default":{"anyOf":[{"description":"Time to live for messages in the queue before they expire. Expired messages will no longer be delivered.","format":"uint32","maximum":864000,"minimum":60,"title":"Queue TTL","type":"integer","x-view-divider":3600,"x-view-unit":"hours"},{"description":"Time to live for messages in the queue before they expire is around one minute. Expired messages will no longer be delivered.","format":"uint32","maximum":59,"minimum":59,"readOnly":true,"title":"Queue with realtime delivery only","type":"integer","x-view-hidden":true}],"default":86400},"stream.queue_ttl-nodefault":{"anyOf":[{"description":"Time to live for messages in the queue before they expire. Expired messages will no longer be delivered.","format":"uint32","maximum":864000,"minimum":60,"title":"Queue TTL","type":"integer","x-view-divider":3600,"x-view-unit":"hours"},{"description":"Time to live for messages in the queue before they expire is around one minute. Expired messages will no longer be delivered.","format":"uint32","maximum":59,"minimum":59,"readOnly":true,"title":"Queue with realtime delivery only","type":"integer","x-view-hidden":true}]},"stream.validate_message":{"description":"With this [expression](https://flespi.com/kb/expressions) incoming message from subscribed channels and devices will be checked in order to determine should the stream queue it for delivery or not.\nIf expression will evaluate to false, stream will skip this message.\nIf the expression will evaluate to true or empty expression is specified in this field stream will queue message to delivery..\n\nYou may use this validation expression to limit number of device messages stream will try to deliver.\n","format":"expression-complex","maxLength":1024,"minLength":0,"type":"string","x-view-type":"expression"},"streams":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Streams collection.","items":{"$ref":"#/definitions/stream"},"type":"array"}},"type":"object"},"streams.id":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"IDs collection.","items":{"$ref":"#/definitions/stream.id"},"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"},"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 (full-stack API for telematics devices) provides methods to create and manage the following instances of the [flespi telematics hub](https://flespi.com/) that jointly provide the end-to-end communication between the GPS trackers and your target application:\n* [**channels**](https://flespi.com/kb/channel-entry-point-to-gateway) - inbound protocol-specific pipes where the raw data from the trackers get parsed and saved in the unified JSON format in the buffer for further [consumption](https://flespi.com/kb/messages-basic-information-units#how-to-access-messages).\n* [**devices**](https://flespi.com/kb/device-virtual-instance-of-real-tracker) - virtual representations of the physical trackers on the flespi platform. Allow organizing messages storage by device (ident), remote [device configuration](https://flespi.com/kb/commands-and-settings), dedicated long-term storage, [video telematics](https://flespi.com/kb/video-telematics-integration) functionality, access to [telemetry](https://flespi.com/kb/device-telemetry) and much more.\n* [**streams**](https://flespi.com/kb/stream-forward-data-from-gateway) - outbound data flows preformatted to forward the telematics data to specific target platforms (e.g. [Google Pub/Sub](https://flespi.com/kb/flespi-to-google), [Amazon AWS IoT](https://flespi.com/kb/flespi-to-aws), [Microsoft Azure IoT](https://flespi.com/kb/flespi-to-azure), and [more](https://flespi.com/kb/stream-forward-data-from-gateway#stream-types)).\n* [**calculators**](https://flespi.com/kb/calculators-preconfigured-algorithms-for-intervals-extraction-and-calculating) - sets of rules for detecting intervals and computing the associated values for them; integral prt of the [flespi analytics engine](https://flespi.com/kb/analytics-flespi-reports-engine).\n* [**plugins**](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices) - allow extending the standard set of device parameters with additional ones required by specific platforms or applications, including copy of message into other devices, cancelling message registration and even enriching message parameters from your system via webhook.\n* [**modems**](https://flespi.com/kb/modem-instance-to-send-sms) - instance connecting the flespi platform with an SMS service provider for sending configurational text messages to change device settings.\n* [**protocols**](https://flespi.com/protocols) - access to the list of protocols, device types, available message parameters and commands.\n\nTo identify each REST request [flespi token](https://flespi.com/kb/tokens-access-keys-to-flespi-platform) has to be passed in the HTTP call via the header: **Authorization: FlespiToken XXXXXXXXXX**.\nThe limit of URI component is 64KB.\n\nAll changes to the gateway items are recorded in the common [logs subsystem](https://flespi.io/docs/#/platform/logs).\n","title":"flespi Telematics Hub REST API\n","version":"1.0"},"parameters":{"asset.fields":{"collectionFormat":"csv","description":"All possible fields available for the asset.\nIf this parameter is specified in the query path of API call each returned asset will consists only from JSON object with specified fields.\nIf this parameter is not specified each asset will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","cid","name","enabled","priority","intervals_ttl","size","blocked","metadata","last","active","device_id","groups_count","calcs_count","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/asset"}},"assets.selector":{"collectionFormat":"csv","description":"Select assets for the API operation.\n\nSome samples you may use in assets.selector:\n  - **all** - select all assets available for the user(token), this is special selector format\n  - **1,2,3,4** - select assets with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select assets which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select assets which metadata has parameter 'clientid' with value 4, by [asset metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **last.device_id=100** - select assets which last interval contains device_id with value 100, e.g. last known for device with id 100\n  - **active.device_id=100** - select assets which active interval contains device_id with value 100, e.g. to which device with id 100 is linked according to current time\n\nSample API calls:\n  - **GET /gw/assets/all?fields=id,name** - select all available assets and return their id and name\n  - **GET /gw/assets/name=\"my-asset\"?fields=id,name,last** - select asset with name=\"my-asset\" and return their id, name and the latest interval\n","in":"path","items":{"type":"string"},"name":"assets.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/asset"},"x-view-selector":"assets"},"calc.assets.fields":{"collectionFormat":"csv","description":"Fields available for response.","in":"query","items":{"enum":["active","asset_id","auto_created","blocked","calc_id","calcs_count","cid","created","device_id","enabled","groups_count","intervals_ttl","last","metadata","name","priority","size"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/calc.asset"}},"calc.assets.selector":{"collectionFormat":"csv","description":"Select [assets](https://flespi.com/kb/assets-management-and-usage) for the API operation.\n\nSome samples you may use in assets.selector:\n  - **all** - select all assets available for the user(token), this is special selector format\n  - **1,2,3,4** - select assets with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select assets which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select assets which metadata has parameter 'clientid' with value 4, by [asset metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select assets which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n\nSample API calls:\n  - **GET /gw/calcs/all/assets/all?fields=asset_id,name** - select all available assets and return their id and name\n  - **GET /gw/calcs/all/assets/name=\"my-asset\"?fields=asset_id,name** - select asset with name=\"my-asset\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"calc.assets.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/calc.asset"},"x-view-selector":"devices"},"calc.device.fields":{"collectionFormat":"csv","description":"All possible fields available for the device assigned to calculator.\nDevice ident (IMEI) is located in configuration field.\nIf this parameter is specified in the query path of API call each returned assigned device will consists only from JSON object with specified fields.\nIf this parameter is not specified each assigned device will be returned as JSON object with default fields.\n\nBe aware that assigned device indicated here is a different entity than [flespi virtual device](https://flespi.com/kb/device-virtual-instance-of-real-tracker) instance.\nIt is an intersection of flespi virtual device and corresponding calculator to which it is assigned. Only some subset of virtual device fields are available in assigned device.\n","in":"query","items":{"enum":["auto_created","blocked","calc_id","calc_name","calcs","calcs_count","cid","commands","commands_queue","configuration","connected","created","device_id","device_type_id","device_type_name","enabled","geofences_count","groups","groups_count","intervals_size","last_active","media_blocked","media_rotate","media_size","media_traffic","media_ttl","messages","messages_rotate","messages_size","messages_ttl","metadata","name","plugins","plugins_count","protocol_id","protocol_name","settings","streams","streams_count","synced","telemetry","time_begin","time_end","tline_id","traffic"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/calc.device"}},"calc.device.intervals.selector":{"default":"all","description":"Interval selector.\n\nYou can use 3 variants inside selector value:\n  * interval ID - to specify and select for API operation exact interval.\n  * 'all' - this is special value to select all intervals, you usually use it in **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}** API call;\n  * 'last' - this is special value to select latest calculated interval, you usually use it in **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}** API call;\n","in":"path","name":"calc.device.intervals.selector","required":true,"type":"string"},"calc.device.intervals.selector.put":{"description":"Specify interval ID for API call.\n","in":"path","name":"calc.device.intervals.selector.put","required":true,"type":"integer"},"calc.devices.selector":{"collectionFormat":"csv","description":"Select [devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker) for the API operation.\n\nSome samples you may use in calc.devices.selector:\n  - **all** - select all devices available for the user(token), this is special selector format\n  - **1,2,3,4** - select devices with ID 1,2,3 and 4, this is special selector format\n  - **configuration.ident=\"123456789012345\"** - select devices by ident '123456789012345' (IMEI), by sub-field 'ident' inside field 'configuration'\n  - **name=\"XXX\\*\"** - select devices which name starts from XXX, by field 'name' with wildcards\n  - **connected=true** - select devices that are currently connected to flespi channel, by field 'connected'\n  - **groups.id=1234** - select devices which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n  - **plugins.fields.driver.name=\"Andrew\\*\"** - select devices that are assigned to 'item-fields' plugin and for this assignment driver.name field starts from \"Andrew\", by assigned plugin field filtering\n  - **{configuration.ident in (\"123456789012345\",\"78901234545565677\")}** - select devices by multiple idents using the 'in' operator of flespi expressions\n\nSample API calls:\n  - **GET /gw/calcs/all/devices/all?fields=device_id,calc_id** - for all available calculators select all assigned devices and return their device id and calc id\n  - **GET /gw/calc/all/devices/configuration.ident=\"123456789012345\"?fields=device_id,calc_id** - for all available calculators select only those to which assigned device with ident=\"123456789012345\" in their configuration and return device id and calc id\n  - **GET /gw/calcs/123/devices/333** - for calculator with id 123 fetch assigned device with id 333 and return default fields for assigned device\n","in":"path","items":{"type":"string"},"name":"calc.devices.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/calc.device"},"x-view-selector":"devices"},"calc.fields":{"collectionFormat":"csv","description":"All possible fields available for the calculator.\nIf this parameter is specified in the query path of API call each returned calculator will consists only from JSON object with specified fields.\nIf this parameter is not specified each calculator will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","cid","update_delay","messages_source","version","intervals_ttl","intervals_rotate","selectors","counters","validate_interval","validate_message","timezone","blocked","devices_count","intervals_size","update_period","update_onchange","metadata","groups_count","geofences_count","assets_count","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/calc"}},"calc.geofences.fields":{"collectionFormat":"csv","description":"Fields available for response.","in":"query","items":{"enum":["auto_created","blocked","calc_id","calcs","calcs_count","cid","created","devices","devices_count","enabled","geofence_id","geometry","groups","groups_count","metadata","name","plugins","plugins_count","priority","streams","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/calc.geofence"}},"calc.geofences.selector":{"collectionFormat":"csv","description":"Select [geofences](https://flespi.com/kb/geofences-management-and-usage) for the API operation.\n\nSome samples you may use in geofences.selector:\n  - **all** - select all geofences available for the user(token), this is special selector format\n  - **1,2,3,4** - select geofences with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select geofences which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select geofences which metadata has parameter 'clientid' with value 4, by [geofence metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select geofences which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n\nSample API calls:\n  - **GET /gw/calcs/all/geofences/all?fields=geofence_id,name** - select all available geofences and return their id and name\n  - **GET /gw/calcs/all/geofences/name=\"my-geofence\"?fields=geofence_id,name** - select geofence with name=\"my-geofence\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"calc.geofences.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/calc.geofence"},"x-view-selector":"devices"},"calc.group.fields":{"collectionFormat":"csv","description":"Fields that are available in calculator group assignment.\n","in":"query","items":{"enum":["auto_created","blocked","calc_id","calcs_count","cid","created","devices_count","fields","geofences_count","group_id","metadata","name","plugins_count","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/calc.group"}},"calc.groups.selector":{"collectionFormat":"csv","description":"Select [groups](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) for the API operation.\n\nSome samples you may use in calc.groups.selector:\n  - **all** - select all groups available for the user(token), this is special selector format\n  - **1,2,3,4** - select groups with ID 1,2,3 and 4, this is special selector format\n\nSample API calls:\n  - **GET /gw/calcs/all/groups/all** - for all available calculators select all assigned groups\n","in":"path","items":{"type":"string"},"name":"calc.groups.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/calc.group"},"x-view-selector":"groups"},"calcs.selector":{"collectionFormat":"csv","description":"Select [calculator](https://flespi.com/kb/analytics-reports-and-events-engine#calculators) for the API operation.\n\nSome samples you may use in calcs.selector:\n  - **all** - select all calculators available for the user(token), this is special selector format\n  - **1,2,3,4** - select calculators with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select calculators which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select calculators which metadata has parameter 'clientid' with value 4, by [calculator metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **{cid=123 || cid=456}** - select calculators from subaccounts with id 123 and 456, by using expression and 'cid' field (subaccount assignment)\n  - **intervals_size>1024** - select calculators with current total intervals storage size above 1024KB, by field 'intervals_size'\n\nSample API calls:\n  - **GET /gw/calcs/all?fields=id,name** - select all available calculators and return their id and name\n  - **GET /gw/calcs/1?fields=id,name,selectors,counters** - select calculator with ID 1 and return its id, name, selectors and counters configuration\n","in":"path","items":{"type":"string"},"name":"calcs.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/calc"},"x-view-selector":"calcs"},"ch-ident-selector":{"description":"Exact value of channel ident for which to retrieve traffic.\n\nYou may use special value 'unidentified' to retrieve traffic from connections for which channel did not receive any device identification information.\n\nAlso under 'unidentified' ident all traffic from retranslator and connectionless protocols will be accumulated.\n","in":"path","maxLength":256,"minLength":1,"name":"ch-ident-selector","required":true,"type":"string"},"ch-selector":{"collectionFormat":"csv","description":"Select channels for the API operation. Usually you select channel by specifying its ID. In some operations your ch-selector should select only a single channel only.\n\nSome samples you may use in ch-selector:\n  - **all** - select all channels available for the user(token), this is special selector format\n  - **1,2,3,4** - select channels with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select channels which name starts from XXX, by field 'name' with wildcards\n  - **protocol_name=\"teltonika\"** - select channels with 'teltonika' protocol, by field 'protocol_name'\n  - **messages_size>1024** - select channels with current messages storage size above 1024KB, by field 'messages_size'\n  - **blocked!=0** - select channels that are currently blocked due to any reason code, by field 'blocked'\n  - **{cid=123 || cid=456}** - select channels from subaccounts with id 123 and 456, by using expression and 'cid' field (subaccount assignment)\n  - **connections_count>1000** - select channels to which currentl more than 1000 connections are opened, by field 'connections_count'\n\nSample API calls:\n  - **GET /gw/channels/all?fields=id,name,protocol_name** - select all available channels and return their id, name and protocol name\n  - **GET /gw/channels/1?fields=id,name** - select channel with ID=1 and return its id and name\n","in":"path","items":{"type":"string"},"name":"ch-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/channel"},"x-view-selector":"channels"},"channel-protocol.fields":{"collectionFormat":"csv","description":"All possible fields available for the channel protocol.\nThe most significant field by which you reference protocol is the 'name'.\nIf this parameter is specified in the query path of API call each returned channel protocol will consists only from JSON object with specified fields.\nIf this parameter is not specified each channel protocol will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","description","changelog","modified","transport","message_parameters","configuration","features"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/protocol"}},"channel-protocols.selector":{"collectionFormat":"csv","description":"Select channel protocols for the API call.\n\nSome samples of values that you can use in channel-protocols.selector parameter:\n  - **all** - select all possible channel protocols\n  - **1,2,3,4** - select channel protocols with ID 1,2,3 and 4\n  - **name=\"teltonika\"** - select \"teltonika\" channel protocol only, by field 'name'\n  - **modified>1704067200** - select channel protocols modified after 1704067200 (UNIX timestamp, corresponds to Monday, January 1, 2024 0:00:00 GMT), by field 'modified'\n\nThe most significant field to identify the protocol is 'name'.\n","in":"path","items":{"type":"string"},"name":"channel-protocols.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/protocol"}},"channel.connection.fields":{"collectionFormat":"csv","description":"All possible fields available for the channel connection.\nIf this parameter is specified in the query path of API call each returned connection will consists only from JSON object with specified fields.\nIf this parameter is not specified each connection will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","connection_id","channel_id","ident","ip","established","transport","secondary","source","meta","device_id"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/channel.connection"}},"channel.fields":{"collectionFormat":"csv","description":"All possible fields available for the channel.\nIf this parameter is specified in the query path of API call each returned channel will consists only from JSON object with specified fields.\nIf this parameter is not specified each channel will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","uri","secondary_uri","protocol_id","protocol_name","protocol_features","messages_ttl","enabled","blocked","configuration","messages_size","connections_count","udp_packets","traffic","messages","cid","metadata","idents","streams_count","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/channel"}},"channel.ident.fields":{"collectionFormat":"csv","description":"All possible fields available for the channel ident.\nIf this parameter is specified in the query path of API call each returned ident will consists only from JSON object with specified fields.\nIf this parameter is not specified each ident will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["ident","device_id","last_active","channel_id","source"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/channel.ident"}},"channel.ident.selector":{"description":"Select channel idents for the API operation. Only idents that are located inside previously selected channels with 'ch-selector' are returned.\n\nSome samples you may use in channel.ident.selector:\n  - **all** - select all idents available, this is special selector format\n  - **12345678901234** - select ident \"12345678901234\", this is special selector format\n  - **device_id=0** - select idents that do not have corresponding device registered, by 'device_id' field\n\nSample API calls:\n  - **GET /gw/channels/all/connections/all?fields=id,ident,channel_id,ip** - select all connections for all available channels and return their id, ident, channel ID and IP address\n  - **GET /gw/channels/1/connections/all?fields=id,ident** - select all connections from channel with ID=1 and return their id and ident\n","in":"path","name":"channel.ident.selector","required":true,"type":"string","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/channel.ident"}},"cid-header":{"description":"Operate as given subaccount.","in":"header","name":"x-flespi-cid","type":"integer","x-view-selector":"subaccounts"},"command-id-selector":{"description":"Select device command ID from the the commands result queue for the API operation. Unique ID is assigned to the command when you queue or execute command for given device.\n","in":"path","name":"command-id-selector","required":true,"schema":{"$ref":"#/definitions/device.command.id"}},"conn-selector":{"collectionFormat":"csv","description":"Select connections for the API operation. Only connections that are located inside previously selected channels with 'ch-selector' are returned.\n\nSome samples you may use in conn-selector:\n  - **all** - select all connections available, this is special selector format\n  - **1,2,3,4** - select connections with ID 1,2,3 and 4, this is special selector format\n  - **ident=\"XXX\"** - select channel connections identified by device with ident XXX, by field 'ident' with wildcards\n  - **ip=\"127.\\*\"** - select channel connections from IP that starts from '127.', by field 'ip' with wildcards\n\nSample API calls:\n  - **GET /gw/channels/all/connections/all?fields=connection_id,ident,channel_id,ip** - select all connections for all available channels and return their id, ident, channel ID and IP address\n  - **GET /gw/channels/1/connections/all?fields=connection_id,ident** - select all connections from channel with ID=1 and return their id and ident\n","in":"path","items":{"type":"string"},"name":"conn-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/channel.connection"}},"dev-geofences-selector":{"collectionFormat":"csv","description":"Select [geofences](https://flespi.com/kb/geofences-management-and-usage) for the API operation.\n\nSome samples you may use in geofences.selector:\n  - **all** - select all geofences available for the user(token), this is special selector format\n  - **1,2,3,4** - select geofences with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select geofences which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select geofences which metadata has parameter 'clientid' with value 4, by [geofence metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select geofences which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n\nSample API calls:\n  - **GET /gw/devices/all/geofences/all?fields=geofence_id,name** - select all available geofences and return their id and name\n  - **GET /gw/devices/all/geofences/name=\"my-geofence\"?fields=geofence_id,name** - select geofence with name=\"my-geofence\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"dev-geofences-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/device.geofence"},"x-view-selector":"devices"},"dev-selector":{"collectionFormat":"csv","description":"Select [devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker) for the API operation.\n\nSome samples you may use in dev-selector:\n  - **all** - select all devices available for the user(token), this is special selector format\n  - **1,2,3,4** - select devices with ID 1,2,3 and 4, this is special selector format\n  - **configuration.ident=\"123456789012345\"** - select device by ident '123456789012345' (IMEI), by sub-field 'ident' inside field 'configuration'\n  - **name=\"XXX\\*\"** - select devices which name starts from XXX, by field 'name' with wildcards\n  - **device_type_name=\"fmb120\"** - select devices with 'fmb120' type, by field 'device_type_name'\n  - **protocol_name=\"teltonika\"** - select devices with type in 'teltonika' protocol, by field 'protocol_name'\n  - **protocol_name=\"teltonika\",device_type_name=\"fmb120\"** - select devices of type 'fmb120' in 'teltonika' protocol, by fields 'protocol_name' and 'device_type_name' simultaneously\n  - **messages_size>1024** - select devices with current messages storage size above 1024KB, by field 'messages_size'\n  - **blocked!=0** - select devices that are currently blocked due to any reason code, by field 'blocked'\n  - **connected=true** - select devices that are currently connected to flespi channel, by field 'connected'\n  - **{last_active<(now()-86400)}** - select devices that didn't reported to flespi for more then 1 day from now, by using expression and field 'last_active'\n  - **telemetry.din.1=true** - select devices that has parameter 'din.1' in the telemetry with true value, by [device telemetry](https://flespi.com/kb/device-telemetry)\n  - **metadata.clientid=4** - select devices which metadata has parameter 'clientid' with value 4, by [device metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select devices which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n  - **device_type_name=\"gv500\",telemetry.engine.ignition.status=true** - select all devices with type 'gv500' with engine.ignition.status=true parameter in their telemetry, combined selector by telemetry and device type\n  - **{cid=123 || cid=456}** - select devices from subaccounts with id 123 and 456, by using expression and 'cid' field (subaccount assignment)\n  - **plugins.fields.driver.name=\"Andrew\\*\"** - select devices that are assigned to 'item-fields' plugin and for this assignment driver.name field starts from \"Andrew\", by assigned plugin field filtering\n  - **{exists(\"telemetry.can.vehicle.mileage\")}** - select devices for which parameter 'can.vehicle.mileage' is defined in their telemetry (was present in message at least once), by using expression for device telemetry existence check\n  - **{configuration.ident in (\"123456789012345\",\"987654321\")}** - select devices by specifying multiple ident values using the 'in' operator of flespi expressions\n\nSample API calls:\n  - **GET /gw/devices/all?fields=id,name** - select all available devices and return their id and name\n  - **GET /gw/devices/configuration.ident=\"123456789012345\"?fields=id,name** - select device with ident=\"123456789012345\" in their configuration and return their id and name\n  - **GET /gw/devices/blocked!=0?fields=id,name,blocked** - select devices that are currently blocked (non-zero blocked field) return their id, name and block code\n  - **GET /gw/devices/{exists(\"telemetry.can.vehicle.mileage\")||exists(\"telemetry.vehicle.mileage\")}?fields=id,name,telemetry** - select devices that are has can.vehicle.mileage or vehicle.mileage parameters in their telemetry and return their id, name and all telemetry parameters\n","in":"path","items":{"type":"string"},"name":"dev-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/device"},"x-view-selector":"devices"},"device.fields":{"collectionFormat":"csv","description":"All possible fields available for the device.\nDevice ident (IMEI) is located in configuration field.\nIf this parameter is specified in the query path of API call each returned device will consists only from JSON object with specified fields.\nIf this parameter is not specified each device will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","enabled","device_type_id","device_type_name","protocol_id","protocol_name","configuration","commands","messages_size","messages_ttl","messages_rotate","media_size","media_ttl","media_rotate","media_traffic","messages","traffic","blocked","media_blocked","connected","last_active","cid","telemetry","settings","commands_queue","groups","plugins","streams","calcs","metadata","groups_count","streams_count","plugins_count","calcs_count","geofences_count","intervals_size","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/device"}},"device.geofences.fields":{"collectionFormat":"csv","description":"Fields available for response.","in":"query","items":{"enum":["auto_created","blocked","calcs","calcs_count","cid","created","device_id","devices","devices_count","enabled","geofence_id","geometry","groups","groups_count","metadata","name","plugins","plugins_count","priority","streams","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/device.geofence"}},"devices.commands-queue.fields":{"collectionFormat":"csv","description":"All possible fields available for the device command in the queue.\nIf this parameter is specified in the query path of API call each returned device command will consists only from JSON object with specified fields.\nIf this parameter is not specified each device command will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","command_id","name","device_id","properties","condition","priority","max_attempts","meta","expires","timestamp"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/devices.commands-queue.item"}},"devices.commands-queue.selector":{"collectionFormat":"csv","description":"Select device command in the queue for the API operation. Only commands that are located inside previously selected devices with 'dev-selector' are returned.\n\nCommands in the queue are ordered by the creation time.\n\nSome samples you may use in sett-selector:\n  - **all** - select all commands that are in queue for pre-selected devices, this is special selector format\n  - **1,2,3,4** - select commands with command_id 1,2,3 and 4 in the commands queue\n  - **name=\"XXX\\*\"** - select commands from the queue which name that starts from XXX, by field 'name' with wildcards\n\nSample API calls:\n  - **GET /gw/devices/all/commands-queue/name=\"ble\\*\"?fields=id,name,properties,timestamp** - select device queue commands which name starts from 'ble' for all available devices and return their id, name, properties information and creation timestamp\n  - **GET /gw/devices/1/commands-queue/all?fields=id,name,properties** - select all queued commands for device with ID 1 and return their id, name and actual properties\n","in":"path","items":{"type":"string"},"name":"devices.commands-queue.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/devices.commands-queue.item"},"x-view-selector":"devices"},"devices.commands.fields":{"collectionFormat":"csv","description":"All possible fields available for the return when executing realtime device command.\nIf this parameter is specified in the query path of API call each returned executed device command result will consists only from JSON object with specified fields.\nIf this parameter is not specified each executed device command result will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","command_id","device_id","timestamp","name","meta","executed","response"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/devices.commands.executed"}},"devtypes.fields":{"collectionFormat":"csv","description":"All possible fields available for the device type.\nThe most significant fields by which you reference device are 'protocol_name' that idenitifes protocol name and 'name' which defines device type name.\nIf this parameter is specified in the query path of API call each returned device type will consists only from JSON object with specified fields.\nIf this parameter is not specified each device type will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","protocol_id","protocol_name","name","title","settings","commands","configuration","features"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/device_type"}},"devtypes.selector":{"collectionFormat":"csv","description":"Select devices types for which to apply the API call. Available devices types already filtered by protocols specified in channel-protocols.selector in this API call path.\n\nSome samples of values that you can use in devtypes.selector parameter:\n  - **all** - select all possible device types\n  - **1,2,3,4** - select device types with ID 1,2,3 and 4\n  - **name=\"fmb001\"** - select \"fmb001\" device types only, by field 'name'\n  - **protocol_name=\"xxxx\"** - select devices only withing protocol \"xxxx\", by field 'protocol_name'\n  - **protocol_name=\"teltonika\",name=\"fmb003\"** - select \"fmb003\" device types only from protocol \"teltonika\", simultaneously by two fields 'name' and 'protocol_name'\n\n  The most significant fields to identify the device type are: 'protocol_name' to identify the protocol and 'name' - to identify the device within this protocol.\n","in":"path","items":{"type":"string"},"name":"devtypes.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/device_type"}},"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"},"geofence.fields":{"collectionFormat":"csv","description":"All possible fields available for the geofence.\nIf this parameter is specified in the query path of API call each returned geofence will consists only from JSON object with specified fields.\nIf this parameter is not specified each geofence will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","cid","name","enabled","priority","blocked","geometry","metadata","groups","plugins","calcs","streams","devices","calcs_count","plugins_count","groups_count","streams_count","devices_count","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/geofence"}},"geofences.selector":{"collectionFormat":"csv","description":"Select geofences for the API operation.\n\nSome samples you may use in geofences.selector:\n  - **all** - select all geofences available for the user(token), this is special selector format\n  - **1,2,3,4** - select geofences with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select geofences which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select geofences which metadata has parameter 'clientid' with value 4, by [geofence metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n\nSample API calls:\n  - **GET /gw/geofences/all?fields=id,name** - select all available geofences and return their id and name\n  - **GET /gw/geofences/name=\"my-geofence\"?fields=id,name** - select geofence with name=\"my-geofence\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"geofences.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/geofence"},"x-view-selector":"geofences"},"group.assets.fields":{"collectionFormat":"csv","description":"Fields available for response.","in":"query","items":{"enum":["active","asset_id","auto_created","blocked","calcs_count","cid","created","device_id","enabled","group_id","groups_count","intervals_ttl","last","metadata","name","priority","size"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/group.asset"}},"group.assets.selector":{"collectionFormat":"csv","description":"Select [assets](https://flespi.com/kb/assets-management-and-usage) for the API operation.\n\nSome samples you may use in assets.selector:\n  - **all** - select all assets available for the user(token), this is special selector format\n  - **1,2,3,4** - select assets with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select assets which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select assets which metadata has parameter 'clientid' with value 4, by [asset metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select assets which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n\nSample API calls:\n  - **GET /gw/groups/all/assets/all?fields=asset_id,name** - select all available assets and return their id and name\n  - **GET /gw/groups/all/assets/name=\"my-asset\"?fields=asset_id,name** - select asset with name=\"my-asset\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"group.assets.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/group.asset"},"x-view-selector":"devices"},"group.devices.fields":{"collectionFormat":"csv","description":"All possible fields available for the device assigned to group.\nDevice ident (IMEI) is located in configuration field.\nIf this parameter is specified in the query path of API call each returned assigned device will consists only from JSON object with specified fields.\nIf this parameter is not specified each assigned device will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["auto_created","blocked","calcs","calcs_count","cid","commands","commands_queue","configuration","connected","created","device_id","device_type_id","device_type_name","enabled","geofences_count","group_id","groups","groups_count","last_active","media_blocked","media_rotate","media_size","media_traffic","media_ttl","messages","messages_rotate","messages_size","messages_ttl","metadata","name","plugins","plugins_count","protocol_id","protocol_name","settings","streams","streams_count","intervals_size","telemetry","traffic"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/group.device"}},"group.devices.selector":{"collectionFormat":"csv","description":"Select [devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker) for the API operation.\n\nSome samples you may use in group.devices.selector:\n  - **all** - select all devices available for the user(token), this is special selector format\n  - **1,2,3,4** - select devices with ID 1,2,3 and 4, this is special selector format\n  - **configuration.ident=\"123456789012345\"** - select devices by ident '123456789012345' (IMEI), by sub-field 'ident' inside field 'configuration'\n  - **name=\"XXX\\*\"** - select devices which name starts from XXX, by field 'name' with wildcards\n  - **connected=true** - select devices that are currently connected to flespi channel, by field 'connected'\n  - **groups.id=1234** - select devices which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n  - **plugins.fields.driver.name=\"Andrew\\*\"** - select devices that are assigned to 'item-fields' plugin and for this assignment driver.name field starts from \"Andrew\", by assigned plugin field filtering\n  - **{configuration.ident in (\"123456789012345\",\"78901234545565677\")}** - select devices by multiple idents using the 'in' operator of flespi expressions\n\nSample API calls:\n  - **GET /gw/groups/all/devices/all?fields=device_id,group_id** - for all available groups select all assigned devices and return their device id and group id\n  - **GET /gw/groups/all/devices/configuration.ident=\"123456789012345\"?fields=device_id,groups_id** - for all available groups select only those to which assigned device with ident=\"123456789012345\" in their configuration and return device id and group id\n  - **GET /gw/groups/123/devices/333?fields=telemetry,last_active** - for group with id 123 fetch assigned device with id 333 and return its telemetry and last_active timestamp\n","in":"path","items":{"type":"string"},"name":"group.devices.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/group.device"},"x-view-selector":"devices"},"group.fields":{"collectionFormat":"csv","description":"All possible fields available for the group.\nIf this parameter is specified in the query path of API call each returned group will consists only from JSON object with specified fields.\nIf this parameter is not specified each group will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","cid","name","blocked","metadata","devices_count","calcs_count","plugins_count","streams_count","geofences_count","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/group"}},"group.geofences.fields":{"collectionFormat":"csv","description":"Fields available for response.","in":"query","items":{"enum":["auto_created","blocked","calcs","calcs_count","cid","created","devices","devices_count","enabled","geofence_id","geometry","group_id","groups","groups_count","metadata","name","plugins","plugins_count","priority","streams","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/group.geofence"}},"group.geofences.selector":{"collectionFormat":"csv","description":"Select [geofences](https://flespi.com/kb/geofences-management-and-usage) for the API operation.\n\nSome samples you may use in geofences.selector:\n  - **all** - select all geofences available for the user(token), this is special selector format\n  - **1,2,3,4** - select geofences with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select geofences which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select geofences which metadata has parameter 'clientid' with value 4, by [geofence metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select geofences which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n\nSample API calls:\n  - **GET /gw/groups/all/geofences/all?fields=geofence_id,name** - select all available geofences and return their id and name\n  - **GET /gw/groups/all/geofences/name=\"my-geofence\"?fields=geofence_id,name** - select geofence with name=\"my-geofence\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"group.geofences.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/group.geofence"},"x-view-selector":"devices"},"groups.selector":{"collectionFormat":"csv","description":"Select [groups](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) for the API operation.\n\nSome samples you may use in groups.selector:\n  - **all** - select all groups available for the user(token), this is special selector format\n  - **1,2,3,4** - select groups with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select groups which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select groups which metadata has parameter 'clientid' with value 4, by [group metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n\nSample API calls:\n  - **GET /gw/groups/all?fields=id,name** - select all available groups and return their id and name\n  - **GET /gw/groups/name=\"my-group\"?fields=id,name** - select group with name=\"my-group\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"groups.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/group"},"x-view-selector":"groups"},"limit":{"description":"Maximum number of items to return.\n","in":"query","name":"limit","required":false,"type":"integer"},"media-file-uuid":{"description":"UUID of the media file to access","in":"path","name":"media-file-uuid","required":true,"schema":{"$ref":"#/definitions/media.file.uuid"}},"media-preview":{"description":"media file preview","enum":["jpeg","json"],"in":"query","name":"preview","type":"string"},"message-parameter.fields":{"collectionFormat":"csv","description":"All possible fields available for the message parameter.\nIf this parameter is specified in the query path of API call each returned message type will consists only from JSON object with specified fields.\nIf this parameter is not specified each message type will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","info","unit","type"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/message_parameter"}},"message-parameter.selector":{"collectionFormat":"csv","description":"Select message parameters which to return in the API call.\n\nSome samples of values that you can use in message-parameter.selector parameter:\n  - **all** - return all possible message parameters\n  - **1,2,3,4** - return message parameters with ID 1,2,3 and 4\n  - **name=\"din\"** - return message parameter which name is \"din\", by field 'name'\n  - **unit=\"V\"** - return only message parameters which unit is \"V\", by field 'unit'\n  - **name=\"vehicle*\",unit=\"km\"** - return message parameters which name starts from \"vehicle\" (wildcards applied to filter) and which unit is \"km\", simultaneously by fields 'name' and 'unit'\n  - **line.enter.alarm,line.exit.alarm** - return message parameters which names are 'line.enter.alarm' and 'line.exit.alarm' (special selection format by name)\n","in":"path","items":{"type":"string"},"name":"message-parameter.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/message_parameter"}},"modem-fields":{"collectionFormat":"csv","description":"All possible fields available for the modem.\nIf this parameter is specified in the query path of API call each returned modem will consists only from JSON object with specified fields.\nIf this parameter is not specified each modem will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","enabled","connected","configuration","priority","blocked","cid","metadata","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/modem"}},"modem-selector":{"collectionFormat":"csv","description":"Select [modem](https://flespi.com/kb/modem-instance-to-send-sms) for the API operation.\n\nSome samples you may use in modem-selector:\n  - **all** - select all modems available for the user(token), this is special selector format\n  - **1,2,3,4** - select modems with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select modems which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select modems which metadata has parameter 'clientid' with value 4, by [modem metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **{cid=123 || cid=456}** - select modems from subaccounts with id 123 and 456, by using expression and 'cid' field (subaccount assignment)\n\nSample API calls:\n  - **GET /gw/modems/all?fields=id,name** - select all available modems and return their id and name\n  - **GET /gw/modems/1?fields=id,name,configuration** - select modem with ID 1 and return its id, name and configuration\n","in":"path","items":{"type":"string"},"name":"modem-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/modem"},"x-view-selector":"modems"},"offset":{"description":"Number of items to skip before starting to return results.\n","in":"query","name":"offset","required":false,"type":"integer"},"plugin-type.fields":{"collectionFormat":"csv","description":"All possible fields available for the plugin type.\nIf this parameter is specified in the query path of API call each returned plugin type will consists only from JSON object with specified fields.\nIf this parameter is not specified each plugin type will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","description","changelog","configuration","item_types"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/plugin-type"}},"plugin-types.selector":{"collectionFormat":"csv","description":"Select plugin types which to return in the API call.\n\nSome samples of values that you can use in plugin-types.selector parameter:\n  - **all** - return all possible plugin types\n  - **1,2,3,4** - return plugin types with ID 1,2,3 and 4\n  - **item-fields** - return plugin type which name is \"item-fields\", by field 'name'\n  - **name=\"*geocoding**\" - return plugin types which name ends with \"geocoding\", by field 'name' with wildcards\n","in":"path","items":{"type":"string"},"name":"plugin-types.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/plugin-type"}},"plugin.devices.fields":{"collectionFormat":"csv","description":"All possible fields available for the device assigned to plugin.\nDevice ident (IMEI) is located in configuration field.\nIf this parameter is specified in the query path of API call each returned assigned device will consists only from JSON object with specified fields.\nIf this parameter is not specified each assigned device will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["auto_created","blocked","calcs","calcs_count","cid","commands","commands_queue","configuration","connected","created","device_id","device_type_id","device_type_name","enabled","fields","geofences_count","groups","groups_count","last_active","media_blocked","media_rotate","media_size","media_traffic","media_ttl","messages","messages_rotate","messages_size","messages_ttl","metadata","name","plugin_id","plugins","plugins_count","protocol_id","protocol_name","settings","streams","streams_count","intervals_size","telemetry","traffic"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/plugin.device"}},"plugin.devices.selector":{"collectionFormat":"csv","description":"Select [devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker) for the API operation.\n\nSome samples you may use in plugin.devices.selector:\n  - **all** - select all devices available for the user(token), this is special selector format\n  - **1,2,3,4** - select devices with ID 1,2,3 and 4, this is special selector format\n  - **configuration.ident=\"123456789012345\"** - select devices by ident '123456789012345' (IMEI), by sub-field 'ident' inside field 'configuration'\n  - **name=\"XXX\\*\"** - select devices which name starts from XXX, by field 'name' with wildcards\n  - **connected=true** - select devices that are currently connected to flespi channel, by field 'connected'\n  - **groups.id=1234** - select devices which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n  - **plugins.fields.driver.name=\"Andrew\\*\"** - select devices that are assigned to 'item-fields' plugin and for this assignment driver.name field starts from \"Andrew\", by assigned plugin field filtering\n\nSample API calls:\n  - **GET /gw/plugins/all/devices/all?fields=device_id,plugin_id** - for all available plugins select all assigned devices and return their device id and plugin id\n  - **GET /gw/plugins/all/devices/configuration.ident=\"123456789012345\"?fields=device_id,plugin_id** - for all available plugins select only those to which assigned device with ident=\"123456789012345\" in their configuration and return device id and plugin id\n  - **GET /gw/plugins/123/devices/333?fields=fields,telemetry,last_active** - for plugins with id 123 fetch assigned device with id 333 and return its fields, telemetry and last_active timestamp\n","in":"path","items":{"type":"string"},"name":"plugin.devices.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/plugin.device"},"x-view-selector":"devices"},"plugin.fields":{"collectionFormat":"csv","description":"All possible fields available for the plugin.\nIf this parameter is specified in the query path of API call each returned plugin will consists only from JSON object with specified fields.\nIf this parameter is not specified each plugin will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","cid","name","enabled","item_type","item_schema","blocked","validate_message","required","timezone","priority","configuration","type_id","type_name","metadata","devices_count","groups_count","geofences_count","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/plugin"}},"plugin.geofences.fields":{"collectionFormat":"csv","description":"Fields available for response.","in":"query","items":{"enum":["auto_created","blocked","calcs","calcs_count","cid","created","devices","devices_count","enabled","geofence_id","geometry","groups","groups_count","metadata","name","plugin_id","plugins","plugins_count","priority","streams","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/plugin.geofence"}},"plugin.geofences.selector":{"collectionFormat":"csv","description":"Select [geofences](https://flespi.com/kb/geofences-management-and-usage) for the API operation.\n\nSome samples you may use in geofences.selector:\n  - **all** - select all geofences available for the user(token), this is special selector format\n  - **1,2,3,4** - select geofences with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select geofences which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select geofences which metadata has parameter 'clientid' with value 4, by [geofence metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select geofences which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n\nSample API calls:\n  - **GET /gw/plugins/all/geofences/all?fields=geofence_id,name** - select all available geofences and return their id and name\n  - **GET /gw/plugins/all/geofences/name=\"my-geofence\"?fields=geofence_id,name** - select geofence with name=\"my-geofence\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"plugin.geofences.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/plugin.geofence"},"x-view-selector":"devices"},"plugin.group.fields":{"collectionFormat":"csv","description":"Fields that are available in plugin group assignment.\n","in":"query","items":{"enum":["auto_created","blocked","calcs_count","cid","created","devices_count","fields","geofences_count","group_id","metadata","name","plugin_id","plugins_count","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/plugin.group"}},"plugin.groups.selector":{"collectionFormat":"csv","description":"Select [groups](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) for the API operation.\n\nSome samples you may use in plugin.groups.selector:\n  - **all** - select all groups available for the user(token), this is special selector format\n  - **1,2,3,4** - select groups with ID 1,2,3 and 4, this is special selector format\n\nSample API calls:\n  - **GET /gw/plugins/all/groups/all** - for all available plugins select all assigned groups\n","in":"path","items":{"type":"string"},"name":"plugin.groups.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/plugin.group"},"x-view-selector":"groups"},"plugin.selector":{"collectionFormat":"csv","description":"Select [plugin](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices) for the API operation.\n\nSome samples you may use in plugin.selector:\n  - **all** - select all plugins available for the user(token), this is special selector format\n  - **1,2,3,4** - select plugins with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select plugins which name starts from XXX, by field 'name' with wildcards\n  - **type_name=\"YYY\"** - select plugins of type 'YYY'\n  - **metadata.clientid=4** - select plugins which metadata has parameter 'clientid' with value 4, by [plugin metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **{cid=123 || cid=456}** - select plugins from subaccounts with id 123 and 456, by using expression and 'cid' field (subaccount assignment)\n\nSample API calls:\n  - **GET /gw/plugins/all?fields=id,name,configuration** - select all available plugins and return their id, name and configuration\n  - **GET /gw/plugins/1?fields=id,name,configuration,priority,type_name** - select plugin with ID 1 and return its id, name, configuration, priority and plugin type name\n","in":"path","items":{"type":"string"},"name":"plugin.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/plugin"},"x-view-selector":"plugins"},"sett-selector":{"collectionFormat":"csv","description":"Select device settings for the API operation. Only settings that are located inside previously selected devices with 'dev-selector' are returned.\n\nSome samples you may use in sett-selector:\n  - **all** - select all settings available for pre-selected devices, this is special selector format\n  - **1,2,3,4** - select settings with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select settings which name that starts from XXX, by field 'name' with wildcards\n  - **tab=\"CAN\"** - select settings that are located on 'CAN' tab, by field 'tab'\n  - **{name==\"setting1\"||name==\"setting2\"||name==\"setting3\"}** - select 3 settings with name 'setting1', 'setting2' and 'setting3', special alias to select multiple settings by the same 'name' field\n\nSample API calls:\n  - **GET /gw/devices/all/settings/name=\"ble\\*\"?fields=id,name,schema,current,pending** - select settings which name starts from 'ble' for all available devices and return their id, name, JSON schema, current and pending values\n  - **GET /gw/devices/1/settings/all?fields=id,name,schema** - select all settings for device with ID 1 and return their id, name, JSON schema\n","in":"path","items":{"type":"string"},"name":"sett-selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/setting"}},"settings.fields":{"collectionFormat":"csv","description":"All possible fields available for the device setting.\nSettings are usually identified by name which is unique for given device type.\nIf this parameter is specified in the query path of API call each returned device setting will consists only from JSON object with specified fields.\nIf this parameter is not specified each device setting will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["name","device_id","updated","schema","current","pending","address","mode","status","tab","tags","commands"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/setting"}},"stream-channel-protocol.fields":{"collectionFormat":"csv","description":"All possible fields available for the stream protocol.\nIf this parameter is specified in the query path of API call each returned stream protocol will consists only from JSON object with specified fields.\nIf this parameter is not specified each stream protocol will be returned as JSON object with default fields.\nField descriptions are described in x-selector-fields-description.\n","in":"query","items":{"enum":["id","name","description","changelog","configuration"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/stream-protocol"}},"stream-protocols.selector":{"collectionFormat":"csv","description":"Select stream protocols which to return in the API call.\n\nSome samples of values that you can use in stream-protocols.selector parameter:\n  - **all** - return all possible stream protocols\n  - **1,2,3,4** - return stream protocols with ID 1,2,3 and 4\n  - **wialon-retranslator** - return stream protocol which name is \"wialon-retranslator\", by field 'name'\n  - **name=\"wialon-*\"** - return stream protocols which name starts from \"wialon\", by field 'name' with wildcards\n","in":"path","items":{"type":"string"},"name":"stream-protocols.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/stream-protocol"}},"stream.channels.fields":{"collectionFormat":"csv","description":"All possible fields available for the channel subscribed to stream.\nIf this parameter is specified in the query path of API call each returned subscribed channel will consists only from JSON object with specified fields.\nIf this parameter is not specified each subscribed channel will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["auto_created","blocked","channel_id","cid","configuration","connections_count","created","enabled","idents","messages","messages_size","messages_ttl","metadata","name","protocol_features","protocol_id","protocol_name","secondary_uri","stream_id","streams_count","traffic","udp_packets","uri"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/stream.channel"}},"stream.channels.selector":{"collectionFormat":"csv","description":"Select [channels](https://flespi.com/kb/channel-entry-point-to-gateway) for the API operation.\n\nSome samples you may use in stream.channels.selector:\n  - **all** - select all channels available for the user(token), this is special selector format\n  - **1,2,3,4** - select channels with ID 1,2,3 and 4, this is special selector format\n\nSample API calls:\n  - **GET /gw/streams/all/channels/all?fields=channel_id,stream_id** - for all available streams select all subscribed devices and return their device id and channel id\n  - **GET /gw/streams/123/devices/333** - for stream with id 123 fetch subscribed channel with id 333 and return it with default fields\n","in":"path","items":{"type":"string"},"name":"stream.channels.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/stream.channel"},"x-view-selector":"channels"},"stream.devices.fields":{"collectionFormat":"csv","description":"All possible fields available for the device subscribed to stream.\nDevice ident (IMEI) is located in configuration field.\nIf this parameter is specified in the query path of API call each returned subscribed device will consists only from JSON object with specified fields.\nIf this parameter is not specified each subscribed device will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["auto_created","blocked","calcs","calcs_count","cid","commands","commands_queue","configuration","connected","created","device_id","device_type_id","device_type_name","enabled","geofences_count","groups","groups_count","last_active","media_blocked","media_rotate","media_size","media_traffic","media_ttl","messages","messages_rotate","messages_size","messages_ttl","metadata","name","plugins","plugins_count","protocol_id","protocol_name","settings","stream_id","streams","streams_count","intervals_size","telemetry","traffic"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/stream.device"}},"stream.devices.selector":{"collectionFormat":"csv","description":"Select [devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker) for the API operation.\n\nSome samples you may use in stream.devices.selector:\n  - **all** - select all devices available for the user(token), this is special selector format\n  - **1,2,3,4** - select devices with ID 1,2,3 and 4, this is special selector format\n  - **configuration.ident=\"123456789012345\"** - select devices by ident '123456789012345' (IMEI), by sub-field 'ident' inside field 'configuration'\n  - **name=\"XXX\\*\"** - select devices which name starts from XXX, by field 'name' with wildcards\n  - **connected=true** - select devices that are currently connected to flespi channel, by field 'connected'\n  - **groups.id=1234** - select devices which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n  - **plugins.fields.driver.name=\"Andrew\\*\"** - select devices that are assigned to 'item-fields' plugin and for this assignment driver.name field starts from \"Andrew\", by assigned plugin field filtering\n\nSample API calls:\n  - **GET /gw/streams/all/devices/all?fields=device_id,stream_id** - for all available streams select all assigned devices and return their device id and stream id\n  - **GET /gw/streams/all/devices/configuration.ident=\"123456789012345\"?fields=device_id,stream_id** - for all available stream select only those to which assigned device with ident=\"123456789012345\" in their configuration and return device id and stream id\n  - **GET /gw/streams/123/devices/333?fields=fields,telemetry,last_active** - for stream with id 123 fetch assigned device with id 333 and return its fields, telemetry and last_active timestamp\n","in":"path","items":{"type":"string"},"name":"stream.devices.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/stream.device"},"x-view-selector":"devices"},"stream.fields":{"collectionFormat":"csv","description":"All possible fields available for the stream.\nIf this parameter is specified in the query path of API call each returned stream will consists only from JSON object with specified fields.\nIf this parameter is not specified each stream will be returned as JSON object with default fields.\n","in":"query","items":{"enum":["id","name","queue_size","queue_ttl","configuration","protocol_id","protocol_name","connected","enabled","blocked","cid","validate_message","traffic","latency","errors","messages","metadata","devices_count","groups_count","geofences_count","channels_count","created"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/stream"}},"stream.geofences.fields":{"collectionFormat":"csv","description":"Fields available for response.","in":"query","items":{"enum":["auto_created","blocked","calcs","calcs_count","cid","created","devices","devices_count","enabled","geofence_id","geometry","groups","groups_count","metadata","name","plugins","plugins_count","priority","stream_id","streams","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/stream.geofence"}},"stream.geofences.selector":{"collectionFormat":"csv","description":"Select [geofences](https://flespi.com/kb/geofences-management-and-usage) for the API operation.\n\nSome samples you may use in geofences.selector:\n  - **all** - select all geofences available for the user(token), this is special selector format\n  - **1,2,3,4** - select geofences with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select geofences which name starts from XXX, by field 'name' with wildcards\n  - **metadata.clientid=4** - select geofences which metadata has parameter 'clientid' with value 4, by [geofence metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **groups.id=1234** - select geofences which belong to group with id=1234, by [group](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) assignment\n\nSample API calls:\n  - **GET /gw/streams/all/geofences/all?fields=geofence_id,name** - select all available geofences and return their id and name\n  - **GET /gw/streams/all/geofences/name=\"my-geofence\"?fields=geofence_id,name** - select geofence with name=\"my-geofence\" and return their id and name\n","in":"path","items":{"type":"string"},"name":"stream.geofences.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/stream.geofence"},"x-view-selector":"devices"},"stream.groups.fields":{"collectionFormat":"csv","description":"Fields that are available in stream group subscription.\n","in":"query","items":{"enum":["auto_created","blocked","calcs_count","cid","created","devices_count","geofences_count","group_id","metadata","name","plugins_count","stream_id","streams_count"],"type":"string"},"name":"fields","required":false,"type":"array","x-flespi-fields-description":{"$ref":"#/definitions/stream.group"}},"stream.groups.selector":{"collectionFormat":"csv","description":"Select [groups](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) for the API operation.\n\nSome samples you may use in stream.groups.selector:\n  - **all** - select all groups available for the user(token), this is special selector format\n  - **1,2,3,4** - select groups with ID 1,2,3 and 4, this is special selector format\n\nSample API calls:\n  - **GET /gw/streams/all/groups/all** - for all available streams select all subscribed groups\n","in":"path","items":{"type":"string"},"name":"stream.groups.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/stream.group"},"x-view-selector":"groups"},"stream.selector":{"collectionFormat":"csv","description":"Select [stream](https://flespi.com/kb/stream-forward-data-from-gateway) for the API operation.\n\nSome samples you may use in stream.selector:\n  - **all** - select all streams available for the user(token), this is special selector format\n  - **1,2,3,4** - select streams with ID 1,2,3 and 4, this is special selector format\n  - **name=\"XXX\\*\"** - select streams which name starts from XXX, by field 'name' with wildcards\n  - **protocol_name=\"YYY\"** - select streams operating with protocol named 'YYY'\n  - **metadata.clientid=4** - select streams which metadata has parameter 'clientid' with value 4, by [stream metadata](https://flespi.com/kb/metadata-entitys-custom-info)\n  - **{cid=123 || cid=456}** - select streams from subaccounts with id 123 and 456, by using expression and 'cid' field (subaccount assignment)\n\nSample API calls:\n  - **GET /gw/streams/all?fields=id,name,configuration,protocol_name** - select all available streams and return their id, name, configuration and protocol name\n  - **GET /gw/streams/1?fields=id,name,configuration,protocol_id** - select stream with ID 1 and return its id, name, configuration and protocol ID\n","in":"path","items":{"type":"string"},"name":"stream.selector","required":true,"type":"array","x-flespi-allowed-fields-in-selectors":{"$ref":"#/definitions/stream"},"x-view-selector":"streams"},"telemetry-selector":{"collectionFormat":"csv","description":"Select device telemetry fields for the API call. Comma-separated list of telemetry fields selected for the operation. Wildcards in field name specification are not supported.\n\nTelemetry fields are automatically created from corresponding message parameters during device message registration.\nMessage parameter 'timestamp' will correspond to telemetry field 'timestamp'. Message parameter 'position.latitude' will correspond to telemetry field 'position.latitude' and so on.\n\nSpecial telemetry field 'position' is a JSON object that consists from all message parameters which name starts from position.\nThis is special telemetry field with combined position information gathered from message parameters into single telemetry field.\n\nSome samples of values that you can use in telemetry-selector parameter:\n  - **all** - select all telemetry fields\n  - **position.latitude,position.longitude** - only select telemetry fields with name position.latitude and position.longitude.\n  - **position** - only select telemetry field with name position, whithin this field you usually receive JSON object: {\"latitude\": X, \"longitude\": Y, \"speed\": Z, \"satellites\": P}\n\nSample API calls:\n  - **GET /gw/devices/all/telemetry/timestamp,server.timestamp** - fetch 'timestamp' and 'server.timestamp' telemetry values for all devices\n  - **GET /gw/devices/1,2,3/telemetry/all** - fetch all telemetry values for devices with id 1, 2 and 3\n","in":"path","items":{"type":"string"},"name":"telemetry-selector","required":true,"type":"array"}},"paths":{"/assets":{"post":{"description":"Create new asset with specified configuration parameters. You pass JSON array with configuration objects - one object per each asset to create.\nCall format: **POST /gw/assets?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created asset\n","parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/asset.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/assets.post"}}],"responses":{"200":{"description":"Assets collection","schema":{"$ref":"#/definitions/assets.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 new asset","tags":["assets"],"x-flespi-extra-parameters":{"grant-access":"create-assets"},"x-view-group":"Manage"}},"/assets/{assets.selector}":{"delete":{"description":"The method will permanently delete selected assets to which current user(token) has access to.\nAny existing item bindings to the asset will also be removed. Use with caution!\n\nUse special keyword \"all\" to delete all assets available for current user(token). Specify filtering conditions within path in 'assets.selector' to delete only assets that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for assets that will be updated by calling corresponding GET method.\n\nCall format: **DELETE /gw/assets/{assets.selector}**\n","parameters":[{"$ref":"#/parameters/assets.selector"}],"responses":{"200":{"description":"Assets 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":"Delete selected assets","tags":["assets"],"x-view-group":"Manage"},"get":{"description":"Get collection of assets available for user(token).\n\nUse special keyword \"all\" to retrieve all assets. Specify filtering conditions within path in 'assets.selector' to retrieve only assets that conforms to specified criterias.\n\nCall format: **GET /gw/assets/{assets.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/assets.selector"},{"$ref":"#/parameters/asset.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Assets collection","schema":{"$ref":"#/definitions/assets.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":"List available assets","tags":["assets"],"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"}],"patch":{"description":"The patch method is similar to PUT method but it is used to update only specified keys of the item's JSON fields like metadata or configuration.\n\nCall format: **PATCH /gw/assets/{assets.selector}**.\n","parameters":[{"$ref":"#/parameters/assets.selector"},{"$ref":"#/parameters/asset.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/assets.put"}}],"responses":{"200":{"description":"Assets collection","schema":{"$ref":"#/definitions/assets.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":"Patch item properties","tags":["assets"],"x-view-group":"Manage"},"put":{"description":"Update specified properties for selected assets.\n\nUse special keyword \"all\" to select all assets available for current user(token) for update. Specify filtering conditions within path in 'assets.selector' to update only assets that conforms to specified criterias.\n\nBefore the update it is recommended to check for assets that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/assets/{assets.selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/assets.selector"},{"$ref":"#/parameters/asset.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/assets.put"}}],"responses":{"200":{"description":"Assets collection","schema":{"$ref":"#/definitions/assets.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":"Modify asset properties","tags":["assets"],"x-view-group":"Manage"}},"/assets/{assets.selector}/intervals":{"get":{"description":"Retrieve intervals of specified assets with time selection and, optionally, parameters and their values.\nIf parameters are not specified, all intervals of the asset will be retrieved.\nIf a single asset is specified in the assets.selector, the intervals in the returned array are sorted by start time, in the order specified by the reverse attribute.\nIf intervals are selected from multiple assets, they are sorted for each individual asset, but there is no sorting between the assets themselves.\n\nCall format: **GET /gw/assets/{assets.selector}/intervals**.\n","parameters":[{"description":"intervals listing parameters, when filtering by time intervals are selected from begin to end inclusive.","in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/asset.intervals.get"}}],"responses":{"200":{"description":"retrieved intervals","schema":{"$ref":"#/definitions/asset.intervals.result"}}},"security":[{"FlespiToken":[]}],"tags":["assets"],"x-view-group":"intervals"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/assets.selector"}],"post":{"description":"Register intervals into selected assets.\n\nintervals overlapping with a registered and older timestamps will be automatically finished or replaced.\n\nCall format: **POST /gw/assets/{assets.selector}/intervals**.\n","parameters":[{"description":"additional interval parameters","in":"body","name":"data","required":true,"schema":{"anyOf":[{"$ref":"#/definitions/asset.interval.post"},{"items":{"$ref":"#/definitions/asset.interval.post"},"maxItems":1000,"minItems":1,"type":"array"}]}}],"responses":{"200":{"description":"asset IDs into which intervals where registered","schema":{"$ref":"#/definitions/asset.intervals.result"}},"400":{"description":"incorrect parameters"}},"security":[{"FlespiToken":[]}],"tags":["assets"],"x-view-group":"intervals"}},"/assets/{assets.selector}/logs":{"get":{"description":"Get specified asset logs. The request without parameters will return all asset logs.\n\n'assets.selector' specifies selection of assets from which to retrieve logs. You may select 'all' assets or select them by ID, name and other criterias specified in assets.selector.\n\nReply contains asset logs sorted by timestamp, in case you request logs from multiple assets sort order is not preserved.\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 asset logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in asset 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 /gw/assets/{assets.selector}/logs**.\n","parameters":[{"$ref":"#/parameters/assets.selector"},{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve asset logs","tags":["assets"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"}]},"/assets/{assets.selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified asset.\n\nCall format: **GET /gw/assets/{assets.selector}/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 asset logs","tags":["assets"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/assets.selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/assets/{assets.selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified asset.\n\nCall format: **POST /gw/assets/{assets.selector}/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 asset logs","tags":["assets"],"x-view-group":"Utils"}},"/calcs":{"post":{"description":"Create new calculator with specified [calculation parameters](https://flespi.com/kb/analytics-reports-and-events-engine#calculators). You pass JSON array with configuration objects - one object per each calculator to create.\n\nCalculator define the rules on how to generate intervals from device messages. You define these rules in [intervals selectors](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors).\nThe math with rules how to calculate device messages within generated intervals you define with [interval counters](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters).\n\nCall format: **POST /gw/calcs?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created calculator\n","parameters":[{"$ref":"#/parameters/calc.fields"},{"$ref":"#/parameters/cid-header"},{"in":"body","name":"data","required":true,"schema":{"items":{"$ref":"#/definitions/calc.post"},"maxItems":1000,"minItems":1,"type":"array"}}],"responses":{"200":{"description":"created calculators collection","schema":{"$ref":"#/definitions/calcs"}},"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 calculator configuration","tags":["calculators"],"x-flespi-extra-parameters":{"grant-access":"create-calcs","subitem-acl":"gw/calcs"},"x-view-group":"Manage"}},"/calcs/{calcs.selector}":{"delete":{"description":"Delete selected [calculator](https://flespi.com/kb/analytics-reports-and-events-engine#calculators).\n\nThis call also automatically deletes all intervals from devices assigned to the calculator. Use with caution!\n\nUse special keyword \"all\" to delete all calculators. Specify filtering conditions within path in 'calcs.selector' to delete only calculators that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for calculators that will be deleted by calling corresponding GET method.\n\nCall format: **DELETE /gw/calcs/{calcs.selector}**.\n","responses":{"200":{"description":"deleted calculators ID's 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":"Delete calculator and all calculated intervals from assigned devices","tags":["calculators"],"x-view-group":"Manage"},"get":{"description":"Get collection of calculators available for user(token). With this call you retrieve [calculator configuration](https://flespi.com/kb/analytics-reports-and-events-engine#calculators), not the intervals generated by them.\n\nTo retrieve intervals generated by this configuration for particular device use **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}** call calculator ID specified in calcs.selector.\n\nUse special keyword \"all\" to retrieve all calculators. Specify filtering conditions within path in 'calcs.selector' to retrieve only calculators that conforms to specified criterias.\n\nCall format: **GET /gw/calcs/{calcs.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/calc.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Calculators collection","schema":{"$ref":"#/definitions/calcs"}},"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 calculator configuration","tags":["calculators"],"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"}],"patch":{"description":"The patch method is similar to PUT method but it is used to update only specified keys of the item's JSON fields like metadata or configuration.\n\nCall format: **PATCH /gw/calcs/{calcs.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/calc.put"}}],"responses":{"200":{"description":"Calculators collection","schema":{"$ref":"#/definitions/calcs"}},"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":"Patch item properties","tags":["calculators"],"x-flespi-extra-parameters":{"subitem-acl":"gw/calcs"},"x-view-group":"Manage"},"put":{"description":"Update selected [calculator configuration](https://flespi.com/kb/analytics-reports-and-events-engine#calculators).\n\nBe aware that whenever the calculator configuration changes - or the geofences, assets or device metadata it uses change - the system will recalculate intervals for assigned devices within 'update_period' time and thus may modify them.\nYou control such behaviour with 'update_onchange' field in calculator properties.\n\nUse special keyword \"all\" to update all calculators. Specify filtering conditions within path in 'calcs.selector' to update only calculators that conforms to specified criterias.\n\nBefore the update it is recommended to check for calculators that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/calcs/{calcs.selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/calc.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/calc.put"}}],"responses":{"200":{"description":"Calculators collection","schema":{"$ref":"#/definitions/calcs"}},"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":"Update calculator configuration","tags":["calculators"],"x-flespi-extra-parameters":{"subitem-acl":"gw/calcs"},"x-view-group":"Manage"}},"/calcs/{calcs.selector}/assets/{calc.assets.selector}":{"delete":{"description":"Unassign assets from selected calc. Once assets are unassigned from the calc they will also may be unassigned from corresponding streams, calculators, plugins.\nUse with caution!\n\nSpecify calcs from which to unassign assets within path in 'calcs.selector' parameter.\nSpecify assets which to unassign from calcs within path in 'calc.assets.selector' parameter.\n\nBefore the unassignment it is recommended to check for calcs and assets that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/calcs/{calcs.selector}/assets/{calc.assets.selector}**.\n","responses":{"200":{"description":"IDs of unassigned assets","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":"Unassign assets from calc","tags":["calculators","assets"],"x-flespi-extra-parameters":{"subitem-acl":"gw/assets"},"x-view-group":"Assigned assets"},"get":{"description":"Retrieve assets that are assigned to selected calc.\n\nSpecify calcs for which to retrieve assigned assets within path in 'calcs.selector' parameter.\nSpecify assets which within path in 'calc.assets.selector' parameter or use special value 'all' to retrieve all assets that are in selected calcs.\n\nCall format: **GET /gw/calcs/{calcs.selector}/assets/{calc.assets.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.assets.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/calc.assets"}},"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 assets in calc","tags":["calculators","assets"],"x-flespi-extra-parameters":{"subitem-acl":"gw/assets"},"x-view-group":"Assigned assets"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.assets.selector"}],"post":{"description":"Assign assets to selected calc.\n\nSpecify calcs to which assign assets within path in 'calcs.selector' parameter.\nSpecify assets which to assign to calcs within path in 'calc.assets.selector' parameter.\n\nCall format: **POST /gw/calcs/{calcs.selector}/assets/{calc.assets.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.assets.fields"}],"responses":{"200":{"description":"Collection of assets binded to calc","schema":{"$ref":"#/definitions/calc.assets"}},"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":"Assign assets to calc","tags":["calculators","assets"],"x-flespi-extra-parameters":{"subitem-acl":"gw/assets"},"x-view-group":"Assigned assets"},"put":{"description":"Modify data associated with assets assigned to calc.\n\nSelect calcs within path in 'calcs.selector' parameter. Specify assets within path in 'calc.assets.selector' parameter.\n\nCall format: **PUT /gw/calcs/{calcs.selector}/assets/{calc.assets.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.assets.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/asset.subitem.put"}}],"responses":{"200":{"description":"Updated assets collection","schema":{"$ref":"#/definitions/calc.assets"}},"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":"Modify asset data for calc","tags":["calculators","assets"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/assets"},"x-view-group":"Assigned assets"}},"/calcs/{calcs.selector}/devices/{calc.devices.selector}":{"delete":{"description":"[Unassign device from calculator](https://flespi.com/kb/analytics-reports-and-events-engine#calculators) and permanently remove their calculated intervals. Use with caution!\n\nSpecify calculators from which unassign devices within path in 'calcs.selector' parameter.\nSpecify devices which to unassign from calculators within path in 'calc.devices.selector' parameter.\n\nBefore the deletion it is recommended to check for affected devices and calculators by calling corresponding GET method.\n\nCall format: **DELETE /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}**.\n","responses":{"200":{"description":"IDs of unassigned devices","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":"Unassign device from calculator","tags":["calculators"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"get":{"description":"Retrieve a list of devices [assigned to calculator](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices).\n\nSelect calculators within path in 'calcs.selector' parameter. Specify devices within path in 'calc.devices.selector' parameter.\n\nCall format: **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.device.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Calculator devices collection","schema":{"$ref":"#/definitions/calc.device"}},"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":"List devices assigned to calculator","tags":["calculators"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.devices.selector"}],"put":{"description":"Modify configuration of devices [assigned to calculator](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices).\n\nSelect calculators within path in 'calcs.selector' parameter. Specify devices within path in 'calc.devices.selector' parameter.\n\nCall format: **PUT /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.device.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/calc.device.put"}}],"responses":{"200":{"description":"Updated devices collection","schema":{"$ref":"#/definitions/calc.devices"}},"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":"Modify configuration of device assignment to calculator","tags":["calculators"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"}},"/calcs/{calcs.selector}/devices/{calc.devices.selector}/calculate":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.devices.selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/calculate** instead.\n\nSpecial mode of applying [interval selectors](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors) and [counters](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters) to split intervals on higher level intervals and calculate them accordingly.\n\nYou may use this call to perform quick aggregation over already precalculated device intervals.\nFor example if your calculator defines device trips with this call you may aggregate them on a monthly basis and calculate combined stats for each month.\n\nBecause the call will source trips that are already calculated by coresponding [calculator](https://flespi.com/kb/analytics-reports-and-events-engine#calculators) the\nexecution of such API call is super quick.\n\n'calcs.selector' and 'dev-selector' specify selection of calculators and devices which intervals to aggregate.\nTheir assignment should be previously made with the call **POST /gw/calcs/{calcs.selector}/devices/{dev-selector}** after which intervals are generated in the background and automatically synchronize upon reception of new messages from device.\n\nCall format: **POST /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/calculate**.\n","parameters":[{"description":"Intervals calculation algorithm","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/container.intervals.calculate"}}],"responses":{"200":{"description":"result with calculated intervals array","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"calculated intervals","items":{"$ref":"#/definitions/container.interval"},"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":"Split calculated intervals on a higher level intervals","tags":["calculators"],"x-flespi-extra-parameters":{"deprecated-warnings":{"method":"deprecated: use GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/calculate instead"},"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Calculated intervals"}},"/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/calculate":{"get":{"description":"Special mode of applying [interval selectors](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors) and [counters](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters) to split intervals on higher level intervals and calculate them accordingly.\n\nYou may use this call to perform quick aggregation over already precalculated device intervals.\nFor example if your calculator defines device trips with this call you may aggregate them on a monthly basis and calculate combined stats for each month.\n\nBecause the call will source trips that are already calculated by coresponding [calculator](https://flespi.com/kb/analytics-reports-and-events-engine#calculators) the\nexecution of such API call is super quick.\n\n'calcs.selector' and 'dev-selector' specify selection of calculators and devices which intervals to aggregate.\nTheir assignment should be previously made with the call **POST /gw/calcs/{calcs.selector}/devices/{dev-selector}** after which intervals are generated in the background and automatically synchronize upon reception of new messages from device.\n\nCall format: **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/calculate**.\n","parameters":[{"description":"Intervals calculation algorithm","in":"query","name":"data","required":true,"schema":{"$ref":"#/definitions/container.intervals.calculate"}}],"responses":{"200":{"description":"result with calculated intervals array","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"calculated intervals","items":{"$ref":"#/definitions/container.interval"},"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":"Split calculated intervals on a higher level intervals","tags":["calculators"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Calculated intervals"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.devices.selector"}]},"/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector.put}":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.devices.selector"},{"$ref":"#/parameters/calc.device.intervals.selector.put"}],"put":{"description":"Attach to automatically calculated device intervals custom parameters.\n\n'calcs.selector' and 'calc.devices.selector' specify selection of calculators and devices from which to retrieve intervals. You usually select them by corresponding ID for this API call.\nIn 'calc.device.intervals.selector.put' pass specific interval ID to which attach these properties.\n\nNext parameter names are reserved and can not be used: id, begin, end, duration, timestamp and all counter names defined by the [calculator configuration](https://flespi.com/kb/analytics-reports-and-events-engine#calculators).\nAttempt to modify any of these parameters will return error.\n\nBe aware that maximum total JSON size for the interval message can not exceed 16MB. If it will be larger after attaching custom data during the API call - calculated device will be disabled with the reason indicated in calculator logs (event_code = 615).\nIn such case you can replace attached value with null to eliminate size overflow and disable/enable calculated device to reactivate automatic calculations.\n\nCall format: **PUT /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector.put}**.\n","parameters":[{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/calc.device.intervals.put"}}],"responses":{"200":{"description":"ID of devices with updated intervals","schema":{"$ref":"#/definitions/id.result"}},"400":{"description":"Incorrect parameters"},"500":{"description":"Server error"}},"security":[{"FlespiToken":[]}],"summary":"Attach custom parameters to calculated device interval","tags":["calculators"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Calculated intervals"}},"/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}":{"get":{"description":"Retrieve precalculated intervals for device [assigned to calculator](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices).\n\nThe request without parameters will return all currently stored intervals.\n\nAll interval filtering parameters should be wrapped inside data={...} argument. For example to return only intervals overlapping with X and Y timestamps use:\n**GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}?data={\"begin\":X,\"end\":Y}**\n\nJSON inside 'data' argument should be specified in urlencoded format.\n\nThe [calculator intervals storage is controlled](https://flespi.com/kb/how-to-manage-device-storage) by 'intervals_ttl' and 'intervals_rotate' fields from calculator configuration which define how long and how many intervals are stored in the device assignment.\nAnd with this API call you can access this storage - search for specific intervals or retrieve them all.\n\nReply contains intervals sorted by interval begin time, in case you request messages from multiple device assignments or calculators simultaneously there is no specific sort order in the output.\n\nTo improve the performance of the call always specify 'begin' and 'end' parameters with corresponding UNIX timestamps for which you want to retrieve intervals.\nIf you will specify it only inside 'filter' the call will still iterate through all intervals which on large volumes and large number of devices may slow down your operation.\n\n'filter' parameter can be used to select only subset of intervals. In filter you can utilize powerful [flespi expressions](https://flespi.com/kb/expressions).\n\nYou may use 'reverse' parameter with 'true' value to search and return intervals backwards. In that case if you specify 1 in 'count' parameter you will receive just single latest message registered for the device.\n\n'calcs.selector' and 'calc.devices.selector' specify selection of calculators and devices from which to retrieve intervals.\nTheir assignment should be previously made with the call **POST /gw/calcs/{calcs.selector}/devices/{dev-selector}** after which intervals are generated in the background and automatically synchronize upon reception of new messages from device.\n\nIn 'calc.device.intervals.selector' you may use 'all' to define intervals selection criteria in 'data' API call parameter or just retrieve all available intervals.\nYou can also pass specific interval ID or special value 'last' which is the equivalent of 'all' with data={\"reverse\": true, \"count\": 1}\n\nCall format: **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}?data={...}**, where data is an optional argument with parameters to filter returned intervals.\n","parameters":[{"in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/calc.device.intervals.get"}}],"responses":{"200":{"description":"Intervals collection","schema":{"$ref":"#/definitions/calc.device.intervals.result"}},"400":{"description":"Incorrect parameters"},"500":{"description":"Server error"}},"security":[{"FlespiToken":[]}],"summary":"Retrieve calculated device intervals","tags":["calculators"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Calculated intervals"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.devices.selector"},{"$ref":"#/parameters/calc.device.intervals.selector"}]},"/calcs/{calcs.selector}/devices/{calc.devices.selector}/recalculate":{"parameters":[{"$ref":"#/parameters/cid-header"}],"post":{"description":"Force [assigned devices](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices) intervals synchronization according to current configuration of calculator.\n\nSpecify calculators to which assign devices within path in 'calcs.selector' parameter.\nSpecify devices which to assign to calculators within path in 'calc.devices.selector' parameter.\n\nIf specific time range will be specified it will automatically keep in mind device's 'messages_ttl' and calculator's 'intervals_ttl' properties.\n\ntime_begin and time_end limitations of specific devices assigned to calculator will be ignored.\n\nCall format: **POST /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/recalculate**.\n","parameters":[{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.devices.selector"},{"in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/calc.devices.recalculate.post"}}],"responses":{"200":{"description":"Affected calculator devices","schema":{"$ref":"#/definitions/calc.devices"}},"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":"Recalculate assigned device intervals","tags":["calculators"],"x-flespi-extra-parameters":{"subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"}},"/calcs/{calcs.selector}/devices/{dev-selector}":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/dev-selector"}],"post":{"description":"[Assign device to calculator](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices).\n\nSpecify calculators to which assign devices within path in 'calcs.selector' parameter.\nSpecify devices which to assign to calculators within path in 'dev-selector' parameter.\n\nOnce device is assigned its calculation will start in background. The finish of calculation you read from 'synced' property of this assignment.\n\nYou can catch this event in real-time using MQTT topic \"flespi/state/gw/calcs/{calc_id}/devices/{device_id}/synced\" or via **GET /gw/calcs/{calc_id}/devices/{device_id}** REST API call.\n\nCall format: **POST /gw/calcs/{calcs.selector}/devices/{dev-selector}**.\n","parameters":[{"$ref":"#/parameters/calc.device.fields"},{"in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/calc.devices.post"}}],"responses":{"200":{"description":"Collection of devices assigned to calculator","schema":{"$ref":"#/definitions/calc.devices"}},"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":"Assign devices to calculator","tags":["calculators"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"}},"/calcs/{calcs.selector}/geofences/{calc.geofences.selector}":{"delete":{"description":"Unassign geofences from selected calc. Once geofences are unassigned from the calc they will also may be unassigned from corresponding streams, calculators, plugins.\nUse with caution!\n\nSpecify calcs from which to unassign geofences within path in 'calcs.selector' parameter.\nSpecify geofences which to unassign from calcs within path in 'calc.geofences.selector' parameter.\n\nBefore the unassignment it is recommended to check for calcs and geofences that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/calcs/{calcs.selector}/geofences/{calc.geofences.selector}**.\n","responses":{"200":{"description":"IDs of unassigned geofences","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":"Unassign geofences from calc","tags":["calculators","geofences"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"get":{"description":"Retrieve geofences that are assigned to selected calc.\n\nSpecify calcs for which to retrieve assigned geofences within path in 'calcs.selector' parameter.\nSpecify geofences which within path in 'calc.geofences.selector' parameter or use special value 'all' to retrieve all geofences that are in selected calcs.\n\nCall format: **GET /gw/calcs/{calcs.selector}/geofences/{calc.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.geofences.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/calc.geofences"}},"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 geofences in calc","tags":["calculators","geofences"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.geofences.selector"}],"post":{"description":"Assign geofences to selected calc.\n\nSpecify calcs to which assign geofences within path in 'calcs.selector' parameter.\nSpecify geofences which to assign to calcs within path in 'calc.geofences.selector' parameter.\n\nCall format: **POST /gw/calcs/{calcs.selector}/geofences/{calc.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.geofences.fields"}],"responses":{"200":{"description":"Collection of geofences binded to calc","schema":{"$ref":"#/definitions/calc.geofences"}},"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":"Assign geofences to calc","tags":["calculators","geofences"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"put":{"description":"Modify data associated with geofences assigned to calc.\n\nSelect calcs within path in 'calcs.selector' parameter. Specify geofences within path in 'calc.geofences.selector' parameter.\n\nCall format: **PUT /gw/calcs/{calcs.selector}/geofences/{calc.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.geofences.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/geofence.subitem.put"}}],"responses":{"200":{"description":"Updated geofences collection","schema":{"$ref":"#/definitions/calc.geofences"}},"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":"Modify geofence data for calc","tags":["calculators","geofences"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"}},"/calcs/{calcs.selector}/groups/{calc.groups.selector}":{"delete":{"description":"Delete assignment of calculator from the group. This may automatically remove assignment of devices to that calculator.\nLast will automatically delete all previously calculated device intervals. Use method with caution!\n\n'calcs.selector' and 'calc.groups.selector' specify selection of calculators and groups for the API operation.\n\nBefore the deletion it is recommended to check for calculators and groups that will be unassigned by calling corresponding GET method.\n\nCall format: **DELETE /gw/calcs/{calcs.selector}/groups/{calc.groups.selector}**.\n","responses":{"200":{"description":"IDs of unassigned groups","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":"Unassign a group from calculator","tags":["calculators","groups"],"x-view-group":"Group methods for calcs"},"get":{"description":"Fetch configuration of device assignment options when performing automated [assignment of devices](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices) in the group to this calculator.\n\nYou can control device to calculator assignment parameters, such as time_begin, time_end and enabled with parameters defined in 'calc.groups.post' definition.\n\n'calcs.selector' and 'calc.groups.selector' specify selection of calculators and groups for the API operation.\n\nCall format: **GET /gw/calcs/{calcs.selector}/groups/{calc.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.group.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Calculator groups collection","schema":{"$ref":"#/definitions/calc.group"}},"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 groups assigned to the calculator","tags":["calculators","groups"],"x-view-group":"Group methods for calcs"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"},{"$ref":"#/parameters/calc.groups.selector"}],"post":{"description":"Assign group of devices to calculator to automate [assignment of devices](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices) in the group to this calculator.\n\nYou can control device to calculator assignment parameters, such as time_begin, time_end and enabled with parameters defined in 'calc.groups.post' definition.\n\nOnce group is assigned to calculator when you add device to the group it will be automatically assigned to corresponding calculator.\n\nAll devices in the group will start calculation automatically. Any group members change will reflect to the calculator.\n\n'calcs.selector' and 'calc.groups.selector' specify selection of calculators and groups for the API operation.\n\nCall format: **POST /gw/calcs/{calcs.selector}/groups/{calc.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.group.fields"},{"in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/calc.groups.post"}}],"responses":{"200":{"description":"Collection of groups assigned to calculator","schema":{"$ref":"#/definitions/calc.groups"}},"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":"Assign a group of devices to a calculator","tags":["calculators","groups"],"x-flespi-extra-parameters":{"subitem-acl":"gw/groups"},"x-view-group":"Group methods for calcs"},"put":{"description":"Change device assignment option when performing automated [assignment of devices](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices) in the group to this calculator.\n\nYou can control device to calculator assignment parameters, such as time_begin, time_end and enabled with parameters defined in 'calc.groups.post' definition.\n\nThis change is the configuration for new assignments and it won't affect already assigned devices.\n\n'calcs.selector' and 'calc.groups.selector' specify selection of calculators and groups for the API operation.\n\nCall format: **PUT /gw/calcs/{calcs.selector}/groups/{calc.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/calc.group.fields"},{"in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/calc.groups.post"}}],"responses":{"200":{"description":"Collection of groups assigned to calculator","schema":{"$ref":"#/definitions/calc.groups"}},"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":"Update assignment of group of devices to calculator","tags":["calculators","groups"],"x-flespi-extra-parameters":{"subitem-acl":"gw/groups"},"x-view-group":"Group methods for calcs"}},"/calcs/{calcs.selector}/logs":{"get":{"description":"Get specified calculator logs. The request without parameters will return all calculator logs.\n\n'calcs.selector' specifies selection of calculators from which to retrieve logs. You may select 'all' calculators or select them by ID, name and other criterias specified in calcs.selector.\n\nReply contains calculator logs sorted by timestamp, in case you request logs from multiple calculators sort order is not preserved.\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 calculator logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in calculator 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).\nTo select logs generated by the calculation of specific device only you may use \"device_id=XXX\" expression, where XXX is device ID.\n\nCall format: **GET /gw/calcs/{calcs.selector}/logs**.\n","parameters":[{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve calculator logs","tags":["calculators"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"}]},"/calcs/{calcs.selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified calculator.\n\nCall format: **GET /gw/calcs/{calcs.selector}/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 calculator logs","tags":["calculators"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/calcs.selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/calcs/{calcs.selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified calculator.\n\nCall format: **POST /gw/calcs/{calcs.selector}/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 calculator logs","tags":["calculators"],"x-view-group":"Utils"}},"/changelog-posts":{"get":{"description":"Retrieve changelog posts accumulated for the flespi telematics hub system, sorted by publication time.\n\nEach post published in a forum changelog topic of the telematics hub 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. 'telematics-hub', 'analytics' or 'tachograph'.\nNew posts are also published in realtime into 'flespi/message/gw/changelog' MQTT topic.\n\nAll filtering parameters should be wrapped inside data={...} argument, for example to return only the latest post use:\n**GET /gw/changelog-posts?data={\"reverse\":true,\"count\":1}**\n\nCall format: **GET /gw/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.system.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 telematics hub system","tags":["changelog"],"x-view-group":"Changelog"}},"/channel-protocols/{channel-protocols.selector}":{"get":{"description":"Get collection of channel protocols.\n\nUse special keyword \"all\" to retrieve all protocols. Specify filtering conditions within path in 'channel-protocols.selector' to retrieve only protocols that conforms to specified criterias.\n\nCall format: **GET /gw/channel-protocols/{channel-protocols.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\nThis method is accessible with any token of the account, including ACL tokens, no extra permissions required.\n","parameters":[{"$ref":"#/parameters/channel-protocol.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Collection of returned protocols.","schema":{"$ref":"#/definitions/protocols"}},"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 available channel protocols","tags":["protocols","channels"],"x-view-group":"Channel protocols"},"parameters":[{"$ref":"#/parameters/channel-protocols.selector"}]},"/channel-protocols/{channel-protocols.selector}/changelog-posts":{"get":{"description":"Retrieve changelog posts accumulated for the selected channel protocols, sorted by publication time within each selected protocol.\n\nEach post published in the protocol's forum changelog topic (linked in the 'changelog' field of the protocol) is stored by the platform and available with this method.\nNew posts are also published in realtime into 'flespi/message/gw/channel-protocols/{id}/changelog' MQTT topic.\n\nAll filtering parameters should be wrapped inside data={...} argument, for example to return only the latest post of a single selected item use:\n**GET /gw/channel-protocols/{channel-protocols.selector}/changelog-posts?data={\"reverse\":true,\"count\":1}**\n\nCall format: **GET /gw/channel-protocols/{channel-protocols.selector}/changelog-posts**\n\nBoth the MQTT topics 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 channel protocols","tags":["protocols","channels"],"x-view-group":"Changelog"},"parameters":[{"$ref":"#/parameters/channel-protocols.selector"}]},"/channel-protocols/{channel-protocols.selector}/device-types/{devtypes.selector}":{"get":{"description":"Get collection of device types withing specified channel protocols.\n\nUse special keyword \"all\" to retrieve all device types. Specify filtering conditions within path in 'channel-protocols.selector' and/or 'devtypes.selector' to retrieve only device types that conforms to specified criterias.\nMost popular channel-protocols.selector selector is name=\"xxxx\", to retrieve information about device types in protocol 'xxxx'.\nYou can further narrow down returned results to specific device type 'yyyy' by specifying in devtypes.selector: name=\"yyyy\".\n\nCall format: **GET /gw/channel-protocols/{channel-protocols.selector}/device-types/{devtypes.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\nThis method is accessible with any token of the account, including ACL tokens, no extra permissions required.\n","parameters":[{"$ref":"#/parameters/devtypes.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Device types collection.","schema":{"$ref":"#/definitions/device_types"}},"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 available device types withing selected channel protocols","tags":["protocols","devices"],"x-view-group":"Device types"},"parameters":[{"$ref":"#/parameters/channel-protocols.selector"},{"$ref":"#/parameters/devtypes.selector"}]},"/channels":{"post":{"description":"Create new channel listening for messages from tracking devices, working on specified protocol.\nTo assign protocol either protocol_id or protocol_name should be specified.\nThe channel will be created with automaticaly assigned unique uri in form **\"host:port\"** to listen for incoming connections from devices.\n\nBy default channel will start to receive data immediately after request. Use option **enabled**=false to create inactive channel.\n\nTo receive **protocol_name** in response select this option in **fields** list.\n**protocol_name** is secondary parameter, so if **protocol_id** is specified then **protocol_name** will not be used.\n\nCall format: **POST /gw/channels?fields=id,uri**\nwhere fields is optional argument to minimize the size of returned JSON for created channel\n","parameters":[{"$ref":"#/parameters/channel.fields"},{"$ref":"#/parameters/cid-header"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/channels.post"}}],"responses":{"200":{"description":"Channels collection.","schema":{"$ref":"#/definitions/channels"}},"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 new channel","tags":["channels"],"x-flespi-extra-parameters":{"grant-access":"create-channels"},"x-view-group":"Manage"}},"/channels/{ch-selector}":{"delete":{"description":"The method will permanently delete selected channels to which current user(token) has access to.\n\nOnce channel is deleted its unique host:port binding in uri is lost forever. Use with caution!\n\nUse special keyword \"all\" to delete all channels. Specify filtering conditions within path in 'ch-selector' to delete only channels that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for channels that will be deleted by calling corresponding GET method.\n\nCall format: **DELETE /gw/channels/{ch-selector}**\n","responses":{"200":{"description":"Deleted channels identifiers collection.","schema":{"$ref":"#/definitions/channels.id"}},"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 channels","tags":["channels"],"x-view-group":"Manage"},"get":{"description":"Get collection of channels available for user(token).\n\nUse special keyword \"all\" to retrieve all channels. Specify filtering conditions within path in 'ch-selector' to retrieve only channels that conforms to specified criterias.\n\nCall format: **GET /gw/channels/{ch-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/channel.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Channels collection.","schema":{"$ref":"#/definitions/channels"}},"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":"List available channels","tags":["channels"],"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"}],"patch":{"description":"The patch method is similar to PUT method but it is used to update only specified keys of the item's JSON fields like metadata or configuration.\n\nCall format: **PATCH /gw/channels/{ch-selector}**.\n","parameters":[{"$ref":"#/parameters/channel.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/channel.put"}}],"responses":{"200":{"description":"Channels collection.","schema":{"$ref":"#/definitions/channels"}},"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":"Patch item properties","tags":["channels"],"x-view-group":"Manage"},"put":{"description":"Change channel properties.\n\nUse special keyword \"all\" to retrieve all channels. Specify filtering conditions within path in 'ch-selector' to retrieve only channels that conforms to specified criterias.\n\nAll active connections to the affected channels will be closed before updates.\n\nCall format: **PUT /gw/channels/{ch-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/channel.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/channel.put"}}],"responses":{"200":{"description":"Channels collection.","schema":{"$ref":"#/definitions/channels"}},"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":"Modify channels properties","tags":["channels"],"x-view-group":"Manage"}},"/channels/{ch-selector}/cid":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"}],"put":{"description":"Move channel to account/subaccount with specified cid.\n\nTo select channels to move specify filtering conditions within path in 'ch-selector'. You may select 'all' channels or select them by ID and other criterias specified in ch-selector.\n\nThere are certain requirements for moved channels:\n  * The channel must not be moved / created for at least the last 60 seconds\n  * If the channel is added to the stream, the new account must have access to this stream\n  * There should be no MQTT state topic(flespi/state/gw/channel/{channel-id}/...) related to channel with a timestamp of more than 60 seconds from the present.\n\nCall format: **PUT /gw/channels/{ch-selector}/cid**\n","parameters":[{"$ref":"#/parameters/channel.fields"},{"in":"body","name":"data","required":true,"schema":{"properties":{"cid":{"description":"New subaccount ID","minimum":1,"type":"integer"}},"required":["cid"],"type":"object"}}],"responses":{"200":{"description":"Channels collection.","schema":{"$ref":"#/definitions/channels"}},"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":"Move channel between subaccounts","tags":["channels"],"x-flespi-extra-parameters":{"master-token-required":true},"x-view-group":"Manage"}},"/channels/{ch-selector}/connections/{conn-selector}":{"delete":{"description":"Force the closure of TCP connections.\n\n'ch-selector' specifies selection of channels for which to close connections. You may select 'all' channels or select them by ID and other criterias specified in ch-selector.\nIn 'conn-selector' you may specify 'all' to close all connections for selected channels.\n\nCall format: **DELETE /gw/channels/{ch-selector}/connections/{conn-selector}**.\n","responses":{"200":{"description":"Collection of closed TCP connections.","schema":{"$ref":"#/definitions/channel.connection.ids"}},"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":"Close TCP connections","tags":["channels"],"x-view-group":"Connections"},"get":{"description":"List currently active channel TCP connections.\n\n'ch-selector' specifies selection of channels for which to list connections. You may select 'all' channels or select them by ID and other criterias specified in ch-selector.\nIn 'conn-selector' you may specify 'all' to retrieve all connections for selected channels.\n\nAt each moment of time there can be only one primary connection to the device.\nOnce device establishes and identifies connection to the channel flespi will automatically close all existing primary connections to the same devices\nwith a close_code=12 in log message (connection closed due to ident duplicate).\n\nHowever secondary device connections - they usualy represents live video streamings or media data download processes are not affected and will live in parallel as long as need.\nFor secondary connections you usualy from their 'meta' property can retrieve specific information, such as live stream URL or the reason of such connection.\n\nCall format: **GET /gw/channels/{ch-selector}/connections/{conn-selector}**.\n","parameters":[{"$ref":"#/parameters/channel.connection.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Collection of active TCP connections.","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"items":{"$ref":"#/definitions/channel.connection"},"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":"List active channel TCP connections","tags":["channels"],"x-view-group":"Connections"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"},{"$ref":"#/parameters/conn-selector"}]},"/channels/{ch-selector}/idents/{ch-ident-selector}/packets":{"get":{"description":"Retrieve raw traffic data for ident within selected channel. Raw traffic data is returned in base64 format.\n\nYou should select a single channel only in 'ch-selector'. To ensure this it is better to specify channel ID there.\nIn 'ch-ident-selector' you specify ident value. Special ident value 'unidentified' can be used to read traffic between connections that channel was not able to identify to the particular ident or from connectionless protocols.\n\nIn flespi.io we suggest to use integrated utility available in channel 'Logs & Messages' tab under TRAFFIC button.\nThere, after selecting corresponding ident you can see traffic between device and server in HEX/TEXT modes and conveniently export it.\n\nTraffic is available in limited volume and for limited time only.\nDepending on the channel traffic storage can be very low. If you need more traffic for diagnostics connect devices over different channels.\nWe recommend up to 1000 devices per channel for adequate traffic volume storage.\n\nThis method is intended for diagnostics usage only and not guarantee to always return latest device traffic.\n\nCall format: **GET /gw/channels/{ch-selector}/idents/{ch-ident-selector}/packets**.\n","parameters":[{"in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/item.packets.get"}}],"responses":{"200":{"description":"Result array with packets of specified ident","schema":{"properties":{"result":{"description":"Array of packets of specified ident","items":{"$ref":"#/definitions/item.packets"},"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":"Retrieve raw traffic for ident","tags":["channels"],"x-view-group":"Traffic"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"},{"$ref":"#/parameters/ch-ident-selector"}]},"/channels/{ch-selector}/idents/{channel.ident.selector}":{"get":{"description":"List idents that ever reported to flespi through this channel.\n\n'ch-selector' specifies selection of channels for idents listing. You may select 'all' channels or select them by ID and other criterias specified in ch-selector.\n'channel.ident.selector' specifies ident value. You may use:\n  * all - to retrieve all possible idents;\n  * unidentified - special ident that accumulates all traffic which was not possible to bind to particular ident;\n  * ident - specific ident value to limit output to this ident(s) only, wildcards allowed;\n\nCall format: **GET /gw/channels/{ch-selector}/idents/{channel.ident.selector}**.\n","parameters":[{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"The list of idents that have raw traffic stored for given channel.","schema":{"$ref":"#/definitions/channel.idents.result"}},"400":{"description":"Incorrect parameters.","schema":{"$ref":"#/definitions/errors.result"}},"500":{"description":"Server is unable to process request at the momenet, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"List idents reported to the channel","tags":["channels"],"x-view-group":"Traffic"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"},{"$ref":"#/parameters/channel.ident.selector"},{"$ref":"#/parameters/channel.ident.fields"}]},"/channels/{ch-selector}/logs":{"get":{"description":"Get specified channels logs. The request without parameters will return all channel logs.\n\n'ch-selector' specifies selection of channels from which to retrieve logs. You may select 'all' channels or select them by ID and other criterias specified in ch-selector.\n\nReply contains channel logs sorted by timestamp, in case you request logs from multiple channels simultaneously they are not sorted by channel.\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 channel logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in channel which on large volumes and large number of channels 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 /gw/channels/{ch-selector}/logs**.\n","parameters":[{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve channel logs","tags":["channels"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"}]},"/channels/{ch-selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified channel.\n\nCall format: **GET /gw/channels/{ch-selector}/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"}}},"security":[{"FlespiToken":[]}],"summary":"Calculate intervals from channel logs","tags":["channels"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/channels/{ch-selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified channel.\n\nCall format: **POST /gw/channels/{ch-selector}/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 channel logs","tags":["channels"],"x-view-group":"Utils"}},"/channels/{ch-selector}/messages":{"delete":{"description":"Delete messages in channel buffer up to **delete_key** parameter.\n**delete_key** value may be taken from **next_key** value of previous GET messages request.\n\nThis request is optional, normal method of work is to delete messages via **GET /gw/channels/{ch-selector}/messages** request with delete=true and valid curr_key from previous response.\n\nCall format: **DELETE /gw/channels/{ch-selector}/messages**.\n","parameters":[{"description":"Parameters to delete already messages from channel's messages buffer.","in":"query","name":"data","required":true,"schema":{"properties":{"delete_key":{"description":"Delete all messages with key smaller than given.","minimum":2,"type":"integer"}},"required":["delete_key"],"type":"object"}}],"responses":{"200":{"description":"Channel IDs collection where messages have been successfully deleted. The whole request success can be checked by number of returned channel ID's: E.g. if command to delete messages in N channels have been sent, then there must be N channel ID's in reply. Otherwise something's missing.\n","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"items":{"$ref":"#/definitions/channel.id"},"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":"Delete messages from channel buffer","tags":["channels"],"x-view-group":"Messages"},"get":{"description":"Get messages from specified channel. Only single channel should be selected in 'ch-selector'. It is advisable to specify channel id there.\n\nThere are two variants how this call is processed based on data parameters. Either it is long polling mode or just simple instant channel buffer reader.\n\nIn long polling mode it is expected that only one reader is accessing single channel. Request features\n* Push mode: server will process request as soon as new messages appear in the channel (or timeout expired)\n* It is assumed that only one handler has a possibility to delete messages.\n* If **delete** parameter is set and **curr_key** parameter is not empty all messages up to specified curr_key are marked as read and will be deleted.\n\nDesignated method of messages consumption is to use **GET /gw/channels/{ch-selector}/messages** request with timeout=XX (plus some optional limits), delete=true and valid curr_key value from previous response.\nThis will fetch only new portion of messages and automatically delete messages received in previous request.\nTimeout parameter is wise to use when we need to wait until any new message will arrive to the channel and return then it immediately in response.\n\nAlternatively you may access channel buffer with the same API method, but specifying from/to parameters with optional filtration specification or even traversing channel messages in reverse mode (the latest messages come first).\nThis type of call will immediately return you messages accumulated currently by the channel.\n\nCall format: **GET /gw/channels/{ch-selector}/messages**.\n","parameters":[{"description":"These parameters are used to read new messages and delete processed messages from the channel.","in":"query","name":"data","schema":{"$ref":"#/definitions/channel.messages.get"}}],"responses":{"200":{"description":"Message collection.","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"next_key":{"description":"Key for the next request","type":"integer"},"result":{"items":{"$ref":"#/definitions/channel.message"},"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":"Read messages from channel buffer","tags":["channels"],"x-view-group":"Messages"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/ch-selector"}]},"/devices":{"post":{"description":"Create new device with specified configuration parameters. You pass JSON array with configuration objects - one object per each device to create.\n\nCall format: **POST /gw/devices?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created device\n","parameters":[{"$ref":"#/parameters/device.fields"},{"$ref":"#/parameters/cid-header"},{"in":"body","name":"data","required":true,"schema":{"items":{"$ref":"#/definitions/device.post"},"maxItems":1000,"minItems":1,"type":"array"}}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/devices"}},"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 new device","tags":["devices"],"x-flespi-extra-parameters":{"grant-access":"create-devices"},"x-view-group":"Manage"}},"/devices/{dev-selector}":{"delete":{"description":"The method will permanently delete selected devices to which current user(token) has access to. Use with caution!\n\nUse special keyword \"all\" to delete all available devices. Specify filtering conditions within path in 'dev-selector' to delete only devices that conforms to specified criterias.\nMost popular selector is configuration.ident=\"xxxx\", to delete device with ident (IMEI) 'xxxx' in its configuration.\n\nBefore the deletion it is recommended to check for devices that will be deleted by calling corresponding GET method.\n\nCall format: **DELETE /gw/devices/{dev-selector}**\n","responses":{"200":{"description":"Deleted devices identifiers collection.","schema":{"$ref":"#/definitions/devices.id"}},"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 selected devices","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"},"get":{"description":"Get collection of devices available for user(token).\n\nUse special keyword \"all\" to retrieve all devices. Specify filtering conditions within path in 'dev-selector' to retrieve only devices that conforms to specified criterias.\nMost popular selector is configuration.ident=\"xxxx\", to fetch device with ident (IMEI) 'xxxx' in its configuration.\n\nCall format: **GET /gw/devices/{dev-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/device.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/devices"}},"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 available devices","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"patch":{"description":"The method will update selected devices and merge modified fields specified in API call data with existing properties if they are of type JSON object.\nIt is convenient to use this method instead of PUT to update only certain keys inside the device configuration - for example to change just device type leaving ident and phone_number unchanged.\n\nFor non-JSON device properties this method behaviour is identical to corresponding PUT API call.\n\nUse special keyword \"all\" to select all devices available for current user(token) for update. Specify filtering conditions within path in 'dev-selector' to update only devices that conforms to specified criterias.\nMost popular selector is configuration.ident=\"xxxx\", to update device with ident (IMEI) 'xxxx' in its configuration.\n\nBefore the update it is recommended to check for devices that will be updated by calling corresponding GET method.\n\nCall format: **PATCH /gw/devices/{dev-selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/device.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/device.patch"}}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/devices"}},"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":"Modify fields inside device configuration","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"},"put":{"description":"Update specified properties for selected devices.\n\nUse special keyword \"all\" to select all devices available for current user(token) for update. Specify filtering conditions within path in 'dev-selector' to update only devices that conforms to specified criterias.\nMost popular selector is configuration.ident=\"xxxx\", to update device with ident (IMEI) 'xxxx' in its configuration.\n\nIf you need to update part of configuration for multiple devices simultaneously but remain ident or phone_number fields in configuration unaffected check corresponding PATCH method.\n\nBefore the update it is recommended to check for devices that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/devices/{dev-selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/device.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/device.put"}}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/devices"}},"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":"Modify device properties","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"}},"/devices/{dev-selector}/calculate":{"parameters":[{"$ref":"#/parameters/cid-header"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/devices/{dev-selector}/messages/calculate** instead.\n\nSplit device messages on intervals according to specified calculation rules. This is [reports engine](https://flespi.com/kb/analytics-reports-and-events-engine) in its manual mode.\n\n'dev-selector' specifies selection of devices from which to retrieve intervals. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to calculate messages from device with ident (IMEI) 'xxxx' in its configuration.\n\nInside call data in so-called [interval selectors](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors) you define the rules on how to split device messages on intervals.\n\nOnce intervals are defined, [interval counters](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters) apply that calculate each message in interval according to specified logic.\n\nThe generated interval message contains interval begin and end time, duration and all calculated properties defined by interval counters.\n\nRead more about [flespi reports engine](https://flespi.com/kb/analytics-reports-and-events-engine) in KB.\n\nCall format: **POST /gw/devices/{dev-selector}/calculate**.\n\nIf you selected multiple devices inside 'dev-selector' - you will retrieve intervals from all them.\n\nIn that case to distinguish from which device each interval comes from we recommend to define interval counter of type 'parameter' with parameter 'device.id' or 'ident' which will copy 'device.id' or 'ident' parameter from the message into the interval.\n","parameters":[{"$ref":"#/parameters/dev-selector"},{"description":"Intervals calculation algorithm","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/container.intervals.calculate"}}],"responses":{"200":{"description":"result with calculated intervals array","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"calculated intervals","items":{"$ref":"#/definitions/container.interval"},"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":"Split devices messages into intervals (run reports)","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/calcs"},"x-view-group":"History and State"}},"/devices/{dev-selector}/cid":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"put":{"description":"Move devices to account/subaccount with specified cid.\n\nTo select devices to move specify filtering conditions within path in 'dev-selector'. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\nThere are certain requirements to move device between subaccounts:\n  * The device must not be moved / created for at least the last 60 seconds\n  * If the device is added to the calculator, the new account must have access to this calculator\n  * If the device is added to the stream, the new account must have access to this stream\n  * If the device is added to the plugin, the new account must have access to this plugin\n  * There should be no MQTT state topic(flespi/state/gw/devices/{device-id}/...) related to device with a timestamp of more than 60 seconds from the present, especially actual for telemetry values\n\nCall format: **PUT /gw/devices/{dev-selector}/cid**\n","parameters":[{"$ref":"#/parameters/device.fields"},{"in":"body","name":"data","required":true,"schema":{"properties":{"cid":{"description":"new account/subaccount ID","minimum":1,"type":"integer"}},"required":["cid"],"type":"object"}}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/devices"}},"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":"Move device between subaccounts","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","master-token-required":true},"x-view-group":"Manage"}},"/devices/{dev-selector}/commands":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"post":{"description":"Execute command over device in real-time via connection. Connection based commands are executed only if device is currently connected.\nIf device is not connected API call will immediately return indication missed connection.\n\nIf device is connected API call within specified timeout will try to execute command remotely and provide you with the response received from the device.\n\nIf you want to durable queue device command with long execution timeout you may want to use **POST /gw/devices/{dev-selector}/commands-queue** call instead.\n\n'dev-selector' specifies selection of devices to which queue to add the command. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to send command to device with ident (IMEI) 'xxxx' in its configuration.\n\nDepending on the device protocol and command procedure implementation some commands will wait for confirmation from the device and some will be marked as successfully executed immediately after sending corresponding command to the device.\n\nAll command execution attempts, their expiration and status also reflected in device logs which you may access with **GET /gw/devices/{dev-selector}/logs**.\n\nCall format: **POST /gw/devices/{dev-selector}/commands**.\n\nBoth commands and settings APIs can be utilized to remotely control the device with slightly different behaviour.\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"$ref":"#/parameters/devices.commands.fields"},{"in":"body","name":"data","required":true,"schema":{"description":"Array of commands to send to the selected devices","items":{"$ref":"#/definitions/devices.commands.post"},"maxItems":20,"minItems":1,"title":"Commands","type":"array"}}],"responses":{"200":{"description":"Commands collection.","schema":{"$ref":"#/definitions/devices.commands.array"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Send command to the connected device in real-time","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: commands\n"}},"/devices/{dev-selector}/commands-queue":{"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"post":{"description":"Add a command to the device queue. Device commands are executed in the order in which they are added.\nIf device is already connected the server will immediately send it to the device.\n\nIf you want to send device command in real-time and receive in REST API response directly from the device you may want to use **POST /gw/devices/{dev-selector}/commands** call instead.\n\n'dev-selector' specifies selection of devices to which queue to add the command. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to queue commands to device with ident (IMEI) 'xxxx' in its configuration.\n\nDepending on the device protocol and command procedure implementation some commands will wait for confirmation from the device and some will be marked as successfully executed immediately after sending corresponding command to the device.\n\nThe command has an expiration time and the number of retry attempts is counted.\nExpired and successfully sent commands are moved to the different queue which you may access with **GET /gw/devices/{dev-selector}/commands-result** or **GET /gw/devices/{dev-selector}/commands-result/**.\n\nAll command execution attempts, their expiration and status also reflected in device logs which you may access with **GET /gw/devices/{dev-selector}/logs**.\n\nWhen you post command into the queue you retrieve the command ID which you can use to trace command history both in commands result buffer and in logs.\n\nYou may cancel pending command by deleting it from queue using **DELETE /gw/devices/{dev-selector}/commands-queue/{devices.commands-queue.selector}** with corresponding command ID specified in devices.commands-queue.selector.\n\nCall format: **POST /gw/devices/{dev-selector}/commands-queue**.\n\nBoth commands and settings APIs can be utilized to remotely control the device with slightly different behaviour.\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"$ref":"#/parameters/devices.commands-queue.fields"},{"in":"body","name":"data","required":true,"schema":{"items":{"$ref":"#/definitions/devices.commands-queue.post"},"maxItems":20,"minItems":1,"type":"array"}}],"responses":{"200":{"description":"Commands collection.","schema":{"$ref":"#/definitions/devices.commands-queue.array"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Schedule command execution","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: commands\n"}},"/devices/{dev-selector}/commands-queue/{devices.commands-queue.selector}":{"delete":{"description":"Cancel command execution and remove it from device queue.\n\n'dev-selector' specifies selection of devices from which to remove queued commands. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\nCall format: **DELETE /gw/devices/{dev-selector}/commands-queue/{devices.commands-queue.selector}**.\n\nBoth commands and settings APIs can be utilized to remotely control the device with slightly different behaviour.\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"$ref":"#/parameters/devices.commands-queue.fields"}],"responses":{"200":{"description":"Commands collection.","schema":{"$ref":"#/definitions/devices.commands-queue.array"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Remove command from queue","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: commands\n"},"get":{"description":"List commands in device queue. Device commands are executed in the order in which they are added.\n\n'dev-selector' specifies selection of devices to return queued commands. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\nExpired and successfully sent commands are moved to the different queue which you may access with **GET /gw/devices/{dev-selector}/commands-result**.\n\nAll command execution attempts, their expiration and status also reflected in device logs which you may access with **GET /gw/devices/{dev-selector}/logs**.\n\nYou may delete command from the queue using **DELETE /gw/devices/{dev-selector}/commands-queue/{devices.commands-queue.selector}** with corresponding command ID specified in devices.commands-queue.selector.\n\nCall format: **GET /gw/devices/{dev-selector}/commands-queue/{devices.commands-queue.selector}**.\n\nBoth commands and settings APIs can be utilized to remotely control the device with slightly different behaviour.\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"$ref":"#/parameters/devices.commands-queue.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Commands collection.","schema":{"$ref":"#/definitions/devices.commands-queue.array"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Retrieve list of queued commands","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: commands\n"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"},{"$ref":"#/parameters/devices.commands-queue.selector"}]},"/devices/{dev-selector}/commands-result":{"get":{"description":"Retreieve executed or expired device commands.\n\n'dev-selector' specifies selection of devices for which to retrieve commands information. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\nCall format: **GET /gw/devices/{dev-selector}/commands-result**.\n\nThis call under the hood extracts executed ot expired command information from device logs.\nIf you need to enhance filtering criterias you may use **GET /gw/devices/{dev-selector}/logs** directly.\n\nIf you need to find executed or expired command by its ID you may use another call: **GET /gw/devices/{dev-selector}/commands-result/{command-id-selector}**.\n\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"description":"These parameters are used to specify interval for which to retrieve device commands","in":"query","name":"data","schema":{"properties":{"from":{"description":"Timestamp of the beginning of the requested interval","minimum":0,"type":"number","x-view-type":"datetime"},"to":{"description":"Timestamp of the end of the requested interval","minimum":0,"type":"number","x-view-type":"datetime"}},"type":"object"}}],"responses":{"200":{"description":"Finished commands array.","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"items":{"schema":{"description":"Finished command information","properties":{"channel_id":{"description":"Channel ID that sent the command.","type":"integer"},"executed":{"description":"Command execution status.","type":"boolean"},"id":{"$ref":"#/definitions/device.command.id"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"origin_id":{"$ref":"#/definitions/device.command.device_id"},"properties":{"$ref":"#/definitions/device.command.properties"},"response":{"description":"Response to the command.","type":"object"},"timestamp":{"$ref":"#/definitions/device.command.timestamp"}},"type":"object"}},"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 executed or expired commands","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: commands\n"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}]},"/devices/{dev-selector}/commands-result/{command-id-selector}":{"get":{"description":"Retreieve executed or expired device command by its ID.\n\n'dev-selector' specifies selection of devices for which to retrieve commands information. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\n'command-id-selector' is unique ID of the device command generated by flespi when you queued or tryied to execute the command.\n\nCall format: **GET /gw/devices/{dev-selector}/commands-result/{command-id-selector}**.\n\nThis call under the hood extracts executed ot expired command information from device logs.\nIf you need to enhance filtering criterias you may use **GET /gw/devices/{dev-selector}/logs** directly.\n\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","responses":{"200":{"description":"Finished commands array.","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"items":{"schema":{"description":"Finished command information","properties":{"channel_id":{"description":"Channel ID that sent the command.","type":"integer"},"command_id":{"$ref":"#/definitions/device.command.id"},"executed":{"description":"Command execution status.","type":"boolean"},"id":{"$ref":"#/definitions/device.command.id"},"meta":{"$ref":"#/definitions/device.command.meta"},"name":{"$ref":"#/definitions/device.command.name"},"origin_id":{"$ref":"#/definitions/device.command.device_id"},"properties":{"$ref":"#/definitions/device.command.properties"},"response":{"description":"Response to the command.","type":"object"},"timestamp":{"$ref":"#/definitions/device.command.timestamp"}},"type":"object"}},"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 executed or expired command by its ID","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: commands\n"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"},{"$ref":"#/parameters/command-id-selector"}]},"/devices/{dev-selector}/connections/{conn-selector}":{"delete":{"description":"Force the closure of device TCP connections.\n\n'dev-selector' specifies selection of devices for which to close connections. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nIn 'conn-selector' you may specify 'all' to close all connections for selected devices.\n\nCall format: **DELETE /gw/devices/{dev-selector}/connections/{conn-selector}**.\n","responses":{"200":{"description":"Collection of closed TCP connections","schema":{"$ref":"#/definitions/channel.connection.ids"}},"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":"Close TCP connections","tags":["devices"],"x-view-group":"Connections"},"get":{"description":"List currently active device TCP connections.\n\n'dev-selector' specifies selection of devices for which to list connections. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nIn 'conn-selector' you may specify 'all' to retrieve all connections for selected devices.\n\nTCP connection to channel can be binded to the registered devices after reception of identification packet (login procedure).\nWith this method you can retrieve currently active TCP connections binded to the device.\n\nAt each moment of time there can be only one primary connection to the device.\nOnce device establishes and identifies connection to the channel flespi will automatically close all existing primary connections to the same devices\nwith a close_code=12 in log message (connection closed due to ident duplicate).\n\nHowever secondary device connections - they usualy represents live video streamings or media data download processes are not affected and will live in parallel as long as need.\nFor secondary connections you usualy from their 'meta' property can retrieve specific information, such as live stream URL or the reason of such connection.\n\nCall format: **GET /gw/devices/{dev-selector}/connections/{conn-selector}**.\n","parameters":[{"$ref":"#/parameters/channel.connection.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Collection of active TCP connections","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"active connections to device","items":{"$ref":"#/definitions/channel.connection"},"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":"List active TCP connections","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Connections"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"},{"$ref":"#/parameters/conn-selector"}]},"/devices/{dev-selector}/geofences/{dev-geofences-selector}":{"delete":{"description":"Unassign additional geofences from selected device.\n\nSpecify devices from which to unassign geofences within path in 'dev-selector' parameter.\nSpecify geofences which to unassign from devices within path in 'dev-geofences-selector' parameter.\n\nBefore the unassignment it is recommended to check for devices and geofences that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/devices/{dev-selector}/geofences/{dev-geofences-selector}**.\n","responses":{"200":{"description":"IDs of unassigned geofences","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":"Unassign geofences from device","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"get":{"description":"Retrieve additional geofences that are assigned to selected device.\nGeofences assigned to the device will be merged with geofences assigned to stream, plugin or calculator during their processing of this device messages.\n\nSpecify devices for which to retrieve assigned geofences within path in 'dev-selector' parameter.\nSpecify geofences which within path in 'dev-geofences-selector' parameter or use special value 'all' to retrieve all geofences that are in selected devices.\n\nCall format: **GET /gw/devices/{dev-selector}/geofences/{dev-geofences-selector}**.\n","parameters":[{"$ref":"#/parameters/device.geofences.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/device.geofences"}},"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 geofences in device","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"},{"$ref":"#/parameters/dev-geofences-selector"}],"post":{"description":"Assign additional geofences to the selected device.\nGeofences assigned to the device will be merged with geofences assigned to stream, plugin or calculator during their processing of this device messages.\n\nSpecify devices to which assign geofences within path in 'dev-selector' parameter.\nSpecify geofences which to assign to devices within path in 'dev-geofences-selector' parameter.\n\nCall format: **POST /gw/devices/{dev-selector}/geofences/{dev-geofences-selector}**.\n","parameters":[{"$ref":"#/parameters/device.geofences.fields"}],"responses":{"200":{"description":"Collection of geofences binded to device","schema":{"$ref":"#/definitions/device.geofences"}},"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":"Assign geofences to device","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"}},"/devices/{dev-selector}/logs":{"get":{"description":"Get specified device logs. The request without parameters will return all device logs.\n\n'dev-selector' specifies selection of devices from which to retrieve logs. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to retrieve logs from device with ident (IMEI) 'xxxx' in its configuration.\n\nReply contains device logs sorted by timestamp, in case you request logs from multiple devices simultaneously they are not sorted by device.\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 device logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in device which on large volumes and large number of devices 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 /gw/devices/{dev-selector}/logs**.\n","parameters":[{"description":"Parameters to filter returned logs","in":"query","name":"data","schema":{"$ref":"#/definitions/logs.get"}}],"responses":{"200":{"description":"Retreived logs","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":"Retrieve device logs","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}]},"/devices/{dev-selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified device.\n\nCall format: **GET /gw/devices/{dev-selector}/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 device logs","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/devices/{dev-selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified device.\n\nCall format: **POST /gw/devices/{dev-selector}/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 device logs","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Utils"}},"/devices/{dev-selector}/media":{"delete":{"description":"Delete media files for selected device. The request without parameters will delete all media files for all selected devices, please use it with caution!\nDeleted files immediately disappear from listings and access, while the storage they occupy is reclaimed in background within an hour.\n\nDevices receive media files such as videos and photos and store them in internal media storage.\nEach media file is uniquely identified by 'uuid' parameter and can be accessed from Internet directly and without authentication via its 'url' parameter.\n\n'dev-selector' specifies selection of devices from which to delete files. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nIf you specify 'uuid' attribute in request data it is safe to use 'all' to use dev-selector.\n\nCall format: **DELETE /gw/devices/{dev-selector}/media**.\n","parameters":[{"description":"Filters for files deletion","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/media.files.delete"}}],"responses":{"200":{"description":"collection of affected devices","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 media files","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Media files"},"get":{"description":"List media files currently available in the device media storage. The request without parameters will return all media files accumulated by the device.\n\nThe [media storage is controlled](https://flespi.com/kb/how-to-manage-device-storage) by 'media_ttl' and 'media_rotate' fields from device configuration which define how long and how many files are stored.\n\nDevices receive media files such as videos and photos and store them in internal media storage.\nEach media file is uniquely identified by 'uuid' parameter and can be accessed from Internet directly and without authentication via its 'url' parameter.\n\n'dev-selector' specifies selection of devices from which to list files. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\nReply contains device media files sorted by timestamp, in case you request files from multiple devices simultaneously they are not sorted by device.\n\nCall format: **GET /gw/devices/{dev-selector}/media**.\n","parameters":[{"description":"Additional filters for files listing","in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/media.files.list"}}],"responses":{"200":{"description":"Media files list","schema":{"$ref":"#/definitions/media.files.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":"List device media files","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Media files"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"post":{"consumes":["multipart/form-data"],"description":"Upload a media file to device media storage.\n\nOnly single device is allowed in selector. Only single file can be uploaded at a time.\n\nThe uploaded file will be stored in device media storage and will be available for listing and downloading via GET methods.\n\nCall format: **POST /gw/devices/{dev-selector}/media**.\n","parameters":[{"description":"file data","in":"formData","name":"file","required":true,"type":"file"},{"description":"additional file parameters","in":"formData","name":"data","required":true,"schema":{"$ref":"#/definitions/media.file.post"}}],"responses":{"200":{"description":"uploaded file data","schema":{"$ref":"#/definitions/media.files.upload.result"}},"400":{"description":"incorrect parameters"},"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"}},"404":{"description":"no such device"},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Upload media file to device","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Media files"},"put":{"description":"Attach own data to device media file.\n\nDevices receive media files such as videos and photos and store them in internal media storage.\nEach media file is uniquely identified by 'uuid' parameter and can be accessed from Internet directly and without authentication via its 'url' parameter.\n\nYou can attach/update own data to device media for management purposes but you are unable to change standard device media file parameters like, link, uuid, created and so on.\n\nIt is safe to use 'all' in dev-selector as the device itself will be identified by media file uuid from call arguments.\n\nCall format: **PUT /gw/devices/{dev-selector}/media**.\n","parameters":[{"description":"File selector with new parameters to apply","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/media.file.update"}}],"responses":{"200":{"description":"collection of affected devices","schema":{"$ref":"#/definitions/id.result"}},"400":{"description":"incorrect parameters"},"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"}},"404":{"description":"no such device"},"500":{"description":"Server is unable to process request at the moment, try again later.\n"}},"security":[{"FlespiToken":[]}],"summary":"Attach own data to media file","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Media files"}},"/devices/{dev-selector}/messages":{"get":{"description":"Retrieve messages that are currently accumulated in the device storage.\n\nThe request without parameters will return all device messages currently stored.\nAll device messages filtering parameters should be wrapped inside data={...} argument. For example to return only messages between with X and Y timestamps use:\n**GET /gw/devices/{dev-selector}/messages?data={\"from\":X,\"to\":Y}**\n\nThe [device messages storage is controlled](https://flespi.com/kb/how-to-manage-device-storage) by 'messages_ttl' and 'messages_rotate' fields from device configuration which define how long and how many messages are stored in the device.\nAnd with this API call you can access this storage - search for specific messages, retrieve them all and even perfom basic generalization math with 'generalize' API call parameter.\n\nReply contains device messages sorted by timestamp, in case you request messages from multiple devices simultaneously there is no specific sort order in the output.\n\nTo improve the performance of the call always specify 'from' and 'to' parameters with corresponding UNIX timestamps for which you want to retrieve device messages.\nIf you will specify it only inside 'filter' the call will still iterate through all messages in device which on large volumes and large number of devices may slow down your operation.\n\n'filter' parameter can be used to select only subset of messages. In filter you can utilize powerful [flespi expressions](https://flespi.com/kb/expressions).\n\nSome filter values that you may use:\n * **server.timestamp - timestamp > 3600** - will return messages which were reported by the device with the latency more than 1 hour, this usually indicates towards connectivity problems.\n * **exists('can.vehicle.mileage') || exists('vehicle.mileage')** - will return only messages where there is either can.vehicle.mileage or vehicle.mileage parameters present.\n * **timestamp - previous('timestamp') > 3600** - will return only messages which are reported by the device with at least 1 hour gap after previous message, this usualy indicates towards device data gathering problem.\n * **json_array_count(ble.beacons)** - will return only messages with at least one beacon defined inside ble.beacons parameter (which is JSON array).\n\nYou may use 'reverse' parameter with 'true' value to search and return messages backwards. In that case if you specify 1 in 'count' parameter you will receive just single latest message registered for the device.\n\nParameter 'fields' can be used to specify comma-separated list of fields to return for each message.\nYou can use wildcards there, for example fields with value \"can.*,timestamp\" will return in messages just timestamp parameter and all parameters which name start from can.\n\nNon-zero **generalize** parameter will group device messages based on the generalization interval in seconds. Only timestamps that are multiple to the specified generalization interval will be returned with recalculated parameter values according to the specified generalization method.\nIt may be possible that the first returned timestamp will be less than the specified 'from' timestamp if the 'from' timestamp is not a multiple of a generalization interval.\n\n'dev-selector' specifies selection of devices from which to retrieve messages. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to retrieve messages from device with ident (IMEI) 'xxxx' in its configuration.\n\nCall format: **GET /gw/devices/{dev-selector}/messages**.\n\nIf you want to retrieve via API just the latest values of parameters sent by device take a look at [GET /gw/devices/{dev-selector}/telemetry/{telemetry-selector}](https://flespi.io/docs/#/gw/devices/get_devices_dev_selector_telemetry_telemetry_selector) method.\nIt will return you the latest values of all or selected parameters sent by device for the last year.\n","parameters":[{"in":"query","name":"data","schema":{"$ref":"#/definitions/device.messages.get"}}],"responses":{"200":{"description":"Devices messages array from devices selected by dev-selector","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Collection of device messages","items":{"$ref":"#/definitions/device.message"},"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":"Retrieve messages stored by the device","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"History and State"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"post":{"description":"This method is useful when you need to post device messages or overwrite their values manually.\nFor example, to mark up driver assignments, you need to register a message with a driver code and create a calculator based on this parameter.\nIt is also suitable for simulating the message flow of a device via REST API.\n\nAlso you can override invalid or bad parameters in the message either by registering message with 'null' values using the same timestamp or just by correcting them with good value.\n\n'dev-selector' specifies selection of devices to which to post messages. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to post messages to device with ident (IMEI) 'xxxx' in its configuration.\n\nDuring message posting device will merge messages with the same timestamp (and/or timestamp.key parameter) and reflect there only latest parameter values.\n\nThe message registered via REST API is preprocessed on the server and slightly different than messsage registered by the channel:\n - It has a 'rest.timestamp' parameter;\n - It has neither 'server.timestamp' nor 'channel.id' parameters;\n\nCall format: **POST /gw/devices/{dev-selector}/messages** where inside body data you specify up to 1000 messages.\n\nIf you selected multiple devices inside 'dev-selector' - all passed messages will be posted to all of them.\n\nIn flespi.io you may simplify re-posting messages between devices, channels, stream by using UI tools. [Read this KB article](https://flespi.com/kb/how-to-re-post-historical-data) for more information.\n","parameters":[{"in":"body","name":"data","required":true,"schema":{"description":"Messages array","items":{"additionalProperties":true,"description":"Message object","maxProperties":1000,"type":"object"},"maxItems":1000,"type":"array"}}],"responses":{"200":{"description":"Messages registration result","schema":{"properties":{"device_id":{"description":"Device ID","format":"uint32","type":"number"},"msgs_count":{"description":"Successfully registered messages count","format":"uint32","type":"number"}},"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":"Register messages into device","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"History and State"}},"/devices/{dev-selector}/messages/calculate":{"get":{"description":"Split device messages on intervals according to specified calculation rules. This is [reports engine](https://flespi.com/kb/analytics-reports-and-events-engine) in its manual mode.\n\n'dev-selector' specifies selection of devices from which to retrieve intervals. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to calculate messages from device with ident (IMEI) 'xxxx' in its configuration.\n\nInside call data in so-called [interval selectors](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors) you define the rules on how to split device messages on intervals.\n\nOnce intervals are defined, [interval counters](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters) apply that calculate each message in interval according to specified logic.\n\nThe generated interval message contains interval begin and end time, duration and all calculated properties defined by interval counters.\n\nRead more about [flespi reports engine](https://flespi.com/kb/analytics-reports-and-events-engine) in KB.\n\nCall format: **GET /gw/devices/{dev-selector}/messages/calculate**.\n\nIf you selected multiple devices inside 'dev-selector' - you will retrieve intervals from all them.\n\nIn that case to distinguish from which device each interval comes from we recommend to define interval counter of type 'parameter' with parameter 'device.id' or 'ident' which will copy 'device.id' or 'ident' parameter from the message into the interval.\n","parameters":[{"description":"Intervals calculation algorithm","in":"query","name":"data","required":true,"schema":{"$ref":"#/definitions/container.intervals.calculate"}}],"responses":{"200":{"description":"result with calculated intervals array","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"calculated intervals","items":{"$ref":"#/definitions/container.interval"},"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":"Split devices messages into intervals (run reports)","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/calcs"},"x-view-group":"History and State"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}]},"/devices/{dev-selector}/packets":{"get":{"description":"Retrieve raw traffic packets for selected device. Raw traffic packets are returned in base64 format.\n\nTo retrieve parsed (as JSON) device messages history use **GET /gw/devices/{dev-selector}/messages** API call instead.\n\nIn flespi.io we suggest to use integrated utility available in device 'Logs & Messages' tab under TRAFFIC button.\nThere you can see traffic between device and server in HEX/TEXT modes and conveniently export it.\n\nTraffic is available in limited volume and for limited time only.\nDepending on the channel traffic storage can be very low. If you need more traffic for diagnostics connect devices over different channels.\nWe recommend up to 1000 devices per channel for adequate traffic volume storage.\n\nThis method is intended for diagnostics usage only and not guarantee to always return latest device traffic.\nFor some protocols, where within one connection we receive data from multiple devices simultaneously it is not possible to access traffic from the device\nand you should use channel traffic looking for 'unidentified' ident which contain packets that do not belong to single device.\n\n'dev-selector' specifies selection of devices from which to fetch the raw traffic. You should select single device in the selector. It is better to specify device by ID.\n\nCall format: **GET /gw/devices/{dev-selector}/packets**.\n","parameters":[{"in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/item.packets.get"}}],"responses":{"200":{"description":"Result array with packets of specified device","schema":{"properties":{"result":{"description":"Array of packets of specified device","items":{"$ref":"#/definitions/item.packets"},"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":"Retrieve raw device traffic","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}]},"/devices/{dev-selector}/settings/{sett-selector}":{"delete":{"description":"Depending on the 'pending' boolean flag in the request data the call will either cancel the attempt to remotely apply new setting value (counter-measure against corresponding PUT call)\nor just clears cached setting value in flespi in order to re-read it from the device.\nIn the second case corresponding read command will be sent to the device once it is connected.\nIf device is already connected the server will immediately send the request to read the setting.\n\n'dev-selector' specifies selection of devices from which to clear current setting value. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to delete settings from device with ident (IMEI) 'xxxx' in its configuration.\n\nWithin selected devices you specify which setting value to clear in this API call. Usually you specify exact setting name e.g. 'backend.server1' to clear setting with name backend.server1.\n\nDevice setting is a shadow of device configuration option cached and stored in flespi. You read current known setting values from their 'current' property.\nYou delete setting to force flespi to re-read configuration option from the device.\nOr you can put new configuration value into 'pending' state of corresponding setting which flespi will try to apply to the device once it is connected to server.\nAfter successfull setting application to the remote device flespi will indicate this into logs and copy 'pending' value of setting into 'current'.\n\nCall format: **DELETE /gw/devices/{dev-selector}/settings/{sett-selector}**.\n\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","in":"query","parameters":[{"description":"Optional flag modifying the delete semantics. With `pending=true` the call cancels a pending setting update request; without it the cached setting value is cleared and flespi will re-read it from the device on next connection.\n","in":"query","name":"data","required":false,"schema":{"properties":{"pending":{"description":"When true, cancels a pending setting update request instead of clearing the cached current value.","type":"boolean"}},"type":"object"}}],"required":false,"responses":{"200":{"description":"Deleted settings names for each affected device.","schema":{"$ref":"#/definitions/settings.delete"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Re-read setting value from the device or cancel setting update request","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: settings\n"},"get":{"description":"Get specified device settings, their schemes and values.\n\n'dev-selector' specifies selection of devices from which to retrieve settings. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to retrieve settings from device with ident (IMEI) 'xxxx' in its configuration.\n\nWithin selected devices you specify which settings to select for return in this API call.\nYou can use 'all' in 'sett-selector' to select all available device settings or specify exact setting names in comma-separated format e.g. 'obd.mileage,backend.server1' to return only settings with name obd.mileage and backend.server1.\n\nDevice setting is a shadow of device configuration option cached and stored in flespi. You read current known setting values from their 'current' property.\nYou can delete setting to force flespi to re-read configuration option from the device.\nOr you can put new configuration value into 'pending' state of corresponding setting which flespi will try to apply to the device once it is connected to server.\nAfter successfull setting application to the remote device flespi will indicate this into logs and copy 'pending' value of setting into 'current'.\n\nIf you send a setting as a command to flespi, its new value will be automatically reflected in 'current' once command successfully executed.\n\nCall format: **GET /gw/devices/{dev-selector}/settings/{sett-selector}**.\n\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"$ref":"#/parameters/settings.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Settings collection.","schema":{"$ref":"#/definitions/settings"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Retrieve device settings","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: settings\n"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"},{"$ref":"#/parameters/sett-selector"}],"put":{"description":"Post to specified device setting new 'pending' value to remotely change device configuration once device will be in connected state.\nIf device is already connected the server will immediately send the request to change the setting.\n\nDepending on the device protocol and update procedure implementation some settings will wait for confirmation from the device and some will reflect the update immediately after sending corresponding command to the device.\n\nTo cancel pending setting request you may call **DELETE /gw/devices/{dev-selector}/settings/{sett-selector}** with same setting name specified in sett-selector and pending=true flag in call parameters.\n\n'dev-selector' specifies selection of devices to which to send the setting. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\nMost popular selector is configuration.ident=\"xxxx\", to update settings in device with ident (IMEI) 'xxxx' in its configuration.\n\nWithin selected devices you specify which setting to update in this API call. Usually you specify exact setting name e.g. 'backend.server1' to update setting with name backend.server1.\n\nDevice setting is a shadow of device configuration option cached and stored in flespi. You read current known setting values from their 'current' property.\nYou can delete setting to force flespi to re-read configuration option from the device.\nOr you can put new configuration value into 'pending' state of corresponding setting which flespi will try to apply to the device once it is connected to server.\nAfter successfull setting application to the remote device flespi will indicate this into logs and copy 'pending' value of setting into 'current'.\n\nIf you send a setting as a command to flespi, its new value will be automatically reflected in 'current' once command successfully executed.\n\nCall format: **PUT /gw/devices/{dev-selector}/settings/{sett-selector}**.\n\nBoth commands and settings APIs can be utilized to remotely control the device with slightly different behaviour.\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"$ref":"#/parameters/settings.fields"},{"description":"New value of device setting","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/setting.put"}}],"responses":{"200":{"description":"Updated value of device settings affected by the call","schema":{"$ref":"#/definitions/settings"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Request device to apply new setting value","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: settings\n"}},"/devices/{dev-selector}/sms":{"get":{"description":"Generate SMS message text corresponding to the command specified in API call parameters and selected devices configuration.\n\nSMS message can be sent to the device by using modem or phone outside of flespi.\n\nREST API call response will contain SMS text for each requested command.\n\n'dev-selector' specifies selection of devices for which to generate SMS text. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\nCall format: **GET /gw/devices/{dev-selector}/sms**.\n\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"description":"Array of commands for which to generate SMS text.","in":"query","name":"data","required":true,"schema":{"items":{"$ref":"#/definitions/devices.sms.any"},"maxItems":20,"minItems":1,"title":"Commands","type":"array"}}],"responses":{"200":{"description":"Commands collection.","schema":{"$ref":"#/definitions/devices.sms.array"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Generate SMS message text for the command","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: SMS\n"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"}],"post":{"description":"Execute command over device in real-time via SMS.\nSMS commands are executed only if suitable connected [modem](https://flespi.com/kb/modem-instance-to-send-sms) is available at the moment.\n\nREST API call response will contain text of sent SMS message.\n\n'dev-selector' specifies selection of devices to which send SMS. You may select 'all' devices or select them by ID, or using filter such as configuration.ident=\"<ident>\", name=\"<name>\" or other criterias specified in dev-selector.\n\nCall format: **POST /gw/devices/{dev-selector}/sms**.\n\nPlease read more about flespi [commands and settings](https://flespi.com/kb/commands-and-settings) in our KB.\n","parameters":[{"in":"body","name":"data","required":true,"schema":{"description":"Commands array to send via SMS","items":{"$ref":"#/definitions/devices.sms.any"},"maxItems":20,"minItems":1,"title":"Commands","type":"array"}}],"responses":{"200":{"description":"Commands collection.","schema":{"$ref":"#/definitions/devices.sms.array"}},"400":{"description":"Incorrect parameters."},"500":{"description":"Server is unable to process request at the moment, try again later."}},"security":[{"FlespiToken":[]}],"summary":"Send SMS command to the device in real-time","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Remote control: SMS\n"}},"/devices/{dev-selector}/telemetry/{telemetry-selector}":{"delete":{"description":"The method allows you to manually delete irrelevant or incorrect telemetry fields from selected devices.\n\nTo select devices specify filtering conditions within path in 'dev-selector'. Most popular selector is configuration.ident=\"xxxx\", to delete telemetry from device with ident (IMEI) 'xxxx' in its configuration.\n\nWithin selected devices you specify which telemetry fields to delete by this API call.\nYou can use 'all' in 'telemetry-selector' to delete all available telemetry fields or specify exact field names in comma-separated format e.g. 'din1,adc2' to delete only telemetry fields with name din1 and adc2.\nWildcards in field names specification are not supported.\n\nCall format: **DELETE /gw/devices/{dev-selector}/telemetry/{telemetry-selector}**\n","parameters":[{"in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/device.telemetry.delete"}}],"responses":{"200":{"description":"Telemetry cleared successfully","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Array with requested devices and their cleared telemetry","items":{"$ref":"#/definitions/devices.telemetry"},"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":"Delete device telemetry fields\n","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"History and State"},"get":{"description":"Retrieve selected telemetry fields within devices specified in dev-selector. Telemetry fields are cached last known value of each message parameter that was ever received by the device.\nIt is collected and updated automatically during device message registration and stored up to 1 year for each device.\n\nTo select devices specify filtering conditions within path in 'dev-selector'. Most popular selector is configuration.ident=\"xxxx\", to retrieve telemetry from device with ident (IMEI) 'xxxx' in its configuration.\n\nWithin selected devices you specify which telemetry fields to select for return in this API call.\nYou can use 'all' in 'telemetry-selector' to select all available telemetry fields or specify exact field names in comma-separated format e.g. 'din1,adc2' to return only telemetry fields with name din1 and adc2.\nWildcards in field names specification are not supported.\n\nCall format: **GET /gw/devices/{dev-selector}/telemetry/{telemetry-selector}**\n\nIf you want to retrieve via API device messages as a whole take a look at [GET /gw/devices/{dev-selector}/messages](https://flespi.io/docs/#/gw/devices/get_devices_dev_selector_messages) method.\nIt will return you the device messages for selected interval. You may specify in the call parameters reverse=true and count=1 to return just the single latest message sent by the device.\n","responses":{"200":{"description":"Array with selected telemetry fields from selected devices","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Array with selected telemetry fields from selected devices","items":{"$ref":"#/definitions/devices.telemetry"},"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":"Retrieve device telemetry","tags":["devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"History and State"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/dev-selector"},{"$ref":"#/parameters/telemetry-selector"}]},"/geofences":{"post":{"description":"Create new geofence with specified configuration parameters. You pass JSON array with configuration objects - one object per each geofence to create.\nCall format: **POST /gw/geofences?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created geofence\n","parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/geofence.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/geofences.post"}}],"responses":{"200":{"description":"Geofences collection","schema":{"$ref":"#/definitions/geofences.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 new geofence","tags":["geofences"],"x-flespi-extra-parameters":{"grant-access":"create-geofences"},"x-view-group":"Manage"}},"/geofences/{geofences.selector}":{"delete":{"description":"The method will permanently delete selected geofences to which current user(token) has access to.\nAny existing item bindings to the geofence will also be removed. Use with caution!\n\nUse special keyword \"all\" to delete all geofences available for current user(token). Specify filtering conditions within path in 'geofences.selector' to delete only geofences that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for geofences that will be updated by calling corresponding GET method.\n\nCall format: **DELETE /gw/geofences/{geofences.selector}**\n","parameters":[{"$ref":"#/parameters/geofences.selector"}],"responses":{"200":{"description":"Geofences 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":"Delete selected geofences","tags":["geofences"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"},"get":{"description":"Get collection of geofences available for user(token).\n\nUse special keyword \"all\" to retrieve all geofences. Specify filtering conditions within path in 'geofences.selector' to retrieve only geofences that conforms to specified criterias.\n\nCall format: **GET /gw/geofences/{geofences.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/geofences.selector"},{"$ref":"#/parameters/geofence.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Geofences collection","schema":{"$ref":"#/definitions/geofences.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":"List available geofences","tags":["geofences"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"}],"patch":{"description":"The patch method is similar to PUT method but it is used to update only specified keys of the item's JSON fields like metadata or configuration.\n\nCall format: **PATCH /gw/geofences/{geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/geofences.selector"},{"$ref":"#/parameters/geofence.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/geofences.put"}}],"responses":{"200":{"description":"Geofences collection","schema":{"$ref":"#/definitions/geofences.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":"Patch item properties","tags":["geofences"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"},"put":{"description":"Update specified properties for selected geofences.\n\nUse special keyword \"all\" to select all geofences available for current user(token) for update. Specify filtering conditions within path in 'geofences.selector' to update only geofences that conforms to specified criterias.\n\nBefore the update it is recommended to check for geofences that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/geofences/{geofences.selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/geofences.selector"},{"$ref":"#/parameters/geofence.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/geofences.put"}}],"responses":{"200":{"description":"Geofences collection","schema":{"$ref":"#/definitions/geofences.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":"Modify geofence properties","tags":["geofences"],"x-flespi-extra-parameters":{"group-acl":"gw/groups"},"x-view-group":"Manage"}},"/geofences/{geofences.selector}/hittest":{"get":{"description":"The function provides two operation modes:\n1. Test whether a point with arbitrary coordinates is inside the selected geofences.\n2. Filter out selected geofences that are within or intersect a rectangular boundary.\nUse the special keyword \"all\" to hit-test all geofences. Specify filtering conditions within the path in 'geofences.selector' to hit-test only geofences that conform to specified criteria.\n\nCall format: **GET /gw/geofences/{geofences.selector}/hittest?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of the returned JSON.\n","parameters":[{"$ref":"#/parameters/geofences.selector"},{"$ref":"#/parameters/geofence.fields"},{"description":"Point to hit test","in":"query","name":"data","required":true,"schema":{"anyOf":[{"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":"Single point","type":"object"},{"properties":{"max_lat":{"description":"Latitude in degrees, between -90 and +90 inclusive","maximum":90,"minimum":-90,"title":"Maximum latitude","type":"number"},"max_lon":{"description":"Longitude in degrees, between -180 and +180 inclusive","maximum":180,"minimum":-180,"title":"Maximum longitude","type":"number"},"min_lat":{"description":"Latitude in degrees, between -90 and +90 inclusive","maximum":90,"minimum":-90,"title":"Minimum latitude","type":"number"},"min_lon":{"description":"Longitude in degrees, between -180 and +180 inclusive","maximum":180,"minimum":-180,"title":"Minimum longitude","type":"number"}},"required":["min_lat","min_lon","max_lat","max_lon"],"title":"Boundary","type":"object","x-view-order":["min_lat","min_lon","max_lat","max_lon"]}]}}],"responses":{"200":{"description":"Geofences collection","schema":{"$ref":"#/definitions/geofences.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":"Test if the point is inside geofences.","tags":["geofences"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"}]},"/geofences/{geofences.selector}/logs":{"get":{"description":"Get specified geofence logs. The request without parameters will return all geofence logs.\n\n'geofences.selector' specifies selection of geofences from which to retrieve logs. You may select 'all' geofences or select them by ID, name and other criterias specified in geofences.selector.\n\nReply contains geofence logs sorted by timestamp, in case you request logs from multiple geofences sort order is not preserved.\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 geofence logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in geofence 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 /gw/geofences/{geofences.selector}/logs**.\n","parameters":[{"$ref":"#/parameters/geofences.selector"},{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve geofence logs","tags":["geofences"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"}]},"/geofences/{geofences.selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified geofence.\n\nCall format: **GET /gw/geofences/{geofences.selector}/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 geofence logs","tags":["geofences"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/geofences.selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/geofences/{geofences.selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified geofence.\n\nCall format: **POST /gw/geofences/{geofences.selector}/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 geofence logs","tags":["geofences"],"x-view-group":"Utils"}},"/groups":{"post":{"description":"Create new group with specified configuration parameters. You pass JSON array with configuration objects - one object per each group to create.\n\nThe group requires an item type that cannot be changed once created. At present only 'gw/devices' is allowed to create group for [flespi devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker).\n\nCall format: **POST /gw/groups?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created group\n","parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/group.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/groups.post"}}],"responses":{"200":{"description":"Groups collection","schema":{"$ref":"#/definitions/groups.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 new group","tags":["groups"],"x-flespi-extra-parameters":{"grant-access":"create-groups"},"x-view-group":"Manage"}},"/groups/{groups.selector}":{"delete":{"description":"The method will permanently delete selected groups to which current user(token) has access to.\nAny existing item bindings to the group will also be removed. Use with caution!\n\nUse special keyword \"all\" to delete all groups available for current user(token). Specify filtering conditions within path in 'groups.selector' to delete only groups that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for groups that will be updated by calling corresponding GET method.\n\nCall format: **DELETE /gw/groups/{groups.selector}**\n","parameters":[{"$ref":"#/parameters/groups.selector"}],"responses":{"200":{"description":"Groups 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":"Delete selected groups","tags":["groups"],"x-view-group":"Manage"},"get":{"description":"Get collection of groups available for user(token).\n\nUse special keyword \"all\" to retrieve all groups. Specify filtering conditions within path in 'groups.selector' to retrieve only groups that conforms to specified criterias.\n\nCall format: **GET /gw/groups/{groups.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/groups.selector"},{"$ref":"#/parameters/group.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Groups collection","schema":{"$ref":"#/definitions/groups.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":"List available groups","tags":["groups"],"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"}],"patch":{"description":"The patch method is similar to PUT method but it is used to update only specified keys of the item's JSON fields like metadata or configuration.\n\nCall format: **PATCH /gw/groups/{groups.selector}**.\n","parameters":[{"$ref":"#/parameters/groups.selector"},{"$ref":"#/parameters/group.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/groups.put"}}],"responses":{"200":{"description":"Groups collection","schema":{"$ref":"#/definitions/groups.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":"Patch item properties","tags":["groups"],"x-view-group":"Manage"},"put":{"description":"Update specified properties for selected groups.\n\nUse special keyword \"all\" to select all groups available for current user(token) for update. Specify filtering conditions within path in 'groups.selector' to update only groups that conforms to specified criterias.\n\nBefore the update it is recommended to check for groups that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/groups/{groups.selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/groups.selector"},{"$ref":"#/parameters/group.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/groups.put"}}],"responses":{"200":{"description":"Groups collection","schema":{"$ref":"#/definitions/groups.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":"Modify group properties","tags":["groups"],"x-view-group":"Manage"}},"/groups/{groups.selector}/assets/{group.assets.selector}":{"delete":{"description":"Unassign assets from selected group. Once assets are unassigned from the group they will also may be unassigned from corresponding streams, calculators, plugins.\nUse with caution!\n\nSpecify groups from which to unassign assets within path in 'groups.selector' parameter.\nSpecify assets which to unassign from groups within path in 'group.assets.selector' parameter.\n\nBefore the unassignment it is recommended to check for groups and assets that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/groups/{groups.selector}/assets/{group.assets.selector}**.\n","responses":{"200":{"description":"IDs of unassigned assets","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":"Unassign assets from group","tags":["groups","assets"],"x-flespi-extra-parameters":{"subitem-acl":"gw/assets"},"x-view-group":"Assigned assets"},"get":{"description":"Retrieve assets that are assigned to selected group.\n\nSpecify groups for which to retrieve assigned assets within path in 'groups.selector' parameter.\nSpecify assets which within path in 'group.assets.selector' parameter or use special value 'all' to retrieve all assets that are in selected groups.\n\nCall format: **GET /gw/groups/{groups.selector}/assets/{group.assets.selector}**.\n","parameters":[{"$ref":"#/parameters/group.assets.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/group.assets"}},"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 assets in group","tags":["groups","assets"],"x-flespi-extra-parameters":{"subitem-acl":"gw/assets"},"x-view-group":"Assigned assets"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/groups.selector"},{"$ref":"#/parameters/group.assets.selector"}],"post":{"description":"Assign assets to selected group.\n\nSpecify groups to which assign assets within path in 'groups.selector' parameter.\nSpecify assets which to assign to groups within path in 'group.assets.selector' parameter.\n\nCall format: **POST /gw/groups/{groups.selector}/assets/{group.assets.selector}**.\n","parameters":[{"$ref":"#/parameters/group.assets.fields"}],"responses":{"200":{"description":"Collection of assets binded to group","schema":{"$ref":"#/definitions/group.assets"}},"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":"Assign assets to group","tags":["groups","assets"],"x-flespi-extra-parameters":{"subitem-acl":"gw/assets"},"x-view-group":"Assigned assets"}},"/groups/{groups.selector}/devices/{group.devices.selector}":{"delete":{"description":"Unassign devices from selected group. Once devices are unassigned from the group they will also may be unassigned from corresponding streams, calculators, plugins.\nUse with caution!\n\nSpecify groups from which to unassign devices within path in 'groups.selector' parameter.\nSpecify devices which to unassign from groups within path in 'group.devices.selector' parameter.\n\nBefore the unassignment it is recommended to check for groups and devices that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/groups/{groups.selector}/devices/{group.devices.selector}**.\n","responses":{"200":{"description":"IDs of unassigned devices","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":"Unassign devices from group","tags":["groups"],"x-flespi-extra-parameters":{"subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"get":{"description":"Retrieve devices that are assigned to selected group.\n\nSpecify groups for which to retrieve assigned devices within path in 'groups.selector' parameter.\nSpecify devices which within path in 'group.devices.selector' parameter or use special value 'all' to retrieve all devices that are in selected groups.\n\nCall format: **GET /gw/groups/{groups.selector}/devices/{group.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/group.devices.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/group.devices"}},"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 devices in group","tags":["groups"],"x-flespi-extra-parameters":{"subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/groups.selector"},{"$ref":"#/parameters/group.devices.selector"}],"post":{"description":"Assign devices to selected group.\n\nSpecify groups to which assign devices within path in 'groups.selector' parameter.\nSpecify devices which to assign to groups within path in 'dev-selector' parameter.\n\nCall format: **POST /gw/groups/{groups.selector}/devices/{group.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/group.devices.fields"}],"responses":{"200":{"description":"Collection of devices binded to group","schema":{"$ref":"#/definitions/group.devices"}},"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":"Assign devices to group","tags":["groups"],"x-flespi-extra-parameters":{"subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"}},"/groups/{groups.selector}/geofences/{group.geofences.selector}":{"delete":{"description":"Unassign geofences from selected group. Once geofences are unassigned from the group they will also may be unassigned from corresponding streams, calculators, plugins.\nUse with caution!\n\nSpecify groups from which to unassign geofences within path in 'groups.selector' parameter.\nSpecify geofences which to unassign from groups within path in 'group.geofences.selector' parameter.\n\nBefore the unassignment it is recommended to check for groups and geofences that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/groups/{groups.selector}/geofences/{group.geofences.selector}**.\n","responses":{"200":{"description":"IDs of unassigned geofences","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":"Unassign geofences from group","tags":["groups","geofences"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"get":{"description":"Retrieve geofences that are assigned to selected group.\n\nSpecify groups for which to retrieve assigned geofences within path in 'groups.selector' parameter.\nSpecify geofences which within path in 'group.geofences.selector' parameter or use special value 'all' to retrieve all geofences that are in selected groups.\n\nCall format: **GET /gw/groups/{groups.selector}/geofences/{group.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/group.geofences.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/group.geofences"}},"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 geofences in group","tags":["groups","geofences"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/groups.selector"},{"$ref":"#/parameters/group.geofences.selector"}],"post":{"description":"Assign geofences to selected group.\n\nSpecify groups to which assign geofences within path in 'groups.selector' parameter.\nSpecify geofences which to assign to groups within path in 'group.geofences.selector' parameter.\n\nCall format: **POST /gw/groups/{groups.selector}/geofences/{group.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/group.geofences.fields"}],"responses":{"200":{"description":"Collection of geofences binded to group","schema":{"$ref":"#/definitions/group.geofences"}},"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":"Assign geofences to group","tags":["groups","geofences"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"}},"/groups/{groups.selector}/logs":{"get":{"description":"Get specified group logs. The request without parameters will return all group logs.\n\n'groups.selector' specifies selection of groups from which to retrieve logs. You may select 'all' groups or select them by ID, name and other criterias specified in groups.selector.\n\nReply contains group logs sorted by timestamp, in case you request logs from multiple groups sort order is not preserved.\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 group logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in group 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 /gw/groups/{groups.selector}/logs**.\n","parameters":[{"$ref":"#/parameters/groups.selector"},{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve group logs","tags":["groups"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"}]},"/groups/{groups.selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified group.\n\nCall format: **GET /gw/groups/{groups.selector}/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 group logs","tags":["groups"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/groups.selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/groups/{groups.selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified group.\n\nCall format: **POST /gw/groups/{groups.selector}/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 group logs","tags":["groups"],"x-view-group":"Utils"}},"/message-parameters/{message-parameter.selector}":{"get":{"description":"Standard message parameters are unified between multiple channel protocols.\n\nWith this call you can retrieve collection of standard message parameters.\n\nUse special keyword \"all\" to retrieve all standard message parameters. Specify filtering conditions within path in 'message-parameter.selector' to retrieve only message parameters that conforms to specified criterias.\n\nTo retrieve message parameters available for specific protocol [fetch channel protocols](https://flespi.io/docs/#/gw/protocols/get_channel_protocols_channel_protocols_selector) and specify 'message_parameters' in 'fields' query parameter.\n\nCall format: **GET /gw/message-parameters/{message-parameter.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\nThis method is accessible with any token of the account, including ACL tokens, no extra permissions required.\n","parameters":[{"$ref":"#/parameters/message-parameter.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Returned message parameters","schema":{"properties":{"errors":{"items":{"$ref":"#/definitions/error"},"type":"array"},"result":{"items":{"$ref":"#/definitions/message_parameter"},"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":"Fetch standard message parameters","tags":["protocols"],"x-view-group":"Channel protocols"},"parameters":[{"$ref":"#/parameters/message-parameter.selector"}]},"/modems":{"post":{"description":"Create new modem with specified configuration. You pass JSON array with configuration objects - one object per each modem to create.\n\nConfiguration defines [modem type](https://flespi.com/kb/modem-instance-to-send-sms#modem-types) that will be created.\n\nCall format: **POST /gw/modems?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created modem\n","parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/modem-fields"},{"in":"body","name":"data","required":true,"schema":{"items":{"$ref":"#/definitions/modem.post"},"maxItems":1000,"minItems":1,"type":"array"}}],"responses":{"200":{"description":"created modems collection","schema":{"$ref":"#/definitions/modems.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 modem","tags":["modems"],"x-flespi-extra-parameters":{"grant-access":"create-modems"},"x-view-group":"Manage"}},"/modems/{modem-selector}":{"delete":{"description":"Delete selected modems. Use with caution!\n\nUse special keyword \"all\" to delete all modems. Specify filtering conditions within path in 'modem-selector' to delete only modems that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for modems that will be deleted by calling corresponding GET method.\n\nCall format: **DELETE /gw/modems/{modem-selector}**.\n","responses":{"200":{"description":"deleted modem ID's collection.","schema":{"$ref":"#/definitions/modems.id"}},"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 modem","tags":["modems"],"x-view-group":"Manage"},"get":{"description":"Get collection of modems available for user(token).\n\nUse special keyword \"all\" to retrieve all modems. Specify filtering conditions within path in 'modem-selector' to retrieve only modems that conforms to specified criterias.\n\nCall format: **GET /gw/modems/{modem-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/modem-fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"created modems collection","schema":{"$ref":"#/definitions/modems.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 modems","tags":["modems"],"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/modem-selector"}],"patch":{"description":"The patch method is similar to PUT method but it is used to update only specified keys of the item's JSON fields like metadata or configuration.\n\nCall format: **PATCH /gw/modems/{modem-selector}**.\n","parameters":[{"$ref":"#/parameters/modem-fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/modem.put"}}],"responses":{"200":{"description":"updated modems collection","schema":{"$ref":"#/definitions/modems.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":"Patch item properties","tags":["modems"],"x-view-group":"Manage"},"put":{"description":"Update selected modems.\n\nUse special keyword \"all\" to update all modems. Specify filtering conditions within path in 'modem-selector' to update only modems that conforms to specified criterias.\n\nBefore the update it is recommended to check for modems that will be updated by calling corresponding GET method.\n\nCall format: **GET /gw/modems/{modem-selector}?fields=field1,field2,field3**\nwhere fields is an optional arguments to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/modem-fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/modem.put"}}],"responses":{"200":{"description":"updated modems collection","schema":{"$ref":"#/definitions/modems.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":"Update modem configuration","tags":["modems"],"x-view-group":"Manage"}},"/modems/{modem-selector}/logs":{"get":{"description":"Get specified modem logs. The request without parameters will return all modem logs.\n\n'modem-selector' specifies selection of modems from which to retrieve logs. You may select 'all' modems or select them by ID, name and other criterias specified in modem-selector.\n\nReply contains modem logs sorted by timestamp, in case you request logs from multiple modems sort order is not preserved.\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 modem logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in modem 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 /gw/modems/{modem-selector}/logs**.\n","parameters":[{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve modem logs","tags":["modems"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/modem-selector"}]},"/modems/{modem-selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified modem.\n\nCall format: **GET /gw/modems/{modem-selector}/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 modem logs","tags":["modems"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/modem-selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/modems/{modem-selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified modem.\n\nCall format: **POST /gw/modems/{modem-selector}/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 modem logs","tags":["modems"],"x-view-group":"Utils"}},"/plugin-types/{plugin-types.selector}":{"get":{"description":"Get collection of plugin types.\n\nUse special keyword \"all\" to retrieve all plugin types. Specify filtering conditions within path in 'plugin-types.selector' to retrieve only plugin types that conforms to specified criterias.\nMost popular selector is name=\"xxxx\", to retrieve information related to plugin type 'xxxx'.\n\nCall format: **GET /gw/plugin-types/{plugin-types.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\nThis method is accessible with any token of the account, including ACL tokens, no extra permissions required.\n","parameters":[{"$ref":"#/parameters/plugin-type.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Protocols array.","schema":{"$ref":"#/definitions/plugin-types"}},"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 available plugin types","tags":["protocols","plugins"],"x-view-group":"Plugin types"},"parameters":[{"$ref":"#/parameters/plugin-types.selector"}]},"/plugin-types/{plugin-types.selector}/changelog-posts":{"get":{"description":"Retrieve changelog posts accumulated for the selected plugin types, sorted by publication time within each selected plugin type.\n\nEach post published in the plugin type's forum changelog topic (linked in the 'changelog' field of the plugin type) is stored by the platform and available with this method.\nNew posts are also published in realtime into 'flespi/message/gw/plugin-types/{id}/changelog' MQTT topic.\n\nAll filtering parameters should be wrapped inside data={...} argument, for example to return only the latest post of a single selected item use:\n**GET /gw/plugin-types/{plugin-types.selector}/changelog-posts?data={\"reverse\":true,\"count\":1}**\n\nCall format: **GET /gw/plugin-types/{plugin-types.selector}/changelog-posts**\n\nBoth the MQTT topics 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 plugin types","tags":["protocols","plugins"],"x-view-group":"Changelog"},"parameters":[{"$ref":"#/parameters/plugin-types.selector"}]},"/plugins":{"post":{"description":"Create new plugin with specified configuration parameters. You pass JSON array with configuration objects - one object per each plugin to create.\n\nThe plugin requires an item type that cannot be changed once created. At present item_type should only have value 11 (visualized in UI as 'gw/devices') is allowed to create plugin for [flespi devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker).\n\nCall format: **POST /gw/plugins?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created plugin\n","parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/plugin.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/plugins.post"}}],"responses":{"200":{"description":"Plugins collection","schema":{"$ref":"#/definitions/plugins.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 new plugin","tags":["plugins"],"x-flespi-extra-parameters":{"grant-access":"create-plugins"},"x-view-group":"Manage"}},"/plugins/{plugin.selector}":{"delete":{"description":"The method will permanently delete selected plugins to which current user(token) has access to. All existing assigned devices together with their configuration will also be deleted. Use with caution!\n\nUse special keyword \"all\" to delete all available plugins. Specify filtering conditions within path in 'plugin.selector' to delete only plugins that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for plugins that will be deleted by calling corresponding GET method.\n\nCall format: **DELETE /gw/plugins/{plugin.selector}**\n","parameters":[{"$ref":"#/parameters/plugin.selector"}],"responses":{"200":{"description":"Plugins 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":"Delete selected plugins","tags":["plugins"],"x-view-group":"Manage"},"get":{"description":"Get collection of plugins available for user(token).\n\nUse special keyword \"all\" to retrieve all plugins. Specify filtering conditions within path in 'plugin.selector' to retrieve only plugins that conforms to specified criterias.\n\nCall format: **GET /gw/plugins/{plugin.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/plugin.selector"},{"$ref":"#/parameters/plugin.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Plugins collection","schema":{"$ref":"#/definitions/plugins.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":"List available plugins","tags":["plugins"],"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"}],"patch":{"description":"The method will update selected plugins and merge modified fields specified in API call data with existing properties if they are of type JSON object.\nIt is convenient to use this method instead of PUT to update only certain keys inside the plugin configuration.\n\nFor non-JSON plugin properties this method behaviour is identical to corresponding PUT API call.\n\nUse special keyword \"all\" to select all plugins available for current user(token) for update. Specify filtering conditions within path in 'plugin.selector' to update only plugins that conforms to specified criterias.\n\nBefore the update it is recommended to check for plugins that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/plugins/{plugin.selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/plugin.selector"},{"$ref":"#/parameters/plugin.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/plugins.put"}}],"responses":{"200":{"description":"Plugins collection","schema":{"$ref":"#/definitions/plugins.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":"Modify fields inside plugin configuration","tags":["plugins"],"x-view-group":"Manage"},"put":{"description":"Update specified properties for selected plugins.\n\nUse special keyword \"all\" to select all plugins available for current user(token) for update. Specify filtering conditions within path in 'plugin.selector' to update only plugins that conforms to specified criterias.\n\nIf you need to update part of configuration in plugin properties (usualy subset of fields in configuration) corresponding PATCH method will sill simplify such update.\n\nBefore the update it is recommended to check for plugins that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/plugins/{plugin.selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/plugin.selector"},{"$ref":"#/parameters/plugin.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/plugins.put"}}],"responses":{"200":{"description":"Plugins collection","schema":{"$ref":"#/definitions/plugins.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":"Modify plugin properties","tags":["plugins"],"x-view-group":"Manage"}},"/plugins/{plugin.selector}/devices/{plugin.devices.selector}":{"delete":{"description":"Unassign device from plugin and permanently remove data associated with this assignment. Use with caution!\n\nSpecify plugins from which unassign devices within path in 'plugin.selector' parameter.\nSpecify devices which to unassign from plugin within path in 'plugin.devices.selector' parameter.\n\nBefore the unassignment it is recommended to check for affected devices and plugins by calling corresponding GET method.\n\nCall format: **DELETE /gw/plugins/{plugin.selector}/devices/{plugin.devices.selector}**.\n","responses":{"200":{"description":"IDs of unassigned devices","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":"Unassign device from group","tags":["plugins"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"get":{"description":"Retrieve devices that are assigned to selected plugin together with data associated with this device plugin binding.\n\nSpecify plugins for which to retrieve assigned devices within path in 'plugin.selector' parameter.\nSpecify devices which within path in 'plugin.devices.selector' parameter or use special value 'all' to retrieve all devices that are in selected plugins.\n\nCall format: **GET /gw/plugins/{plugin.selector}/devices/{plugin.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.devices.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Devices collection","schema":{"$ref":"#/definitions/plugin.device"}},"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 devices in plugin","tags":["plugins"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/plugin.selector"},{"$ref":"#/parameters/plugin.devices.selector"}],"patch":{"description":"Modify subset of data associated with devices assigned to plugin.\n\nWith this call you may pass part of fields for device/plugin data and it will be merged with existing fields.\nIf you want to change full set of fields for this data you may use corresponding PUT method.\n\nSelect plugins within path in 'plugin.selector' parameter. Specify devices within path in 'plugin.devices.selector' parameter.\n\nCall format: **PATCH /gw/plugins/{plugin.selector}/devices/{plugin.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.devices.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/plugin.device.put"}}],"responses":{"200":{"description":"Updated devices collection","schema":{"$ref":"#/definitions/plugin.devices"}},"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":"Modify subset of device data for plugin","tags":["plugins"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"post":{"description":"Assign devices to plugin. In call parameters you may provide data associated with this device plugin binding.\n\nSpecify plugins to which assign devices within path in 'plugin.selector' parameter.\nSpecify devices which to assign to plugins within path in 'plugin.devices.selector' parameter.\n\nCall format: **POST /gw/plugins/{plugin.selector}/devices/{plugin.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.devices.fields"},{"in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/plugin.devices.post"}}],"responses":{"200":{"description":"Collection of devices binded to plugin","schema":{"$ref":"#/definitions/plugin.devices"}},"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":"Assign devices to plugin","tags":["plugins"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"},"put":{"description":"Modify data associated with devices assigned to plugin.\n\nWith this call you may fully replace data associated with particular plugin for particular device.\nIf you want to change subset of fields for this data use corresponding PATCH method.\n\nSelect plugins within path in 'plugin.selector' parameter. Specify devices within path in 'plugin.devices.selector' parameter.\n\nCall format: **PUT /gw/plugins/{plugin.selector}/devices/{plugin.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.devices.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/plugin.device.put"}}],"responses":{"200":{"description":"Updated devices collection","schema":{"$ref":"#/definitions/plugin.devices"}},"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":"Modify full device data for plugin","tags":["plugins"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Assigned devices"}},"/plugins/{plugin.selector}/geofences/{plugin.geofences.selector}":{"delete":{"description":"Unassign geofences from selected plugin. Once geofences are unassigned from the plugin they will also may be unassigned from corresponding streams, pluginulators, plugins.\nUse with caution!\n\nSpecify plugins from which to unassign geofences within path in 'plugin.selector' parameter.\nSpecify geofences which to unassign from plugins within path in 'plugin.geofences.selector' parameter.\n\nBefore the unassignment it is recommended to check for plugins and geofences that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/plugins/{plugin.selector}/geofences/{plugin.geofences.selector}**.\n","responses":{"200":{"description":"IDs of unassigned geofences","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":"Unassign geofences from plugin","tags":["plugins"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"get":{"description":"Retrieve geofences that are assigned to selected plugin.\n\nSpecify plugins for which to retrieve assigned geofences within path in 'plugin.selector' parameter.\nSpecify geofences which within path in 'plugin.geofences.selector' parameter or use special value 'all' to retrieve all geofences that are in selected plugins.\n\nCall format: **GET /gw/plugins/{plugin.selector}/geofences/{plugin.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.geofences.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/plugin.geofences"}},"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 geofences in plugin","tags":["plugins"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/plugin.selector"},{"$ref":"#/parameters/plugin.geofences.selector"}],"post":{"description":"Assign geofences to selected plugin.\n\nSpecify plugins to which assign geofences within path in 'plugin.selector' parameter.\nSpecify geofences which to assign to plugins within path in 'plugin.geofences.selector' parameter.\n\nCall format: **POST /gw/plugins/{plugin.selector}/geofences/{plugin.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.geofences.fields"}],"responses":{"200":{"description":"Collection of geofences binded to plugin","schema":{"$ref":"#/definitions/plugin.geofences"}},"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":"Assign geofences to plugin","tags":["plugins"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"put":{"description":"Modify data associated with geofences assigned to plugin.\n\nSelect plugins within path in 'plugin.selector' parameter. Specify geofences within path in 'plugin.geofences.selector' parameter.\n\nCall format: **PUT /gw/plugins/{plugin.selector}/geofences/{plugin.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.geofences.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/geofence.subitem.put"}}],"responses":{"200":{"description":"Updated geofences collection","schema":{"$ref":"#/definitions/plugin.geofences"}},"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":"Modify geofence data for plugin","tags":["plugins","geofences"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"}},"/plugins/{plugin.selector}/groups/{plugin.groups.selector}":{"delete":{"description":"Delete assignment of plugin from the group. This may automatically remove assignment of devices to that plugin and their corresponding data.\nUse method with caution!\n\n'plugin.selector' and 'plugin.groups.selector' specify selection of plugins and groups for the API operation.\n\nBefore the deletion it is recommended to check for plugins and groups that will be unassigned by calling corresponding GET method.\n\nCall format: **DELETE /gw/plugins/{plugin.selector}/groups/{plugin.groups.selector}**.\n","responses":{"200":{"description":"IDs of unassigned groups","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":"Unassign a group from plugin","tags":["plugins","groups"],"x-view-group":"Group methods for plugins"},"get":{"description":"Fetch group properties of device to plugin assignment.\n\n'plugin.selector' and 'plugin.groups.selector' specify selection of plugins and groups for the API operation.\n\nCall format: **GET /gw/plugins/{plugin.selector}/groups/{plugin.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.group.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Plugin groups collection","schema":{"$ref":"#/definitions/plugin.group"}},"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 groups assigned to the plugin","tags":["plugins","groups"],"x-view-group":"Group methods for plugins"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/plugin.selector"},{"$ref":"#/parameters/plugin.groups.selector"}],"post":{"description":"Assign group of devices to plugin to automate assignment of devices in the group to this plugin.\n\nYou can control device to plugin assignment configuration with parameters defined in 'plugin.devices.post' definition.\n\nOnce group is assigned to plugin when you add device to the group it will be automatically assigned to corresponding plugin.\n\n'plugin.selector' and 'plugin.groups.selector' specify selection of plugins and groups for the API operation.\n\nCall format: **POST /gw/plugins/{plugin.selector}/groups/{plugin.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.group.fields"},{"in":"body","name":"data","required":false,"schema":{"$ref":"#/definitions/plugin.devices.post"}}],"responses":{"200":{"description":"Collection of groups assigned to plugin","schema":{"$ref":"#/definitions/plugin.groups"}},"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":"Assign a group of devices to a plugin","tags":["plugins","groups"],"x-flespi-extra-parameters":{"subitem-acl":"gw/groups"},"x-view-group":"Group methods for plugins"},"put":{"description":"Change data associated with devices assigned to the plugin via group.\n\n'plugin.selector' and 'plugin.groups.selector' specify selection of plugins and groups for the API operation.\n\nCall format: **PUT /gw/plugins/{plugin.selector}/groups/{plugin.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/plugin.devices.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/plugin.device.put"}}],"responses":{"200":{"description":"Collection of groups assigned to plugin","schema":{"$ref":"#/definitions/plugin.groups"}},"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":"Update assignment of group of devices to plugin","tags":["plugins"],"x-flespi-extra-parameters":{"subitem-acl":"gw/groups"},"x-view-group":"Group methods for plugins"}},"/plugins/{plugin.selector}/logs":{"get":{"description":"Get specified plugin logs. The request without parameters will return all plugin logs.\n\n'plugin.selector' specifies selection of plugins from which to retrieve logs. You may select 'all' plugins or select them by ID, name and other criterias specified in plugin.selector.\n\nReply contains plugin logs sorted by timestamp, in case you request logs from multiple plugins sort order is not preserved.\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 plugin logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in plugin 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).\nTo select logs generated by the plugin operation with specific device only you may use \"device_id=XXX\" expression, where XXX is device ID.\n\nCall format: **GET /gw/plugins/{plugin.selector}/logs**.\n","parameters":[{"$ref":"#/parameters/plugin.selector"},{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve plugin logs","tags":["plugins"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"}]},"/plugins/{plugin.selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified plugin.\n\nCall format: **GET /gw/plugins/{plugin.selector}/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 plugin logs","tags":["plugins"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/plugin.selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/plugins/{plugin.selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified plugin.\n\nCall format: **POST /gw/plugins/{plugin.selector}/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 plugin logs","tags":["plugins"],"x-view-group":"Utils"}},"/plugins/{plugin.selector}/packets":{"get":{"description":"Retrieve raw traffic packets for selected plugin. Raw traffic packets are returned in base64 format.\nTraffic is gathered for certain plugin types which perform communication with external servers in their communication format, e.g. HTTP or MQTT.\nRaw traffic is a valuable source of information when you need to diagnose any problem with plugin processing especially when plugin retrieves data from external systems, such as geocoders.\n\nIn flespi.io we suggest to use integrated utility available in plugin 'Logs & Messages' tab under TRAFFIC button.\nThere you can investigate traffic between plugin and server in HEX/TEXT modes and conveniently export it.\n\nThis method is intended for diagnostics usage only and not guarantee to always return latest plugin traffic. Traffic is available in limited volume and for limited time only.\n\n'plugin.selector' specifies selection of plugins from which to fetch the raw traffic. You should select only single plugin in selector, preferable to use its ID.\n\nCall format: **GET /gw/plugins/{plugin.selector}/packets**.\n","parameters":[{"in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/item.packets.get"}}],"responses":{"200":{"description":"Result array with packets","schema":{"properties":{"result":{"description":"Array of packets","items":{"$ref":"#/definitions/item.packets"},"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":"Retrieve raw traffic generated by plugin","tags":["plugins"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/plugin.selector"}]},"/stream-protocols/{stream-protocols.selector}":{"get":{"description":"Get collection of stream protocols.\n\nUse special keyword \"all\" to retrieve all stream protocols. Specify filtering conditions within path in 'stream-protocols.selector' to retrieve only protocols that conforms to specified criterias.\nMost popular selector is name=\"xxxx\", to retrieve information related to stream protocol 'xxxx'.\n\nCall format: **GET /gw/stream-protocols/{stream-protocols.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\nThis method is accessible with any token of the account, including ACL tokens, no extra permissions required.\n","parameters":[{"$ref":"#/parameters/stream-channel-protocol.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Returned stream protocols","schema":{"$ref":"#/definitions/stream-protocols"}},"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 available stream protocols","tags":["protocols","streams"],"x-view-group":"Stream protocols"},"parameters":[{"$ref":"#/parameters/stream-protocols.selector"}]},"/stream-protocols/{stream-protocols.selector}/changelog-posts":{"get":{"description":"Retrieve changelog posts accumulated for the selected stream protocols, sorted by publication time within each selected protocol.\n\nEach post published in the stream protocol's forum changelog topic (linked in the 'changelog' field of the stream protocol) is stored by the platform and available with this method.\nNew posts are also published in realtime into 'flespi/message/gw/stream-protocols/{id}/changelog' MQTT topic.\n\nAll filtering parameters should be wrapped inside data={...} argument, for example to return only the latest post of a single selected item use:\n**GET /gw/stream-protocols/{stream-protocols.selector}/changelog-posts?data={\"reverse\":true,\"count\":1}**\n\nCall format: **GET /gw/stream-protocols/{stream-protocols.selector}/changelog-posts**\n\nBoth the MQTT topics 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 stream protocols","tags":["protocols","streams"],"x-view-group":"Changelog"},"parameters":[{"$ref":"#/parameters/stream-protocols.selector"}]},"/streams":{"post":{"description":"Create new stream with specified configuration parameters. You pass JSON array with configuration objects - one object per each stream to create.\n\nCall format: **POST /gw/streams?fields=field1,field2,field3**\nwhere fields is optional argument to minimize the size of returned JSON for each created stream\n","parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.fields"},{"in":"body","name":"data","required":true,"schema":{"items":{"$ref":"#/definitions/stream.post"},"maxItems":1000,"minItems":1,"type":"array"}}],"responses":{"200":{"description":"Streams collection.","schema":{"$ref":"#/definitions/streams"}},"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 new stream","tags":["streams"],"x-flespi-extra-parameters":{"grant-access":"create-streams"},"x-view-group":"Manage"}},"/streams/{stream.selector}":{"delete":{"description":"The method will permanently delete selected streams to which current user(token) has access to. Use with caution!\n\nUse special keyword \"all\" to delete all available streams. Specify filtering conditions within path in 'stream.selector' to delete only streams that conforms to specified criterias.\n\nBefore the deletion it is recommended to check for streams that will be deleted by calling corresponding GET method.\n\nCall format: **DELETE /gw/streams/{stream.selector}**\n","responses":{"200":{"description":"Deleted streams identifiers collection.","schema":{"$ref":"#/definitions/streams.id"}},"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 selected streams","tags":["streams"],"x-view-group":"Manage"},"get":{"description":"Get collection of streams available for user(token).\n\nUse special keyword \"all\" to retrieve all streams. Specify filtering conditions within path in 'stream.selector' to retrieve only streams that conforms to specified criterias.\n\nCall format: **GET /gw/streams/{stream.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/stream.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Streams collection.","schema":{"$ref":"#/definitions/streams"}},"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":"List available streams","tags":["streams"],"x-view-group":"Manage"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"}],"patch":{"description":"The patch method is similar to PUT method but it is used to update only specified keys of the item's JSON fields like metadata or configuration.\n\nCall format: **PATCH /gw/streams/{stream.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/stream.put"}}],"responses":{"200":{"description":"Streams collection.","schema":{"$ref":"#/definitions/streams"}},"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":"Patch item properties","tags":["streams"],"x-view-group":"Manage"},"put":{"description":"Update specified properties for selected streams.\n\nUse special keyword \"all\" to select all streams available for current user(token) for update. Specify filtering conditions within path in 'stream.selector' to update only streams that conforms to specified criterias.\n\nThe schema of configuration passed to stream in data parameter should match to configuration schema defined by the corresponding stream type.\n\nBefore the update it is recommended to check for streams that will be updated by calling corresponding GET method.\n\nCall format: **PUT /gw/streams/{stream.selector}?fields=field1,field2,field3**\nwhere fields is an optional argument to minimize the size of returned JSON\n","parameters":[{"$ref":"#/parameters/stream.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/stream.put"}}],"responses":{"200":{"description":"Streams collection.","schema":{"$ref":"#/definitions/streams"}},"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":"Modify stream properties","tags":["streams"],"x-view-group":"Manage"}},"/streams/{stream.selector}/channels/{stream.channels.selector}":{"delete":{"description":"Unsubscribe selected streams from selected channels. Stream will stop receiving new messages from channel but will send any channel message already queued for delivery in stream buffer.\n\nSpecify streams in 'stream.selector' parameter. Specify channels in 'stream.channels.selector' parameter.\n\nCall format: **DELETE /gw/streams/{stream.selector}/channels/{stream.channels.selector}**.\n","responses":{"200":{"description":"Collection of unsubscribed channels ids.","schema":{"$ref":"#/definitions/stream.channels.id"}},"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 stream from channels","tags":["streams","channels"],"x-view-group":"Streaming channels"},"get":{"description":"Retrieve list of channels stream is subscribed to.\n\nSpecify streams in 'stream.selector' parameter. Specify channels in 'stream.channels.selector' parameter.\n\nCall format: **GET /gw/streams/{stream.selector}/channels/{stream.channels.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.channels.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/stream.channels"}},"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":"List channels to which stream is subscribed","tags":["streams","channels"],"x-view-group":"Streaming channels"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"},{"$ref":"#/parameters/stream.channels.selector"}],"post":{"description":"Subscribe stream to channel messages.\n\nSpecify streams in 'stream.selector' parameter. Specify channels in 'stream.channels.selector' parameter.\n\nCall format: **POST /gw/streams/{stream.selector}/channels/{stream.channels.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.channels.fields"}],"responses":{"200":{"description":"Channels collection.","schema":{"$ref":"#/definitions/stream.channels"}},"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 stream to channel messages","tags":["streams","channels"],"x-view-group":"Streaming channels"},"x-flespi-extra-parameters":{"subitem-acl":"gw/channels"}},"/streams/{stream.selector}/devices/{stream.devices.selector}":{"delete":{"description":"Unsubscribe selected streams from selected channels. Stream will stop receiving new messages from device but will send any device message already queued for delivery in stream buffer.\n\nSpecify streams in 'stream.selector' parameter. Specify devices in 'stream.devices.selector' parameter.\n\nCall format: **DELETE /gw/streams/{stream.selector}/devices/{stream.devices.selector}**.\n","responses":{"200":{"description":"Collection of unsubscribed devices ids.","schema":{"$ref":"#/definitions/stream.devices.id"}},"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 stream from devices","tags":["streams","devices"],"x-view-group":"Streaming devices"},"get":{"description":"Retrieve list of devices stream is subscribed to.\n\nSpecify streams in 'stream.selector' parameter. Specify devices in 'stream.devices.selector' parameter.\n\nCall format: **GET /gw/streams/{stream.selector}/devices/{stream.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.devices.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/stream.devices"}},"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":"List devices to which stream is subscribed","tags":["streams","devices"],"x-view-group":"Streaming devices"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"},{"$ref":"#/parameters/stream.devices.selector"}],"post":{"description":"Subscribe stream to device messages.\n\nSpecify streams in 'stream.selector' parameter. Specify devices in 'stream.devices.selector' parameter.\n\nCall format: **POST /gw/streams/{stream.selector}/devices/{stream.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.devices.fields"}],"responses":{"200":{"description":"Devices collection.","schema":{"$ref":"#/definitions/stream.devices"}},"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 stream to device messages","tags":["streams","devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Streaming devices"},"put":{"description":"Modify data associated with devices assigned to stream.\n\nSelect plugins within path in 'plugin.selector' parameter. Specify devices within path in 'stream.devices.selector' parameter.\n\nCall format: **PUT /gw/streams/{stream.selector}/devices/{stream.devices.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.devices.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/stream.device.put"}}],"responses":{"200":{"description":"Updated devices collection","schema":{"$ref":"#/definitions/stream.devices"}},"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":"Modify device data for stream","tags":["streams","devices"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/devices"},"x-view-group":"Streaming devices"}},"/streams/{stream.selector}/geofences/{stream.geofences.selector}":{"delete":{"description":"Unassign geofences from selected stream. Once geofences are unassigned from the stream they will also may be unassigned from corresponding streams, streamulators, streams.\nUse with caution!\n\nSpecify streams from which to unassign geofences within path in 'stream.selector' parameter.\nSpecify geofences which to unassign from streams within path in 'stream.geofences.selector' parameter.\n\nBefore the unassignment it is recommended to check for streams and geofences that will be affected by calling corresponding GET method.\n\nCall format: **DELETE /gw/streams/{stream.selector}/geofences/{stream.geofences.selector}**.\n","responses":{"200":{"description":"IDs of unassigned geofences","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":"Unassign geofences from stream","tags":["streams"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"get":{"description":"Retrieve geofences that are assigned to selected stream.\n\nSpecify streams for which to retrieve assigned geofences within path in 'stream.selector' parameter.\nSpecify geofences which within path in 'stream.geofences.selector' parameter or use special value 'all' to retrieve all geofences that are in selected streams.\n\nCall format: **GET /gw/streams/{stream.selector}/geofences/{stream.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.geofences.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Items collection","schema":{"$ref":"#/definitions/stream.geofences"}},"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 geofences in stream","tags":["streams"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"},{"$ref":"#/parameters/stream.geofences.selector"}],"post":{"description":"Assign geofences to selected stream.\n\nSpecify streams to which assign geofences within path in 'stream.selector' parameter.\nSpecify geofences which to assign to streams within path in 'stream.geofences.selector' parameter.\n\nCall format: **POST /gw/streams/{stream.selector}/geofences/{stream.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.geofences.fields"}],"responses":{"200":{"description":"Collection of geofences binded to stream","schema":{"$ref":"#/definitions/stream.geofences"}},"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":"Assign geofences to stream","tags":["streams"],"x-flespi-extra-parameters":{"subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"},"put":{"description":"Modify data associated with geofences assigned to stream.\n\nSelect streams within path in 'stream.selector' parameter. Specify geofences within path in 'stream.geofences.selector' parameter.\n\nCall format: **PUT /gw/streams/{stream.selector}/geofences/{stream.geofences.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.geofences.fields"},{"in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/geofence.subitem.put"}}],"responses":{"200":{"description":"Updated geofences collection","schema":{"$ref":"#/definitions/stream.geofences"}},"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":"Modify geofence data for stream","tags":["streams","geofences"],"x-flespi-extra-parameters":{"group-acl":"gw/groups","subitem-acl":"gw/geofences"},"x-view-group":"Assigned geofences"}},"/streams/{stream.selector}/groups/{stream.groups.selector}":{"delete":{"description":"Unsubscribe stream from selected groups and stop streaming their devices.\n\nSpecify streams in 'stream.selector' parameter. Specify groups in 'stream.groups.selector' parameter.\n\nCall format: **DELETE /gw/streams/{stream.selector}/groups/{stream.groups.selector}**.\n","responses":{"200":{"description":"Collection of unsubscribed groups ids.","schema":{"$ref":"#/definitions/stream.devices.id"}},"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 stream from group","tags":["streams","groups"],"x-view-group":"Streaming devices in groups"},"get":{"description":"Retrieve list of groups stream is subscribed to.\n\nSpecify streams in 'stream.selector' parameter. Specify groups in 'stream.groups.selector' parameter.\n\nCall format: **GET /gw/streams/{stream.selector}/groups/{stream.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.groups.fields"},{"$ref":"#/parameters/limit"},{"$ref":"#/parameters/offset"}],"responses":{"200":{"description":"Groups collection.","schema":{"$ref":"#/definitions/stream.groups"}},"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":"List groups to which stream is subscribed","tags":["streams","groups"],"x-view-group":"Streaming devices in groups"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"},{"$ref":"#/parameters/stream.groups.selector"}],"post":{"description":"Subscribe stream to messages from all devices in the group.\n\nSpecify streams in 'stream.selector' parameter. Specify groups in 'stream.groups.selector' parameter.\n\nCall format: **POST /gw/streams/{stream.selector}/groups/{stream.groups.selector}**.\n","parameters":[{"$ref":"#/parameters/stream.groups.fields"}],"responses":{"200":{"description":"Groups collection.","schema":{"$ref":"#/definitions/stream.groups"}},"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 stream to group of devices","tags":["streams","groups"],"x-flespi-extra-parameters":{"subitem-acl":"gw/groups"},"x-view-group":"Streaming devices in groups"}},"/streams/{stream.selector}/logs":{"get":{"description":"Get specified stream logs. The request without parameters will return all stream logs.\n\n'stream.selector' specifies selection of streams from which to retrieve logs. You may select 'all' streams or select them by ID, name and other criterias specified in stream.selector.\n\nReply contains stream logs sorted by timestamp, in case you request logs from multiple streams sort order is not preserved.\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 stream logs.\nIf you will specify it only inside 'filter' the call will still iterate through all logs in stream 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 /gw/streams/{stream.selector}/logs**.\n","parameters":[{"description":"Parameters to filter retrieved logs","in":"query","name":"data","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":"Retrieve stream logs","tags":["streams"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"}]},"/streams/{stream.selector}/logs/calculate":{"get":{"description":"Calculate intervals from logs for specified stream.\n\nCall format: **GET /gw/streams/{stream.selector}/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 stream logs","tags":["streams"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"}],"post":{"deprecated":true,"description":"**Deprecated**: use **GET /gw/streams/{stream.selector}/logs/calculate** instead.\n\nCalculate intervals from logs for specified stream.\n\nCall format: **POST /gw/streams/{stream.selector}/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 stream logs","tags":["streams"],"x-view-group":"Utils"}},"/streams/{stream.selector}/messages":{"delete":{"description":"Remove all messages from the stream queue to cleanup its buffer. Will cancel the delivery of all queued messages. Use with caution!\n\n'stream.selector' specifies selection of streams for which to clean the queue. You should select single stream only. It is better to select stream by ID in this method.\n\nCall format: **DELETE /gw/streams/{stream.selector}/messages**.\n","responses":{"200":{"description":"Successful response","schema":{"$ref":"#/definitions/streams.id"}},"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":"Remove all messages from the stream queue.","tags":["streams"],"x-view-group":"Messages"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"}],"post":{"description":"Post emulated device messages to stream queue.\nMessages will be added qeued for the delivery to target server.\nYou can use same JSON for the message as the normal device message JSON.\nIf message JSON is incomplete this may result in delivery errors or skipped delivery attempts records in stream logs.\n\n'stream.selector' specifies selection of streams for which to queue these messages. You should select single stream only. It is better to select stream by ID in this method.\n\nCall format: **POST /gw/streams/{stream.selector}/messages**.\n","parameters":[{"description":"Messages to post into the stream queue.","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/stream.messages.post"}}],"responses":{"200":{"description":"Successful response","schema":{"properties":{"errors":{"$ref":"#/definitions/errors"},"result":{"description":"Indexes of the affected streams","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":"Post messages to stream queue","tags":["streams"],"x-view-group":"Messages"}},"/streams/{stream.selector}/packets":{"get":{"description":"Retrieve raw traffic packets for selected stream. Raw traffic packets are returned in base64 format.\nTraffic is gathered between stream and target server in its original communication format, e.g. HTTP or MQTT.\nRaw traffic is a valuable source of information when you need to diagnose any problem with stream processing or investigate the format in which stream is sending data to your server.\n\nIn flespi.io we suggest to use integrated utility available in stream 'Logs & Messages' tab under TRAFFIC button.\nThere you can investigate traffic between stream and its target server in HEX/TEXT modes and conveniently export it.\n\nThis method is intended for diagnostics usage only and not guarantee to always return latest stream traffic. Traffic is available in limited volume and for limited time only.\n\n'stream.selector' specifies selection of streams from which to fetch the raw traffic. You should select only single stream in selector, preferable to use its ID.\n\nCall format: **GET /gw/streams/{stream.selector}/packets**.\n","parameters":[{"in":"query","name":"data","required":false,"schema":{"$ref":"#/definitions/item.packets.get"}}],"responses":{"200":{"description":"Result array with packets","schema":{"properties":{"result":{"description":"Array of packets","items":{"$ref":"#/definitions/item.packets"},"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":"Retrieve raw traffic generated by stream","tags":["streams"],"x-view-group":"Utils"},"parameters":[{"$ref":"#/parameters/cid-header"},{"$ref":"#/parameters/stream.selector"}]}},"produces":["application/json"],"schemes":["https","http"],"securityDefinitions":{"FlespiToken":{"description":"Authorization through FlespiToken","in":"header","name":"Authorization","type":"apiKey"}},"swagger":"2.0","tags":[{"description":"API for [flespi analytics](https://flespi.com/kb/analytics-reports-and-events-engine) management.\n\nThe API allows you to define the rules for how to split messages stored by devices into intervals and what to calculate inside generated intervals.\nAnalytics is intended to build your own report engine on top of it or to be used as a source of events for your software - e.g. to generate and handle notifications from flespi about certain changes associated with the device.\n\n[Calculators](https://flespi.com/kb/analytics-reports-and-events-engine#calculators) are primary entity in flespi analytics.\nYou define all the calculation configuration math inside calculator and than [assign devices to calculator](https://flespi.com/kb/analytics-reports-and-events-engine#assigned-devices) to apply this math to device.\nOnce assigned to calculator device performs initial intervals calculation followed by automatical intervals update in the background as soon as new device messages are received.\n\nIntervals are defined by [**intervals selectors**](https://flespi.com/kb/analytics-reports-and-events-engine#interval-selectors) configuration.\n\nThen [**counters**](https://flespi.com/kb/analytics-reports-and-events-engine#interval-counters) can be applied to each interval to calculate user-defined metrics (e.g. mileage, engine hours, or any other custom calculations) over device messages.\nIn general with calculators you can detect almost everything that is hapenning with device.\nIncluding geofence enter/exit, inactivity and GPS/connection problems, extract trips, parkings, stops, engine hours and any other user-defined events and calculations.\n\nBe aware that whenever the [calculator configuration](https://flespi.com/kb/analytics-reports-and-events-engine#calculators) changes - or the geofences, assets or device metadata it uses change - the system will recalculate intervals for assigned devices within 'update_period' time and thus may modify them.\nYou control such behaviour with 'update_onchange' field in calculator properties.\n\nEach device assigned to the calculator has a dedicated intervals storage.\nYou can [control](https://flespi.com/kb/how-to-manage-device-storage) the size and duration of this storage with 'intervals_ttl' and 'intervals_rotate' fields in calculator properties.\n\nOne of the possibilities to optimize your flespi storage utilization is to set shorter **messages_ttl** for device messages, say 30-90 days, and set large **intervals_ttl** up to 10 years to store calculated intervals data for a much longer period. Intervals aggregate dozens of messages and thus take up much less space.\n\n###### Calculator intervals\n\nThe generated interval message contains timestamp of its generation, interval begin/end times, duration, id and all calculated counters as properties.\nInterval ID is generated automatically and you use ID if you want to attach own properties to the interval.\nTo attach to the interval your custom properties you use **PUT /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}** API call with corresponding interval ID in 'calc.device.intervals.selector'.\nHowever you can not attach own properties with same names as counters defined for calculator or reserved names such as id, timestamp, begin, end, duration.\n\nCalculated intervals from the corresponding intervals storage you may retrieve via REST API with **GET /gw/calcs/{calcs.selector}/devices/{calc.devices.selector}/intervals/{calc.device.intervals.selector}** call.\nOr via MQTT. MQTT has two sets of topics:\n  * **flespi/state/gw/calcs/{calc_id}/devices/{device_id}/+** - retained topic from which you can retrieve and catch updates of last or active interval that was calculated;\n  * **flespi/interval/gw/calcs/{calc_id}/devices/{device_id}/+** - real-time only topic to which any update with device intervals are published - create, delete, update events as well as last interval activated and deactivated events;\n\nMaximum size of data inside each counter can not exceed 8MB. If it will be larger during interval generation the counter will reset to null and corresponding log message will be added to calculator logs (event_code = 614).\nMaximum total JSON size for the interval message can not exceed 16MB. If it will be larger during generation - calculated device will be disabled with the reason indicated in calculator logs (event_code = 615).\n\n###### Calculator logs\n\nAll log messages in calculators related to intervals contain specific 'reason_code' field which clarifies why this or that interval event happened.\nSame 'reason_code' value is attached to MQTT messages as a user property to understand the reason of this or that interval event.\nIf there are multiple reasons for the event the system will show the reason with bigger code value. List of possible reason codes:\n\n  Reason code | Description\n  -----|------\n  2|timeout waiting for new data\n  5|referenced information has changed, e.g. intervals from referenced calculator\n  10|interval modified via REST API\n  20|received new message from device\n  30|asset interval update\n  47|calculator assigned assets change\n  48|calculator geofences change\n  49|device metadata change\n  50|calculator configuration change\n  90|automatic recalculation due to assigned device properties change\n  95|recalculation due to internal reason\n  100|initial automatic calculation\n  200|manual (forced) synchronization request via REST API\n  250|calculated device is disabled\n","name":"calculators"},{"description":"[Plugins](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices) are the key instance in flespi responsible for the transformation of the message received by the device during its registration process.\nPlugins can transform [device message](https://flespi.com/kb/messages-basic-information-units) into different structure, remove or add new parameters, duplicate it to another device or cancel its registration at all.\n\nPlugins are applied in the order defined by their priority. The higher the number in the priority field, the earlier the plugin will apply.\n\nUse the validate_message field in the plugin configuration to specify the validation [expression](https://flespi.com/kb/expressions) that should succeed for the plugin to apply. If no validation expression is specified, the plugin will apply to all device messages that are being registered.\n\nCurrently plugins can only be applied to [flespi devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker). In the future we may enhance plugins functionality to work with other types of flespi items.\n\nList of available plugin types you can retrieve with [GET /gw/plugin-types/all](https://flespi.io/docs/#/gw/protocols/get_plugin_types_plugin_types_selector) API call.\nConfiguration within each plugin instance should match the configuration schema defined for corresponding plugin type.\nTo stay current with plugin type updates, subscribe to 'flespi/message/gw/plugin-types/{type-id}/changelog' MQTT topic delivering any changes published in the plugin type [changelog](https://forum.flespi.com/t/changelog).\n\nAny device message processed by the plugin is reflected into plugin logs with corresponding device_id and message_timestamp parameters. In the log record event_code parameter defines the result of plugin application:\nEvent code | Description\n-----|------\n324|group was added to plugin\n325|group was removed from plugin\n326|geofence was added to plugin\n327|geofence was removed from plugin\n350|plugin successfully processed device message\n351|plugin failed to process device message\n\nFor event_code=351 you may check field 'reason' for the textual description of the problem (its actual format depends on the actual plugin type) and examine plugin raw traffic that occurred at the same time for more information.\n\nWhenever you need to troubleshoot plugin operation you can investigate raw traffic between flespi plugin and some server.\nYou can fetch traffic packets via API or just use flespi.io panel for this. On 'Logs' tab there is TRAFFIC button and also from each log record you can navigate to associated raw traffic exchange via context menu command.\n","name":"plugins"},{"description":"[Groups](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) help to organize of [flespi devices](https://flespi.com/kb/device-virtual-instance-of-real-tracker) and provide automation in automatic assignment them to [plugins](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices), [streams](https://flespi.com/kb/stream-forward-data-from-gateway) and [calculators](https://flespi.com/kb/calculators-preconfigured-algorithms-for-intervals-extraction-and-calculating).\n\nGroups automate assignment of devices and geofences to calculators, plugins and streams in the same group.\n\nYou can also use groups to simplify access management to devices in [flespi tokens](https://flespi.com/kb/tokens-access-keys-to-flespi-platform).\nSpecial [in-groups ACL option](https://flespi.com/kb/tokens-access-keys-to-flespi-platform#token-groups) provides via the token corresponding access level to all devices inside the group.\n\nGroups also simplify devices selection in REST API calls.\nTo select all devices inside group with ID=X for any REST API operation you may use **groups.id=X** in corresponding 'dev-selector'.\n","name":"groups"},{"description":"[Streams](https://flespi.com/kb/stream-forward-data-from-gateway) push messages into third-party platforms via different protocols.\n\nIt is possible to subscribe a stream to incoming [messages](https://flespi.com/kb/messages-basic-information-units) received by channels or devices.\nStreams subscribed to channels forward messages with plain set of parameters, as reported by the device.\nStreams subscribed to devices forward messages that are enriched with additional device-specific parameters, like device.id, device.name and also this messages can be transformed with [plugins](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices).\nIf the stream is subscribed to both device and channel simultaneously stream will forward only device message and ignore plain message from the channel.\n\nEach stream has persistent message queue that guarantees message delivery. You can control for how long you want to buffer messages in the stream in case the target is unreachable via the **queue_ttl** parameter.\n\nIf **blocked** attribute is not zero, the stream message buffer is full and blocked for new messages.\nUsually this is because used space for stream buffer exceeded the [account limitations](https://flespi.com/kb/how-to-control-account-limitations).\nTo unblock the stream buffer, first check if the stream target receives messages from the stream and if it does, set lower 'queue_ttl' attribute for auto-cleanup. The actual buffer cleanup may take few minutes.\n\nList of available stream protocols you can retrieve with [GET /gw/stream-protocols/all](https://flespi.io/docs/#/gw/protocols/get_stream_protocols_stream_protocols_selector) API call.\nConfiguration within each stream instance should match the configuration schema defined for corresponding stream protocols.\nTo stay current with stream protocol updates, subscribe to 'flespi/message/gw/stream-protocols/{protocol-id}/changelog' MQTT topic delivering any changes published in the stream protocol [changelog](https://forum.flespi.com/t/changelog).\n\nWhenever you need to troubleshoot stream operation you can investigate raw traffic between flespi stream and its target server.\nYou can fetch traffic packets via API or just use flespi.io panel for this. On 'Logs' tab there is TRAFFIC button and also from each log record you can navigate to associated raw traffic exchange via context menu command.\n\nAll stream modification operations are recorded to the common [logs subsystem](https://flespi.io/docs/#/platform/logs).\nIn logs you will see corresponding log records for stream connection attempts, disconnections and also all messages deliveries in batches.\n\n###### Stream logs\n\nStream log records can contain following possible event codes:\n\n  Event code | Description\n  -----|------\n  1|stream was created via REST API\n  2|stream was updated via REST API\n  3|stream was deleted via REST API\n  20|stream was blocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information\n  21|stream was unblocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information\n  401|stream connected successfully\n  402|stream has lost connection\n  403|stream failed to deliver messages\n  405|stream successfully sent the message\n  406|stream skipped the message\n  407|stream connecting\n  410|new subscription was created for stream\n  411|stream subscription was updated\n  412|stream subscription was deleted\n  420|stream was subscribed for device messages\n  422|stream was unsubscribed from device messages\n  430|stream was subscribed for channel messages\n  432|stream was unsubscribed from channel messages\n  433|stream subscribed to group\n  434|stream unsubscribed from group\n  435|geofence was added to stream\n  436|geofence was removed from stream\n\nFor event_code=405 which means stream successfully sent a message to remote target in the log record you can find additional important fields:\n  * ident - ident of the device whose message was sent via the stream\n  * message_timestamp - timestamp of the original message sent via stream\n  * device_id - id of flespi device whose message was sent via the stream (present only if the stream was assigned to device)\n  * ack_latency - how much time it took to process the batch from the moment stream received messages until remote server acknowledged their reciept;\n  * data - any extra data associated with message processing by the stream, optional\n\nevent_code=406 which means that the message was skipped for some reason and was not sent via the stream, has the same fields as event_code=405 and is supplemented by the fields:\n  * reason - the reason why the message was skipped\n  * data - any extra data associated with message processing by the stream, optional\n\nIf you have a stream with growing queue buffer check for growing or large ack_latency which may indicate that your server is unable to process messages from stream in time.\nYou may lower batch configuration for some streams in order to attempt better throughput of your server. Or the best will be to look into your server code and remove any blocking operations.\nStream will send next batch only after acknowledgement from your server.\n\nFor event_code=403, when stream encountered problems during connection, protocol errors or during HTTP POST messages operation, the \"error_code\" field will contain corresponding error code depending on type of stream:\n  * For HTTP streams it will contain HTTP response codes (if target server responses not 200 HTTP code), or may be -1 or -2 (see below).\n  * For MQTT streams it will contain MQTT_CONNECT response code when positive or reflect TCP/SSL connection error when negative.\n  * Wialon retranslator stream type has a single error code (1) - if it is disconnected.\n\nThe possible values for the \"error_code\" field are:\n\n  Error code | Description\n  -----|------\n  -99|SSL certificate error\n  -2|request sent but no response received\n  -1|failed to connect\n  1|unacceptable protocol version\n  2|identifier rejected\n  3|server unavailable\n  4|bad username or password\n  5|connection not authorized\n\nFor event_code=20, the log record contains the block_code, which is the reason of stream blocking. When blocked due to exceeded storage size (block_code=4), which is the size of the intermediate buffer, the stream stops receiving new messages but continues sending them to the target system. It will be automatically unblocked when the size of the buffer goes below the specified limits.\n\nFor event_code=1,2,3 that are recorded when you create, update or delete the stream using REST API each record contains the following standard fields:\n\n Field name | Description\n  --------|----------\n    http_data | original request parameters supplied by the caller; applicable for POST and PUT operations\n    new | item's data with default fields after operation; applicable for POST and PUT operations\n    old | item's data with default fields prior to operation; applicable for DELETE and PUT operations\n    token_id | token ID used to authorize the HTTP request\n    host | IP address from which HTTP request was received\n","name":"streams"},{"description":"Geofences allow you to enhance your telematics solution by incorporating geocoding functionality.\nA geofence is an independent entity characterized by **id, name, geometry (which can be a polygon, circle, or corridor), and metadata**.\nGeofences can be linked with various components such as plugins, calculators, or streams.\nWhen geofences are linked, they can serve as message validators, enabling the processing or filtering (ignoring) of messages.\n- [Streams](https://flespi.com/kb/stream-forward-data-from-gateway) utilize linked geofences to selectively transmit messages that fall within or outside designated geofences.\n- [Plugins](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices) can leverage linked geofences similarly but also enrich message parameters with geofence names and metadata.\n- [Calculators](https://flespi.com/kb/calculators-preconfigured-algorithms-for-intervals-extraction-and-calculating) incorporate linked geofences within selectors, validators, and counters.\n\nAdditionally:\n\n- Geofences can be organized into groups, similar to the [grouping](https://flespi.com/kb/groups-organize-devices-and-simplify-mass-assignments) of devices.\n- Access to geofences can be managed through [ACL](https://flespi.com/kb/tokens-access-keys-to-flespi-platform#sharing-access).\n- Access to geofences from unrelated subaccount can be [granted](https://flespi.com/kb/grants-sharing-access-between-unrelated-subaccounts).\n- Geofences have a priority ranging from 0 to 100. Intersections with geofences of higher priority are checked first.\n- You can perform geofences hit-test operation for a point with arbitrary coordinates using the REST API.\n","name":"geofences"},{"description":"\nAssets are virtual entities in flespi that represent physical objects or resources that can be monitored by different tracking devices over time.\nAn asset maintains a historical record of its associations with devices, enabling seamless aggregation of telemetry data even when the monitoring device changes.\n\nKey features:\n* Can be linked with one or multiple devices sequentially\n* Automatically tracks intervals of device associations\n* Maintains history of which device was linked to the asset at any given time\n* Can be assigned to calculators to provide access to this history from their expressions\n* Facilitates transition from device-centric to asset-centric data architecture\n\nThe primary advantage of assets is their ability to maintain continuous monitoring history regardless of device changes. For example, a trailer asset can aggregate trip data from different trucks that pulled it, driver asset can aggregate trip data from different assigned devices or a vehicle asset can combine telemetry from both its main GPS tracker and a backup beacon device.\n\n###### Asset intervals\n\nAsset can be assigned to the specific device on a certain temporal interval by creating corresponding interval using **POST /gw/assets/{assets.selector}/intervals** call.\nWhen assignment to the interval is registered, asset automatically merges this assignment into all previously registered intervals and update or delete them accordingly.\nAt certain cases it can even split previously registered intervals onto new smaller parts.\n\nAsset maintain a history of such assignments which can be retrieved with **GET /gw/assets/{assets.selector}/intervals**. Each asset interval contains these properties:\n* **timestamp** - interval registration timestamp;\n* **begin** - interval begin time;\n* **end** - interval ending time, may be zero to indicate this interval as unlimited;\n* **device_id** - device ID connected to this interval, zero device ID is possible and can be interpreted in your application as unassignment;\n* **meta** - any custom data connected to this interval, maximum 8KB of JSON size allowed;\n\nOnce new asset interval is registered the system automatically in real-time recalculates current intervals and issue interval create, update or delete events to maintain uninterrupted and actual timeline of interval assignments.\nSuch events are published into asset logs and additionally you may track them via MQTT in the corresponding real-time only topics:\n  * **flespi/interval/gw/assets/{asset_id}/created** - asset interval was created;\n  * **flespi/interval/gw/assets/{asset_id}/updated** - asset interval was updated;\n  * **flespi/interval/gw/assets/{asset_id}/deleted** - asset interval was deleted;\n\nLast interval registered into the asset is automatically published into retain topic **flespi/state/gw/assets/{asset_id}/last**. You can subscribe to this topic to stay current with the latest device to asset assignment.\n\nInterval that is registered into the asset and is active according to current time is automatically published into retain topic **flespi/state/gw/assets/{asset_id}/active**. You can subscribe to this topic to stay current with the currently active device to asset assignment. When active interval is finished MQTT message with null payload is published in the topic.\n\nMessages posted in asset MQTT topics contain 'trace' user property which you may use to link actual interval modification event with REST API call that was responsible for it.\n\nThere is no possibility to delete interval assignment once it is registered but it is possible to replace it with a new interval with zero device_id which your application can correspondingly interpret. When retrieving intervals you may even skip such intervals by using `device_id != 0` filter.\n\n###### Asset logs\n\nTable with the list of existing log event codes (event_code property in log record) for asset:\n\n  Event code | Description\n  -----|------\n  1|asset was created via REST API\n  2|asset was updated via REST API\n  3|asset was deleted via REST API\n  4|asset was removed from account(moved to account)\n  5|asset was restored from recycle bin via REST API\n  20|asset was blocked, see [customer](/docs/#/platform/customer) for more information\n  21|asset was unblocked, see [customer](/docs/#/platform/customer) for more information\n  1600|asset was added to calculator\n  1601|asset was removed from calculator\n  1602|asset was added to group\n  1603|asset was removed from group\n  1604|posted asset interval registration\n  1605|asset interval was created\n  1606|asset interval was updated\n  1607|asset interval was deleted\n","name":"assets"},{"description":"API to manage modems.\n\n[Modem](https://flespi.com/kb/modem-instance-to-send-sms) can be used to send commands as SMS messages to devices.\n\nDepending on the modem type some modems require ICCID to be specified in device configuration in phone_number field and some require phone number in international format (starts with '+').\n\nIf you have multiple modems created in your account SMS delivery will be performed through modem with the highest priority first. If it fail, than modem with lower priority will be attempted for the delivery and so on.\n\nA special modem with the configuration.type = \"flespi\" is provided by default but allows sending a limited quantity of SMS messages (10 SMSes in Free plan).\nYou can create only one modem of such type and you can delete and create it anytime without any additional configuration.\n\nCheck the details about the number of SMS messages available in the Free and Commerical plans on the [platform pricing](https://flespi.com/pricing) page.\n\nAll actions with modems are reported to the common [logs subsystem](https://flespi.io/docs/#/platform/logs) with the following possible event codes:\n\n  Event code | Description\n  -----|------\n  200|SMS (delivery receipt) was received via modem\n  201|SMS was sent via modem\n  202|modem has successfully connected to SMS gateway\n  203|modem has lost connection to SMS gateway\n  204|failed to connect to SMS gateway\n  205|failed to send SMS via modem\n\nIf SMS was received via modem (event_code=200), you can expect the following additional parameters in the log record:\n\n  Field name | Meaning\n  ----------------------|--------\n  address    | SMS source address that sent this message\n  timestamp  | timestamp\n  type       | hex or text\n  text       | textual SMS content (for text messages only)\n  hex        | hex representation of binary SMS content (for binary messages only)\n\nIf SMS was sent via modem (event_code=201), you can expect the following additional parameters in the log record:\n\n  Field name | Meaning\n  ----------------------|--------\n  address      | SMS destination address that should receive this message\n  type         | hex or text\n  text         | textual SMS content (for text messages only)\n  hex          | hex representation of binary SMS content (for binary messages only)\n  send_code    | resulting code for send operation, zero if no errors\n  sender_cid   | subaccount ID from which send request originated (typically it is ID of subaccount where the device to which SMS was sent is located in)\n\nIf failed to connect to SMS gateway (event_code=204), you can expect the following additional parameters in the log record:\n\n  Field name | Meaning\n  ----------------------|--------\n  error_text   | error description\n\nIf failed to send SMS via modem (event_code=205), you can expect the following additional parameters in the log record:\n\n  Field name | Meaning\n  ----------------------|--------\n  address      | SMS destination address that should receive this message\n  type         | hex or text\n  text         | textual SMS content (for text messages only)\n  hex          | hex representation of binary SMS content (for binary messages only)\n  send_code    | resulting code for send operation\n  sender_cid   | subaccount ID from which send request originated (typically it is ID of subaccount where the device to which SMS was sent is located in)\n  error_text   | error description\n\nYou can expect the following additional values for send_code parameter:\n\n  Send code | Description\n  -----|------\n  -5|Address type is not supported by the current modem\n  -4|Internal error\n  -3|No modem available\n  -2|Error from SMS gateway, see special 'error_text' field for error description\n  -1|No more SMS available for current period\n  0|SMS accepted for delivery by SMS gateway\n","name":"modems"},{"description":"[Channel](https://flespi.com/kb/channel-entry-point-to-gateway) is a protocol-specific entry point for tracking devices to the [flespi telematics hub](https://flespi.com).\n\nConfigured channel starts to listen to new TCP/UDP connections from tracking devices on a **dedicated domain name:port**.\nIn some cases, channel provides a secondary URI to connect auxiliary devices such as tachographs and cameras.\n\nOne channel parses messages from devices communicating over one protocol selected during channel creation.\n\nChannel provides only data ingestion functionality.\nIn most cases you need to register [virtual device](https://flespi.com/kb/device-virtual-instance-of-real-tracker) with device type that corresponds to channel protocol.\nWith registered virtual device you have [remote control](https://flespi.com/kb/commands-and-settings) capabilities, long term telematics data storage, rich [reporting engine](https://flespi.com/kb/analytics-flespi-reports-engine), can perfom [data correction](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices) and much more.\n\nAlso the actual parameters in parsed messages can be different across [device types](https://flespi.com/devices) which is also defined by the registered virtual device.\n\nAll channel modification operations are reported to common [logs subsystem](https://flespi.io/docs/#/platform/logs) with the following possible event codes:\n\n  Event code | Description\n  -----|------\n  1|channel was created via REST API\n  2|channel was updated via REST API\n  3|channel was deleted via REST API\n  20|channel was blocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information\n  21|channel was unblocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information\n  100|channel accepted connection\n  101|channel connection was identified\n  102|channel connection was closed\n  103|channel data processing error\n  104|channel data processing warning\n  114|channel configuration is invalid\n  115|the command has been sent into the transport connection\n\nIf you do not see anything in channel logs it means that device never attempted to establish connection to the channel and there is nothing to debug on flespi, you should check device configuration first.\n\nWhenever you need to troubleshoot device operation you can investigate raw traffic between flespi channel and hardware device.\nYou can fetch traffic packets via API or just use flespi.io panel for this. On 'Logs & Messages' tab there is TRAFFIC button and also from each log record or message you can navigate to associated raw traffic exchange via context menu command.\nFor traffic from unidentified connections or connectionless protocols please check the traffic under 'unidentified' ident value.\n\n###### Channel messages\n\nParsed data from tracking devices is stored in the message buffer associated with the given channel. Message fields depend on the channel [protocol](https://flespi.com/protocols) and type of [registered device](https://flespi.com/kb/device-virtual-instance-of-real-tracker).\n\n[Messages](https://flespi.com/kb/messages-basic-information-units) can be pulled out from the buffer via a **channels/messages** request in a **single reader** mode, meaning that stable reading process can be performed by only one worker.\n\nIt is also possible to receive channel messages in realtime using MQTT API by subscribing to 'flespi/message/gw/channels/#' topic.\n\nTo stay current with channel protocol updates, subscribe to 'flespi/message/gw/channel-protocols/{protocol-id}/changelog' MQTT topic delivering any changes published in the channel protocol [changelog](https://forum.flespi.com/t/changelog).\n\nAnd [streams](https://flespi.com/kb/stream-forward-data-from-gateway) can be used to push messages to your application in variety of protocols.\n\nEvery message in the buffer is represented by a JSON object with the following fields:\n\n  Field | Description\n  --------|----------\n    timestamp | Actual message time provided by tracking device\n    ident | Tracking device identification string** * **\n    [param name] | Any additional parameters passed by tracking device\n\n** * ** *Unique tracking device identifier. It can be IMEI, international phone number or device serial number. Symbols '#','+','/',':' are not allowed. The way flespi gateway identifies a certain device is defined by the protocol.*\n\n###### Channel connections\n\nInformation on every active TCP connection from a tracking device to the specified channel:\n* connection opening time\n* listening channel ID\n* connected device IP address and identification string\n\nConnections opening, closing, and identification operations report to the common [logs subsystem](https://flespi.io/docs/#/platform/logs) with the following possible event codes:\n\n  Event code | Description\n  -----|------\n  100|channel has accepted connection\n  101|channel connection was identified\n  102|channel connection was closed, see below values of \"close_code\" parameter\n\nIf connection is accepted or identified (event_code=100 or event_code=101), you may expect the following additional parameters in the log record:\n\n  Field name | Meaning\n  ----------------------|--------\n  source          |connected device's address\n  transport       |connected device's transport: tcp, udp, http etc.\n  ident           |connected device's identification string (optional, last value only)\n\nIf connection is closed (event_code=102), you may expect the following additional parameters in the log record:\n\n  Field name | Meaning\n  ----------------------|--------\n  close_code      |the reason of connection close operation\n  error_text      |optional, additional error information\n  source          |connected device's address\n  transport       |connected device's transport: tcp, udp, http etc.\n  ident           |connected device's identification string (optional, last value only)\n  duration        |connection duration in seconds\n  msgs            |quantity of messages received\n  recv            |quantity of bytes received\n  send            |quantity of bytes sent\n\nPossible \"close_code\" values:\n\n  Code | Event\n  -----|------\n  2|connection closed by tracking device\n  3|connection successfully processed and closed\n  4|received data violates channel's protocol\n  5|internal error\n  6|data parsing error (see log details)\n  7|connection closed due to server restart\n  8|protocol implementation updated\n  9|channel's parameters changed\n  10|connection closed upon user's request\n  11|outgoing connection failed\n  12|Current connection closed because of ident collision: device has opened another connection to the channel without closing the first one. It may happen because of device firmware bug or by an unstable connectivity provider. In general, this happens to plenty of devices and usually can be ignored.\n  13|device is blocked\n  14|authentication failed\n  15|device associated with the connection was created, changed or deleted\n  16|channel rejected connection due to IP addresses match blacklist or mismatch whitelist\n  17|connection is closed by inactivity timeout\n  18|unsupported protocol part\n  19|protocol mismatch\n  20|processing was cancelled\n  21|channel is blocked\n  22|device media is blocked\n  23|device is disabled\n\nHere is an example of a log record reporting that **TCP** connection from **127.0.0.1** to **channel 1374** was successfully processed and closed after **11 seconds** and identified by device with ident **123456789**, **32** bytes received and **64** bytes transmitted, **10** messages total:\n\n```json\n{\n  \"close_code\": 3,\n  \"duration\": 11,\n  \"event_code\": 102,\n  \"event_origin\": \"gw/channels/1374\",\n  \"event_text\": \"connections/127.0.0.1/closed\",\n  \"ident\": \"123456789\",\n  \"msgs\": 10,\n  \"recv\": 32,\n  \"send\": 64,\n  \"source\": \"127.0.0.1\",\n  \"timestamp\": 1490347944.893743,\n  \"transport\": \"tcp\"\n}\n```\n\n###### Channel blocking\n\nWhen channel usage exceeds account limits the platform puts the [block reason](https://flespi.io/docs/#/platform/customer) code into the channel 'blocked' field.\n\nCodes 1, 2 and 3 pause the channel: it stops accepting new connections while established ones keep operating on TCP, MQTT and FTP transports.\nOn traffic and messages overflow the most consuming devices are blocked before the channel itself.\nOther codes stop the channel and close all its connections.\n","name":"channels"},{"description":"[Registered device](https://flespi.com/kb/device-virtual-instance-of-real-tracker) represents an IoT or telematics tracking equipment capable of sending messages to the [channel](https://flespi.com/kb/channel-entry-point-to-gateway).\n\nEach registered device has a dedicated storage for accumulated messages and media files.\nYou can [control](https://flespi.com/kb/how-to-manage-device-storage) the size and duration of this storage with 'messages_ttl', 'messages_rotate', 'media_ttl', 'media_rotate' fields in device properties.\n\nExtra functionality for devices is available by activating special [plugins](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices) for each device.\nPlugins are usually used to modify device message parameters during the registration - enrich them with your own parameters, remove some parameters, inject parameters from third party services like geocoders or even reject and cancel further message registration into device by some condition.\n\n###### Device messages and telemetry\n\nTo access device messages storage via REST API you use [GET /gw/devices/{dev-selector}/messages](https://flespi.io/docs/#/gw/devices/get_devices_dev_selector_messages) call with filtering parameters specified to retrieve only those messages that you need.\nThe messages in device messages storage are sorted by the 'timestamp' parameter sent by hardware device (usually this is the value of RTC clock for the moment when telemetry was gathered).\n'server.timestamp' parameter in messages indicates the time the message was received by flespi channel.\nSometimes device can send messages with 'timestamp' beyond storage duration configured by 'messages_ttl' and you may never see such messages in device storage.\nIn such cases you may look into channel's messages buffer where messages are sorted by the reception time (server.timestamp parameter) with **GET /gw/channels/{ch-selector}** API call.\n\nIt is possible to receive device messages in realtime using [MQTT](https://flespi.com/kb/how-to-consume-telematics-hub-messages-via-mqtt) by subscribing to 'flespi/message/gw/devices/{device_id}' topic.\n\nTo run reports over device messages or to extract pre-processed data from them in your format and based on your algorithms you can use [flespi reports engine](https://flespi.com/kb/analytics-reports-and-events-engine).\n\n[Device telemetry](https://flespi.com/kb/add-missing-parameters-from-telemetry) is a special cache of last know values of parameters sent by device within its messages.\nIf you do not need full message in JSON acessing device telemetry is more lightweight method.\nYou can access it via REST API with [GET /gw/devices/{dev-selector}/telemetry/{telemetry-selector}](https://flespi.io/docs/#/gw/devices/get_devices_dev_selector_telemetry_telemetry_selector) or subscribe to real-time parameters updates via MQTT with **flespi/state/gw/devices/{device_id}/telemetry/+** topic with retain data.\n\n###### Device configuration & connectivity\n\nWhen configuring the device the most important attributes are device type and configuration which should uniquely identify the device in your flespi account.\n\n**Device type** corresponds to the device model. You must have at least one channel your account to be able to receive data from the device\nthat works over the same protocol as the given device type. If you have several channels working over the same protocol, you can connect the device to any of them.\n\nThere is no specific hard link between device and channel and you move devices between your channels just by reconfiguring them to another channel's uri.\nflespi will automatically recognize and parse device data connected to any channel in your account.\n\nTo start receiving data from that device in flespi it is enough to create channel of the same protocol that selected device type operates.\n\nDevice type defines the schema of the device configuration. Device configuration is a JSON object with fields.\nEach configuration field relates to a specific device feature.\nThe device configuration cannot be set when device type is not set.\nDevice type may define some of the fields listed below.\n\nField        | Type   | Description\n-------------|--------|------------\nident        | string | Unique device identifier, e.g. IMEI, serial number, etc. Used to identify incoming channel messages and store it into device's storage\nphone        | string | Device phone number or SIM card ICCID serial number used to receive SMS messages or send commands over SMS\npassword     | string | Device password used to authenticate incoming connections to the channel\nsms_login    | string | Device login used to authenticate SMS commands sent to the device\nsms_password | string | Device password used to authenticate SMS commands sent to the device\n\nThe mentioned configuration fields may have additional format/pattern restrictions in each device type, but their names and types will always be the same for all device types.\n\nSome device types may define their own configuration fields.\n\nAbsence of a field in the device type configuration means absence of a specific feature in the device.\nFor example, absence of the \"sms_password\" field means that device does not use password to authenticate SMS commands sending through the platform.\n\nThe \"ident\" configuration field is used to identify device connected to the channel. Usually in vehicle telematics it is either IMEI, serial number or special custom number value configured by user.\nFrom the moment device is connected to the appropriate channel and identified by ident, all its messages received by the channel will be automatically delivered to the device storage and available via REST API as messages.\n\nThe **ident** and **protocol_id** pair of fields is used to uniquely identify the connected device within user account, so you can't create several devices with the same ident and protocol ID values.\nHowever this restriction applies only within a group of related flespi accounts (starting from account with owner_id=0 and below).\nThere are no restrictions to use devices with same idents if theyr are located in different flespi accounts.\n\nThe **password** configuration field is used when device connected to the channel and sent **both** ident and password. One of the folowing scenarios is possible:\n* If there is no flespi device with compatible device type and ident, the channel will accept incoming connection and start receiving messages from the connected device but they will be stored only in the channel buffer.\n* If the appropriate flespi device is found by ident but no password configuration field is set or it differs from the value sent by the connected device, the incoming connection will be rejected and a corresponding record will be saved in the device log.\n* If the appropriate flespi device is found by ident and its password configuration field matches the password received from the connected device, the channel will accept incoming connection and start receiving messages into the channel buffer and to the device storage.\n\nThe **phone** configuration field can be used to configure device via SMS. Each flespi user has a certain number of free SMS that can be used for device configuration. See [modems](https://flespi.com/kb/modem-instance-to-send-sms) for more information.\nThe phone configuration field should be unique among all devices.\n\nThe **sms_password** configuration field is used to authenticate SMS commands sent to hardware.\n\n###### Device troubleshooting\n\nIf **blocked** attribute is not zero, the device messages buffer is full and blocked for new messages.\nUsually this is because used space for device messages exceeded the [account limitations](https://flespi.com/kb/how-to-control-account-limitations).\nTo unblock the device messages buffer, set lower 'messages_ttl' attribute for auto-cleanup by time or 'messages_rotate' atribute for auto-cleanup by size.\n\nDevice can be manually disabled. Established connections from the disabled device will be closed, and new connections will be rejected.\nDisabled devices do not limit access to their storage.\n\nIf the channel protocol has a \"shared_connection\" feature, disabled devices will be skipped when the channel authenticates and registers the message for those devices. In other words, messages will be registered to the channel buffer only, skipping disabled devices.\n\nBlocked device status prevents new message registration into that device. If messages are registered through a channel whose protocol has a \"shared_connection\" feature, it aborts the bulk message registration pipeline, possibly preventing message registration to other devices in the received batch. To allow the channel to work in this case, devices have to be unblocked or disabled. In the second case, the channel, whose protocol has a \"shared_connection\" feature, will skip new message registration to the disabled device, even if that device is blocked.\n\nWhenever you need to troubleshoot device operation you can investigate raw traffic between flespi channel and hardware device.\nYou can fetch traffic packets via API or just use flespi.io panel for this. On 'Logs & Messages' tab there is TRAFFIC button and also from each log record or message you can navigate to associated raw traffic exchange via context menu command.\n\nWhen new traffic is received from the connected device by the channel, the platform will put the current timestamp into the **last_active** field in the device.\n**connected** field is valid only for connection-oriented protocols such as TCP. For UDP, HTTP and many other type of protocol transports you'd better rely on **last_active** field to understand if device is alive.\n\n###### Device settings\n\nDevice [settings](https://flespi.com/kb/commands-and-settings) are defined by the device type.\n\nThe device settings in the flespi platform display the last \"cached\" value for various parameters defining the behavior of the device.\nflespi offers a [Setbox](https://flespi.com/tools/setbox) tool as an interface to see and change device configuration remotely.\n\nEach setting can be read or sent to the device. The flespi platform will try to read the current value of all settings missing it, and to send pending settings values to the device if such pending values are set.\nThere are REST API methods to clear the current setting value (DELETE), to set the pending setting value (PUT), to delete the pending setting value and abort new value sending (DELETE with pending=true) to the device.\n\nEach setting contains the **status** parameter indicating the source of the current setting value (if available) and the flespi platform intention to read the new current value or apply the pending setting value.\nThe status parameter contains a bitmask with two fields.\n\n4 lower bits of the **status** parameter indicate the source of the current setting value. Possible values:\n\n  Value | Title      | Description\n  ------|------------|------------\n  0x01  | read       | The current setting value was read from device\n  0x02  | unreadable | The setting marked as unreadable if it fails to receive current setting value from the device after some attempts\n  0x03  | applied    | The pending setting value was sent to the device and became a new current value\n\nAfter marking the setting as unreadable the flespi platform will stop trying to read its current value.\nThe unreadable status can be cleared using the DELETE request. After such a request the setting will change to \"reading\" status (see below).\n\n4 higher bits of the **status** parameter indicate the flespi platform intention to read or apply the new setting value. Possible values (mutually exclusive):\n\n  Value | Title    | Description\n  ------|----------|------------\n  0x10  | reading  | The flespi platform will try to read the current setting value from the device when the connection from it is available\n  0x20  | applying | The flespi platform will try to apply the pending setting value to the device when the connection from it is available\n\nEach setting contains the **mode** parameter that is a bitmask of available actions.\nBit 1 says that the setting value may be requested (get, read) from the device, bit 2 says that the setting value can be sent (set, applied) to the device.\n\nEach setting contains the **commands** parameter which acts as a mapping for the setting actions (get or set) to the device-level command names.\n\n###### Device logs\n\nAll device modification operations are recorded to the common [logs subsystem](https://flespi.io/docs/#/platform/logs) with the following possible event codes:\n\n  Event code | Description\n  -----|------\n  1|device was created via REST API\n  2|device was updated via REST API\n  3|device was deleted via REST API\n  4|device was removed from account (moved to account)\n  5|device was restored from recycle bin via REST API\n  20|device was blocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information\n  21|device was unblocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information\n  22|device media storage was blocked\n  23|device media storage was unblocked\n  24|device media file was uploaded\n  25|device media file was updated\n  26|device media file was deleted\n  27|device media file expired by ttl or was rotated by size\n  28|device media file was accessed via external link, the corresponding logs are published in the [Platform logs](https://flespi.io/docs/#/platform/logs)\n  300|device connected\n  301|device disconnected\n  302|received SMS from device\n  303|sent SMS to device\n  304|device data processing error\n  305|device data processing warning\n  306|device secondary connection opened\n  307|device secondary connection closed\n  308|mediastream from device started\n  309|mediastream uploading stopped\n  340|tacho communication\n  310|received a new setting value from the device\n  311|REST API (PUT) request: the system accepted the new setting value\n  312|device confirmed the acceptance of the new setting value\n  313|device rejected the new setting value\n  314|REST API (DELETE) request: sending of the new setting value was canceled by the user\n  315|REST API (DELETE) request: current setting value was cleared from the system by the user\n  316|the system marked the setting as unreadable due to exceeded retries limit\n  317|the command to request or change the setting has been sent\n  318|the command to request or change the setting has been expired\n  320|plugin was activated, see [plugins](https://flespi.io/docs/#/gw/plugins) for more information\n  321|plugin was updated, see [plugins](https://flespi.io/docs/#/gw/plugins) for more information\n  322|plugin was deactivated, see [plugins](https://flespi.io/docs/#/gw/plugins) for more information\n  323|plugin processing error\n  328|geofence was linked to the device\n  329|geofence was unlinked from the device\n  330|device command added to the queue\n  331|device command removed from the queue\n  332|device command processed\n  333|device command expired\n  334|device command sent\n  340|tacho communication event (authentication, file upload, etc)\n  801|device was added to group\n  802|device was removed from group\n\nFor event_code=20, the log record contains the block_code, which is the reason of device blocking. When blocked due to exceeded storage size (block_code=4), which is the size of message buffer, the device stops receiving new messages. It will be automatically unblocked when the size of the buffer goes below the specified limits.\n\nFor device connection event (event_code=300), you may expect the following additional parameters in the log record, same as [channels connection](https://flespi.io/docs/#/gw/channels):\n\n  Field name | Meaning\n  ----------------------|--------\n  source          |connected device address\n  transport       |connected device transport: tcp, udp, http etc.\n  ident           |connected device identification string (once per connection only)\n\nIf device is disconnected (event_code=301), you may expect the following additional parameters in the log record, almost same as [channels connection](https://flespi.io/docs/#/gw/channels):\n\n  Field name | Meaning\n  ----------------------|--------\n  close_code      |code, specifying the reason of connection close operation\n  error_text      |optional, specifies additional error textual information\n  source          |connected device address\n  transport       |connected device transport: tcp, udp, http etc.\n  ident           |connected device identification string (optional, last value only)\n  duration        |connection duration in seconds\n  msgs            |quantity of messages received\n  recv            |quantity of bytes received\n  send            |quantity of bytes sent\n\nPossible \"close_code\" values:\n\n  Code | Event\n  -----|------\n  2|connection closed by tracking device\n  3|connection successfully processed and closed\n  4|received data violates channel's protocol\n  5|internal error\n  6|data parsing error (see log details)\n  7|connection closed due to server restart\n  8|protocol implementation updated\n  9|channel parameters changed\n  10|connection closed upon user's request\n  11|failed to establish connection\n  12|Current connection closed because of ident collision: device has opened another connection to the channel without closing the first one. It may happen because of device firmware bug or due to an unstable connectivity provider. In general, this happens to plenty of devices and usually can be ignored.\n  13|device is blocked\n  14|authentication failed\n  15|device associated with the connection was created, changed or deleted\n  16|channel rejected connection due to IP addresses match blacklist or mismatch whitelist\n  17|connection is closed by inactivity timeout\n  18|unsupported protocol part\n  19|protocol mismatch\n  20|processing was cancelled\n  21|channel is blocked\n  22|device media is blocked\n  23|device is disabled\n\nFor event_code=1,2,3 that are recorded when you create, update or delete the device using REST API each record contains the following standard fields:\n\n Field name | Description\n  --------|----------\n    http_data | original request parameters supplied by the caller; applicable for POST, PUT and PATCH operations\n    new | item's data with default fields after operation; applicable for POST, PUT and PATCH operations\n    old | item's data with default fields prior to operation; applicable for DELETE, PUT and PATCH operations\n    token_id | token ID used to authorize the HTTP request\n    host | IP address from which HTTP request was received\n\n For event_code=314 that is recorded when the device setting was modified either by reading the new value from the device or by user request, each record contains the following additional fields:\n\n Field name | Description\n  --------|----------\n    device_id | ID of device\n    name | name of setting that is being modified\n    current | object with the current setting value, according to the setting data schema\n\n For event_code=315 that is recorded when the device setting failed for any reason, each record contains the following additional fields:\n\n Field name | Description\n  --------|----------\n    device_id | ID of device\n    name | name of setting that is rejected\n    properties | setting value rejected by device\n    error_text | optional, additional error information\n\n For event_code=316 that occurs when the system stops requesting the current setting value from the device due to exceeded retries limit and marked the setting as unreadable, each record contains the following additional fields:\n\n Field name | Description\n  --------|----------\n    device_id | ID of device\n    name | name of setting that is marked as unreadable\n\nFor event_code=340 (tacho communication) there will be additional property \"tacho_code\" with values from the following table:\n\n  Code | Event\n  -----|------\n  1|Authentication started\n  2|Authentication finished\n  3|Authentication error\n  4|File uploading started\n  5|File uploading completed\n  6|The tachograph has confirmed the request. The data is being prepared for upload to the server. This may take up to 10 minutes.\n  7|The tracker already has an authentication task, but has not started yet\n  8|Tachograph specific error\n  9|Tachograph specific status\n  10|Uploading file info\n\nIf SMS was sent or received from device (event_code=302 or event_code=303), you may expect the following additional parameters in the log record:\n\n  Field name | Meaning\n  ----------------------|--------\n  address    | SMS phone number\n  type       | hex or text\n  text       | textual SMS contents (for text messages only)\n  hex        | hex representation of binary SMS contents (for binary messages only)\n","name":"devices"},{"description":"Full [list of available channel protocols](https://flespi.com/protocols) you can find by the link.\n\nA [channel](https://flespi.com/kb/channel-entry-point-to-gateway) protocol defines the way a channel transforms the incoming raw data stream from the telematics devices and converts it into normalized messages in JSON format.\n\nEach protocol defines a list of integrated [device types](https://flespi.com/devices) with the [schemas of commands and settings](https://flespi.com/kb/commands-and-settings) available for each of them.\n\nEach device type defines a schema of the device configuration (see more in the [devices](https://flespi.io/docs/#/gw/!/devices) section of REST API).\n\nA [stream](https://flespi.com/kb/stream-forward-data-from-gateway) protocol defines the format flespi uses to forward telematics device data into 3rd party systems.\n\nA [plugin](https://flespi.com/kb/plugins-functionality-extensions-for-flespi-devices) types is used to transform the message from telematics device - add some field, remove them, restore from telemetry and even cancel message registration or copy it into another device.\n\nIntegration of new channel, stream protocols and plugin types is available [upon request](https://flespi.com/kb/hardware-integration).\n\nTo stay current with protocol updates, subscribe to 'flespi/message/gw/channel-protocols/{protocol-id}/changelog' (same for 'stream-protocols' and 'plugin-types') MQTT topic delivering any changes published in the protocol [changelog](https://forum.flespi.com/t/changelog).\n\nThe accumulated history of such posts is available with the 'GET /gw/channel-protocols/{selector}/changelog-posts' request (same for 'stream-protocols' and 'plugin-types'). 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 protocol or plugin type it belongs to.\n\n###### Protocol transports\n\nThe 'transport' field is a bitmask of the transports the protocol's channels support.\n\nBit  | Transport\n-----|----------\n0x1  | Listen to TCP connections\n0x2  | Handle UDP packets\n0x4  | Protocol channel operates as HTTP server\n0x8  | Protocol handles SMS messages\n0x10 | Protocol channel operates as MQTT transport\n0x20 | Another tg channel as input\n0x40 | Custom\n0x80 | Protocol operates as FTP server/client\n\n###### Protocol and device type features\n\nA protocol advertises its capabilities through the 'features' object, requestable via the 'fields' parameter. Device types inherit their protocol's flags and may add their own.\n\nFlag              | Meaning\n------------------|--------\nraw_packets       | Channel with this protocol can store raw traffic packets\nshared_connection | A single connection to the channel can be shared between multiple device idents\ntls               | Protocol supports a TLS-secured transport\nmedia_data        | Protocol can process media payloads (photos, video files)\nmedia_commands    | Protocol supports media commands (request_video, take_photo, etc.)\ntacho_commands    | Protocol supports tachograph commands (request_tachograph_file)\nassistance        | Device type only - indexed documentation is available for AI assistance\n","name":"protocols"},{"description":"Changelog posts of the flespi telematics hub system and related applications.\n\nTo stay current with telematics hub updates, subscribe to 'flespi/message/gw/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 /gw/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-----|-----------|----------------\ntelematics-hub | [flespi telematics hub](https://forum.flespi.com/d/25-changelog-flespi-telematics-hub) | Telematics hub features and REST API updates\nanalytics | [flespi analytics](https://forum.flespi.com/d/16-changelog-flespi-analytics) | flespi analytics engine updates\ntachograph | [Tachograph functionality](https://forum.flespi.com/d/1999-changelog-tachograph-functionality) | Tachograph functionality updates\ntoolbox | [Toolbox](https://forum.flespi.com/d/11-changelog-toolbox) | Toolbox app release notes\ntrackit | [TrackIt](https://forum.flespi.com/d/239-changelog-trackit) | TrackIt app release notes\nmapview | [MapView](https://forum.flespi.com/d/10-changelog-mapview) | MapView release notes\nsetbox | [SetBox](https://forum.flespi.com/d/5-changelog-setbox) | SetBox release notes\ntacho-bridge-app | [Tacho Bridge App](https://forum.flespi.com/d/1836-changelog-tacho-bridge-app) | Tacho Bridge App release notes\n","name":"changelog"}]}