# flespi Modems API

**Canonical:** https://apis.io/apis/flespi/flespi-modems-api/  
**Provider:** flespi — https://apis.io/providers/flespi/  
**Base URL:** https://flespi.io/gw  
**Documentation:** https://flespi.io/docs/#/gw

flespi Modems API is one of 11 APIs that [flespi](https://apis.io/providers/flespi/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. Tagged areas include Modems. The published artifact set on APIs.io includes an OpenAPI specification.

API to manage modems. [Modem](https://flespi.com/kb/modem-instance-to-send-sms) can be used to send commands as SMS messages to devices. Depending 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 '+'). If 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. A 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). You can create only one modem of such type and you can delete and create it anytime without any additional configuration. Check the details about the number of SMS messages available in the Free and Commerical plans on the [platform pricing](https://flespi.com/pricing) page. All actions with modems are reported to the common [logs subsystem](https://flespi.io/docs/#/platform/logs) with the following possible event codes: Event code | Description -----|------ 200|SMS (delivery receipt) was received via modem 201|SMS was sent via modem 202|modem has successfully connected to SMS gateway 203|modem has lost connection to SMS gateway 204|failed to connect to SMS gateway 205|failed to send SMS via modem If SMS was received via modem (event_code=200), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- address | SMS source address that sent this message timestamp | timestamp type | hex or text text | textual SMS content (for text messages only) hex | hex representation of binary SMS content (for binary messages only) If SMS was sent via modem (event_code=201), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- address | SMS destination address that should receive this message type | hex or text text | textual SMS content (for text messages only) hex | hex representation of binary SMS content (for binary messages only) send_code | resulting code for send operation, zero if no errors 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) If failed to connect to SMS gateway (event_code=204), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- error_text | error description If failed to send SMS via modem (event_code=205), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- address | SMS destination address that should receive this message type | hex or text text | textual SMS content (for text messages only) hex | hex representation of binary SMS content (for binary messages only) send_code | resulting code for send operation 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) error_text | error description You can expect the following additional values for send_code parameter: Send code | Description -----|------ -5|Address type is not supported by the current modem -4|Internal error -3|No modem available -2|Error from SMS gateway, see special 'error_text' field for error description -1|No more SMS available for current period 0|SMS accepted for delivery by SMS gateway

## Operations (8)

| Method | Path | Summary |
|---|---|---|
| POST | `/modems` | Create modem |
| DELETE | `/modems/{modem-selector}` | Delete modem |
| GET | `/modems/{modem-selector}` | Retrieve modems |
| PATCH | `/modems/{modem-selector}` | Patch item properties |
| PUT | `/modems/{modem-selector}` | Update modem configuration |
| GET | `/modems/{modem-selector}/logs` | Retrieve modem logs |
| GET | `/modems/{modem-selector}/logs/calculate` | Calculate intervals from modem logs |
| POST | `/modems/{modem-selector}/logs/calculate` | Calculate intervals from modem logs |

## Machine-readable artifacts (1)

- **OpenAPI** — https://artifacts.apis.io/flespi/openapi/flespi-modems-api-openapi.yml

## Other flespi APIs (10)

- [flespi Assets API](https://apis.io/apis/flespi/flespi-assets-api/)
- [flespi Calculators API](https://apis.io/apis/flespi/flespi-calculators-api/)
- [flespi Changelog API](https://apis.io/apis/flespi/flespi-changelog-api/)
- [flespi Channels API](https://apis.io/apis/flespi/flespi-channels-api/)
- [flespi Devices API](https://apis.io/apis/flespi/flespi-devices-api/)
- [flespi Geofences API](https://apis.io/apis/flespi/flespi-geofences-api/)
- [flespi Groups API](https://apis.io/apis/flespi/flespi-groups-api/)
- [flespi Plugins API](https://apis.io/apis/flespi/flespi-plugins-api/)
- [flespi Protocols API](https://apis.io/apis/flespi/flespi-protocols-api/)
- [flespi Streams API](https://apis.io/apis/flespi/flespi-streams-api/)

## Tags

Modems

## Use this from code or an agent

- **REST, no key:** `GET https://apis.io/api/v1/providers/flespi` returns the provider's full profile as JSON.
- **MCP:** `https://apis.io/mcp` (Streamable HTTP) — search the catalog, read any provider, compare providers, check agent readiness.
- **Free API key** for catalog-wide search, ratings and comparisons: sign in with GitHub, Google or LinkedIn at https://apis.io/developer/account/ (plans: https://apis.io/developer/plans/).

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/flespi/flespi-modems-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/flespi/.
