---
updatedAt: 2026-05-28T11:25:13.000Z
agentTools:
  projectIndex: https://dev.edgeiq.io/llms.txt
---

# Get devices for a rule

Get devices for a rule

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "platform",
    "version": "1.0",
    "contact": {
      "name": "EdgeIQ",
      "url": "https://edgeiq.io"
    },
    "description": "EdgeIQ API"
  },
  "paths": {
    "/devices": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "Creates a Device",
        "description": "Creates a Device",
        "operationId": "POST_devices",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Device",
                "description": "Devices are instances of Device Types. Through the API you are able to manage and send actions to Devices.",
                "type": "object",
                "properties": {
                  "_id": {
                    "description": "A unique id for this Device.",
                    "type": "string",
                    "readOnly": true
                  },
                  "company_id": {
                    "description": "Company account id for this device. If left blank, defaults to current user's company id on creation.",
                    "type": "string"
                  },
                  "name": {
                    "description": "A descriptive name for this Device.",
                    "type": "string"
                  },
                  "unique_id": {
                    "description": "A unique identifier for the device. *Must be globally unique*. For gateway devices running our edge service, this ID will uniquely identify this gateway when it requests its configuration from the cloud. Allowed to contain only lower or uppercase letters, numbers, colons, underscores, or dashes (the characters `:`, `-`, or `_`).",
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9:-_]*$"
                  },
                  "device_type_id": {
                    "description": "The _id of the Device Type",
                    "type": "string"
                  },
                  "activated_at": {
                    "type": "boolean",
                    "description": "Indicates that the device is marked as activated in another system. Currently applies only to cloud-native devices. Exclusive of `deactivated_at`."
                  },
                  "deactivated_at": {
                    "type": "boolean",
                    "description": "Indicates that the device is marked as deactivated in another system. Currently applies only to cloud-native devices. Exclusive of `activated_at`."
                  },
                  "heartbeat_period": {
                    "description": "The interval (in seconds) that the heartbeat message will be sent.",
                    "type": "integer",
                    "default": 60
                  },
                  "heartbeat_status": {
                    "description": "The status of the device based on received heartbeat values",
                    "readOnly": true,
                    "type": "string",
                    "enum": [
                      "online",
                      "offline",
                      "idle",
                      "never_reported"
                    ]
                  },
                  "heartbeat_values": {
                    "description": "An array of strings indicating what values should be included in the heartbeat message.",
                    "nullable": true,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "cell_signal",
                        "cell_usage",
                        "sim_card",
                        "connections",
                        "wifi_clients",
                        "cpu_usage",
                        "ram_usage",
                        "disk_size",
                        "disk_free",
                        "disk_usage",
                        "custom"
                      ]
                    }
                  },
                  "authentication_method": {
                    "description": "Method used for authenticating with MQTT (e.g. password, certificate)",
                    "nullable": true,
                    "type": "string",
                    "items": {
                      "type": "string",
                      "enum": [
                        "password-auth",
                        "certificate-auth"
                      ]
                    }
                  },
                  "tags": {
                    "nullable": true,
                    "type": "array",
                    "description": "A comma separated list of strings acting as tags for the device. Can be used to group and store information about devices.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "device_certificates": {
                    "description": "An array of device certificates",
                    "nullable": true,
                    "type": "array",
                    "items": {
                      "$ref": "#/paths/~1devices~1%7BdeviceId%7D~1device_certificates~1%7BcertificateId%7D~1revoke/post/responses/200/content/application~1json/schema"
                    }
                  },
                  "ingestor_ids": {
                    "description": "IDs of associated Ingestors (deprecated, optional).",
                    "nullable": true,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "command_ids": {
                    "description": "IDs of associated Commands (deprecated, optional).",
                    "nullable": true,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "attached_device_ids": {
                    "nullable": true,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "last_location_observation_id": {
                    "nullable": true,
                    "type": "string",
                    "description": "The ID of the last device location observation received for this device. Field will be `undefined` if location observation doesn't exist."
                  },
                  "log_config": {
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "local_level": {
                        "allOf": [
                          {
                            "type": "string",
                            "enum": [
                              "trace",
                              "debug",
                              "info",
                              "warn",
                              "error",
                              "critical"
                            ]
                          },
                          {
                            "type": "string",
                            "default": "error"
                          }
                        ]
                      },
                      "forward_level": {
                        "allOf": [
                          {
                            "$ref": "#/paths/~1devices/post/requestBody/content/application~1json/schema/properties/log_config/properties/local_level/allOf/0"
                          },
                          {
                            "type": "string",
                            "default": "error"
                          }
                        ]
                      },
                      "forward_frequency_limit": {
                        "type": "integer",
                        "default": 60
                      }
                    }
                  },
                  "location": {
                    "nullable": true,
                    "type": "string",
                    "description": "A textual (non-geographic) location for keeping track of the location of a device. For example \"Warehouse\", \"Building One\"."
                  },
                  "last_known_geographic_location": {
                    "nullable": true,
                    "type": "object",
                    "description": "GeoJSON `Feature` representation of the device's last known location, with the radius of accuracy in `properties.radius`. If this device has received any device location observations, the latest device location observation's geographic coordinates will be returned here on the device as well."
                  },
                  "metadata": {
                    "nullable": true,
                    "type": "object",
                    "description": "A key/value object of user defined data"
                  },
                  "active": {
                    "deprecated": true,
                    "type": "boolean",
                    "description": "[deprecated] Indicates whether or not the Device is available. No longer used."
                  },
                  "latest_sim": {
                    "$ref": "#/paths/~1sims/post/responses/201/content/application~1json/schema",
                    "description": "The most recently updated SIM associated with this device. Only present when the request includes `with_sims=true`. Omitted if the device has no SIMs."
                  }
                },
                "required": [
                  "name",
                  "unique_id",
                  "device_type_id"
                ]
              }
            }
          },
          "description": ""
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1devices/post/requestBody/content/application~1json/schema"
                }
              }
            },
            "description": "Created device"
          },
          "401": {
            "$ref": "#/paths/~1me/get/responses/401"
          },
          "404": {
            "$ref": "#/paths/~1me/get/responses/404"
          },
          "500": {
            "$ref": "#/paths/~1me/get/responses/500"
          }
        }
      }
    },
    "/rules/{id}/devices": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get devices for a rule",
        "description": "Get devices for a rule",
        "operationId": "GET_devices_for_rule_by_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID that specifies a Rule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/paths/~1devices/post/requestBody/content/application~1json/schema"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/paths/~1me/get/responses/401"
          },
          "404": {
            "$ref": "#/paths/~1me/get/responses/404"
          },
          "500": {
            "$ref": "#/paths/~1me/get/responses/500"
          }
        }
      }
    },
    "/sims": {
      "post": {
        "tags": [
          "SIMs"
        ],
        "summary": "Create a SIM",
        "description": "Creates a new SIM record and links it to the specified device. The `device_id` and `iccid` fields are required. The SIM inherits its `company_id` from the linked device's company, so the calling user must have create permissions for that company. A given ICCID must be globally unique across the platform.",
        "operationId": "POST_sims",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "SimInput",
                "description": "Request body for creating or updating a SIM. Maps directly to the backend's `SimInput` struct. Read-only server-managed fields (ctd_data_usage, ctd_sms_usage, included_usage, overage_limit_reached, sim_barred, last_sync_at, and audit fields) are not accepted and will be ignored if present.",
                "type": "object",
                "properties": {
                  "device_id": {
                    "description": "The ID of the device this SIM is linked to. Required on creation.",
                    "type": "string"
                  },
                  "integration_id": {
                    "description": "The ID of the MNO integration used to sync this SIM with a carrier connectivity management platform (CMP).",
                    "type": "string"
                  },
                  "iccid": {
                    "description": "Integrated Circuit Card Identifier. Must be 18-22 digits (ITU-T E.118). Globally unique across the platform. Required on creation.",
                    "type": "string",
                    "minLength": 18,
                    "maxLength": 22,
                    "pattern": "^\\d{18,22}$"
                  },
                  "msisdn": {
                    "description": "Mobile Subscriber ISDN Number (the SIM's phone number). Maximum 20 characters.",
                    "type": "string",
                    "maxLength": 20
                  },
                  "sim_status": {
                    "description": "SIM lifecycle status. This is an open string set by the carrier/Service Provider (CMP) sync and is NOT restricted to a fixed enum — any carrier status string is valid. Maximum 30 characters. Common values: inactive, active, suspended, deactivated, retired. Defaults to 'inactive' when omitted on creation.",
                    "type": "string",
                    "maxLength": 30
                  },
                  "communication_plan": {
                    "description": "Carrier communication plan name. Maximum 255 characters.",
                    "type": "string",
                    "maxLength": 255
                  },
                  "rate_plan": {
                    "description": "Carrier rate plan name. Maximum 255 characters.",
                    "type": "string",
                    "maxLength": 255
                  },
                  "sim_metadata": {
                    "description": "Extensible JSON object for carrier-specific fields. Values may be nested objects or numeric types. Maximum 50 top-level keys.",
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "device_id",
                  "iccid"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "SIM created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Sim",
                  "description": "A SIM card record linked to a device. SIMs represent cellular identities managed through carrier/CMP integrations. A device may have multiple SIMs (e.g. for redundancy, swap lifecycle, or multi-radio gateways). The ICCID is the SIM's globally-unique identifier across the platform.",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "description": "The platform-assigned 24-character unique identifier for this SIM.",
                      "type": "string",
                      "readOnly": true
                    },
                    "company_id": {
                      "description": "The company account this SIM belongs to. Derived from the linked device's company on creation; cannot be changed via the API.",
                      "type": "string",
                      "readOnly": true
                    },
                    "user_id": {
                      "description": "The ID of the user who created this SIM record.",
                      "type": "string",
                      "readOnly": true
                    },
                    "origin": {
                      "description": "Indicates how this SIM record was created (e.g. 'api', 'csv_import').",
                      "type": "string",
                      "readOnly": true
                    },
                    "device_id": {
                      "description": "The ID of the device this SIM is linked to. Required on creation.",
                      "type": "string"
                    },
                    "integration_id": {
                      "description": "The ID of the MNO integration used to sync this SIM with a carrier connectivity management platform (CMP).",
                      "type": "string"
                    },
                    "iccid": {
                      "description": "Integrated Circuit Card Identifier. Must be 18-22 digits (ITU-T E.118). Globally unique across the platform. Required on creation.",
                      "type": "string",
                      "minLength": 18,
                      "maxLength": 22,
                      "pattern": "^\\d{18,22}$"
                    },
                    "msisdn": {
                      "description": "Mobile Subscriber ISDN Number (the SIM's phone number). Maximum 20 characters.",
                      "type": "string",
                      "maxLength": 20
                    },
                    "sim_status": {
                      "description": "SIM lifecycle status. This is an open string set by the carrier/Service Provider (CMP) sync and is NOT restricted to a fixed enum — carriers use a wide and evolving range of status labels. Maximum 30 characters. Common values include: inactive, active, suspended, deactivated, retired — but any string up to 30 characters is valid. Defaults to 'inactive' on creation.",
                      "type": "string",
                      "maxLength": 30
                    },
                    "communication_plan": {
                      "description": "Carrier communication plan name. Maximum 255 characters.",
                      "type": "string",
                      "maxLength": 255
                    },
                    "rate_plan": {
                      "description": "Carrier rate plan name. Maximum 255 characters.",
                      "type": "string",
                      "maxLength": 255
                    },
                    "ctd_data_usage": {
                      "description": "Cycle-to-date data usage in decimal megabytes (1 MB = 1,000,000 bytes), as reported by the CMP. Stored as a floating-point number because carrier usage figures can be fractional. The `sims_ctd_data_usage_gte` / `sims_ctd_data_usage_lte` device filters take the same unit. This is the platform-wide contract (EIQ-6264). Some tenants' SIM sync integrations still report bytes and are being migrated, so until then a value implausible as megabytes may be bytes - contact EdgeIQ support rather than reinterpret it by magnitude.",
                      "example": 650.5,
                      "type": "number",
                      "format": "double",
                      "minimum": 0,
                      "readOnly": true
                    },
                    "ctd_sms_usage": {
                      "description": "Cycle-to-date SMS message count.",
                      "type": "integer",
                      "minimum": 0,
                      "readOnly": true
                    },
                    "included_usage": {
                      "description": "Included data allowance for the current billing cycle in decimal megabytes (1 MB = 1,000,000 bytes). Floating-point to match carrier precision. The same unit caveat as `ctd_data_usage` applies.",
                      "example": 1000,
                      "type": "number",
                      "format": "double",
                      "minimum": 0,
                      "readOnly": true
                    },
                    "overage_limit_reached": {
                      "description": "Whether the SIM has reached its data overage limit.",
                      "type": "boolean",
                      "readOnly": true
                    },
                    "sim_barred": {
                      "description": "Whether the SIM has been barred by the carrier.",
                      "type": "boolean",
                      "readOnly": true
                    },
                    "last_sync_at": {
                      "description": "Timestamp of the last successful sync with the MNO/CMP integration (RFC 3339). Absent if the SIM has never been synced.",
                      "type": "string",
                      "format": "date-time",
                      "readOnly": true
                    },
                    "sim_metadata": {
                      "description": "Extensible JSON object for carrier-specific fields. Values may be nested objects or numeric types (unlike fleet metadata which is string-only). Maximum 50 top-level keys.",
                      "type": "object",
                      "additionalProperties": true
                    },
                    "created_at": {
                      "description": "Timestamp when this SIM record was created (RFC 3339).",
                      "type": "string",
                      "format": "date-time",
                      "readOnly": true
                    },
                    "updated_at": {
                      "description": "Timestamp when this SIM record was last updated (RFC 3339).",
                      "type": "string",
                      "format": "date-time",
                      "readOnly": true
                    }
                  },
                  "required": [
                    "device_id",
                    "iccid"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed or contained invalid parameters."
          },
          "401": {
            "$ref": "#/paths/~1me/get/responses/401"
          },
          "404": {
            "$ref": "#/paths/~1me/get/responses/404"
          },
          "500": {
            "$ref": "#/paths/~1me/get/responses/500"
          }
        }
      }
    },
    "/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Returns current user",
        "description": "Returns current user",
        "operationId": "GET_users_bulk",
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "title": "User",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "description": "The unique identifier of the user. Assigned at creation, uneditable.",
                      "type": "string"
                    },
                    "first_name": {
                      "description": "The first name of the user.",
                      "type": "string"
                    },
                    "last_name": {
                      "description": "The last name of the user.",
                      "type": "string"
                    },
                    "email": {
                      "description": "The email or non-email username of the user. Must be unique.",
                      "type": "string"
                    },
                    "password": {
                      "description": "Used for authentication. Must be at least 8 characters. Required on creation.",
                      "type": "string"
                    },
                    "password_confirmation": {
                      "description": "Required on creation and only on creation. Must match `password`.",
                      "type": "string"
                    },
                    "authentication_token": {
                      "description": "API access token",
                      "type": "string"
                    },
                    "phone_number": {
                      "description": "The user's phone number.",
                      "type": "string"
                    },
                    "company_id": {
                      "description": "The id of the company the user belongs to directly.",
                      "type": "string"
                    },
                    "user_type_id": {
                      "description": "ID of user's type",
                      "type": "string"
                    },
                    "company_ids": {
                      "description": "A list of company ids which are accounts of the user's company. The user is allowed to view and interact with these companies. Allows management of which sub-accounts users are able to access.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "metadata": {
                      "description": "This field is a way to store an untyped, key-value, user defined data on a user per user basis",
                      "type": "object"
                    },
                    "locale": {
                      "description": "The user's UI language, as a BCP 47 tag. Absent means no preference, which the web app shows as English. Set only through `PUT /me/locale`; `POST /users` and `PUT /users/{id}` ignore it.",
                      "type": "string",
                      "enum": [
                        "en",
                        "fr-CA",
                        "es-419"
                      ],
                      "readOnly": true
                    }
                  },
                  "required": [
                    "first_name",
                    "email",
                    "password"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized"
          },
          "404": {
            "description": "The item you were looking for does not exist"
          },
          "500": {
            "description": "An unexpected error was encountered."
          }
        }
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Devices"
    },
    {
      "name": "Rules"
    },
    {
      "name": "SIMs"
    },
    {
      "name": "Users"
    }
  ],
  "servers": [
    {
      "url": "https://api.edgeiq.io/api/v1/platform"
    }
  ],
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": ""
      }
    }
  },
  "x-explorer-enabled": true,
  "x-proxy-enabled": true,
  "x-samples-enabled": true,
  "x-samples-languages": [
    "curl",
    "node",
    "ruby",
    "javascript",
    "python"
  ],
  "x-headers": [
    {
      "key": "accept",
      "value": "application/json"
    }
  ]
}
```