flespi Streams API

[Streams](https://flespi.com/kb/stream-forward-data-from-gateway) push messages into third-party platforms via different protocols. It is possible to subscribe a stream to incoming [messages](https://flespi.com/kb/messages-basic-information-units) received by channels or devices. Streams subscribed to channels forward messages with plain set of parameters, as reported by the device. Streams 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). If the stream is subscribed to both device and channel simultaneously stream will forward only device message and ignore plain message from the channel. Each 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. If **blocked** attribute is not zero, the stream message buffer is full and blocked for new messages. Usually this is because used space for stream buffer exceeded the [account limitations](https://flespi.com/kb/how-to-control-account-limitations). To 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. List 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. Configuration within each stream instance should match the configuration schema defined for corresponding stream protocols. To 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). Whenever you need to troubleshoot stream operation you can investigate raw traffic between flespi stream and its target server. You 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. All stream modification operations are recorded to the common [logs subsystem](https://flespi.io/docs/#/platform/logs). In logs you will see corresponding log records for stream connection attempts, disconnections and also all messages deliveries in batches. ###### Stream logs Stream log records can contain following possible event codes: Event code | Description -----|------ 1|stream was created via REST API 2|stream was updated via REST API 3|stream was deleted via REST API 20|stream was blocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information 21|stream was unblocked, see [customer](https://flespi.io/docs/#/platform/customer) for more information 401|stream connected successfully 402|stream has lost connection 403|stream failed to deliver messages 405|stream successfully sent the message 406|stream skipped the message 407|stream connecting 410|new subscription was created for stream 411|stream subscription was updated 412|stream subscription was deleted 420|stream was subscribed for device messages 422|stream was unsubscribed from device messages 430|stream was subscribed for channel messages 432|stream was unsubscribed from channel messages 433|stream subscribed to group 434|stream unsubscribed from group 435|geofence was added to stream 436|geofence was removed from stream For event_code=405 which means stream successfully sent a message to remote target in the log record you can find additional important fields: * ident - ident of the device whose message was sent via the stream * message_timestamp - timestamp of the original message sent via stream * device_id - id of flespi device whose message was sent via the stream (present only if the stream was assigned to device) * ack_latency - how much time it took to process the batch from the moment stream received messages until remote server acknowledged their reciept; * data - any extra data associated with message processing by the stream, optional event_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: * reason - the reason why the message was skipped * data - any extra data associated with message processing by the stream, optional If 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. You 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. Stream will send next batch only after acknowledgement from your server. For 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: * 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). * For MQTT streams it will contain MQTT_CONNECT response code when positive or reflect TCP/SSL connection error when negative. * Wialon retranslator stream type has a single error code (1) - if it is disconnected. The possible values for the "error_code" field are: Error code | Description -----|------ -99|SSL certificate error -2|request sent but no response received -1|failed to connect 1|unacceptable protocol version 2|identifier rejected 3|server unavailable 4|bad username or password 5|connection not authorized For 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. For 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: Field name | Description --------|---------- http_data | original request parameters supplied by the caller; applicable for POST and PUT operations new | item's data with default fields after operation; applicable for POST and PUT operations old | item's data with default fields prior to operation; applicable for DELETE and PUT operations token_id | token ID used to authorize the HTTP request host | IP address from which HTTP request was received

GitHub OpenAPI

Operations 27

GET /stream-protocols/{stream-protocols.selector} Fetch available stream protocols #
GET /stream-protocols/{stream-protocols.selector}/changelog-posts Fetch changelog posts of stream protocols #
POST /streams Create new stream #
DELETE /streams/{stream.selector} Delete selected streams #
GET /streams/{stream.selector} List available streams #
PATCH /streams/{stream.selector} Patch item properties #
PUT /streams/{stream.selector} Modify stream properties #
DELETE /streams/{stream.selector}/channels/{stream.channels.selector} Unsubscribe stream from channels #
GET /streams/{stream.selector}/channels/{stream.channels.selector} List channels to which stream is subscribed #
POST /streams/{stream.selector}/channels/{stream.channels.selector} Subscribe stream to channel messages #
DELETE /streams/{stream.selector}/devices/{stream.devices.selector} Unsubscribe stream from devices #
GET /streams/{stream.selector}/devices/{stream.devices.selector} List devices to which stream is subscribed #
POST /streams/{stream.selector}/devices/{stream.devices.selector} Subscribe stream to device messages #
PUT /streams/{stream.selector}/devices/{stream.devices.selector} Modify device data for stream #
DELETE /streams/{stream.selector}/geofences/{stream.geofences.selector} Unassign geofences from stream #
GET /streams/{stream.selector}/geofences/{stream.geofences.selector} Retrieve geofences in stream #
POST /streams/{stream.selector}/geofences/{stream.geofences.selector} Assign geofences to stream #
PUT /streams/{stream.selector}/geofences/{stream.geofences.selector} Modify geofence data for stream #
DELETE /streams/{stream.selector}/groups/{stream.groups.selector} Unsubscribe stream from group #
GET /streams/{stream.selector}/groups/{stream.groups.selector} List groups to which stream is subscribed #
POST /streams/{stream.selector}/groups/{stream.groups.selector} Subscribe stream to group of devices #
GET /streams/{stream.selector}/logs Retrieve stream logs #
GET /streams/{stream.selector}/logs/calculate Calculate intervals from stream logs #
POST /streams/{stream.selector}/logs/calculate Calculate intervals from stream logs #
DELETE /streams/{stream.selector}/messages Remove all messages from the stream queue #
POST /streams/{stream.selector}/messages Post messages to stream queue #
GET /streams/{stream.selector}/packets Retrieve raw traffic generated by stream #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/flespi:flespi-streams-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

flespi-streams-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'This API (full-stack API for telematics devices) provides methods to create and manage the following instances of the flespi telematics hub that jointly provide the end-to-end communication between the GPS trackers and your target application:

    * **channels** - 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.

    * **devices** - virtual representations of the physical trackers on the flespi platform. Allow organizing messages storage by device (ident), remote device configuration, dedicated long-term storage, video telematics functionality, access to telemetry and much more.

    * **streams** - outbound data flows preformatted to forward the telematics data to specific target platforms (e.g. Google Pub/Sub, Amazon AWS IoT, Microsoft Azure IoT, and more).

    * **calculators** - sets of rules for detecting intervals and computing the associated values for them; integral prt of the flespi analytics engine.

    * **plugins** - 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.

    * **modems** - instance connecting the flespi platform with an SMS service provider for sending configurational text messages to change device settings.

    * **protocols** - access to the list of protocols, device types, available message parameters and commands.


    To identify each REST request flespi token has to be passed in the HTTP call via the header: **Authorization: FlespiToken XXXXXXXXXX**.

    The limit of URI component is 64 KiB.

    A request fails with 503 Service Unavailable when the server sends no response data for 300 seconds.


    All changes to the gateway items are recorded in the common logs subsystem.'
  title: flespi Telematics Hub REST Streams API
  version: '1.0'
servers:
- url: https://flespi.io/gw
- url: http://flespi.io/gw
tags:


# --- truncated at 32 KB (178 KB total) ---
# Full source: https://artifacts.apis.io/flespi/openapi/flespi-streams-api-openapi.yml