---
updatedAt: 2026-05-27T10:18:53.000Z
agentTools:
  projectIndex: https://gethapn.readme.io/llms.txt
---

# Get list of behaviors sent to the device, filtered by date.

Gets a list of the behaviors sent to a device over some date range.


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "description": "The Hapn API is an HTTP interface for managing devices, accounts, and cloud data.",
    "version": "1.0.0",
    "title": "Hapn API",
    "termsOfService": "https://gethapn.com/terms",
    "contact": {
      "name": "Dev",
      "email": "developer@gethapn.com",
      "url": "http://gethapn.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://api.iotgps.io/v1",
      "description": "Prod"
    },
    {
      "url": "https://api-dev.iotgps.io/v1",
      "description": "Dev"
    }
  ],
  "paths": {
    "/behaviors/{imei}/history": {
      "get": {
        "summary": "Get list of behaviors sent to the device, filtered by date.",
        "tags": [
          "Behaviors"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "015181000672494"
            },
            "in": "path",
            "name": "imei",
            "description": "IMEI of the device",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2020-02-25T18:09:00Z"
            },
            "in": "query",
            "name": "startDate",
            "description": "Exclude behaviors sent before startDate. In ISO 8601 format",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2020-02-26T18:09:00Z"
            },
            "in": "query",
            "name": "endDate",
            "description": "Exclude behaviors sent after endDate. In ISO 8601 format",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Behavior history result",
            "content": {
              "application/json": {
                "schema": {
                  "description": "",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "result": {
                          "required": [
                            "items"
                          ],
                          "properties": {
                            "items": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/SentBehavior"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "example-1": {
                    "value": {
                      "success": true,
                      "message": "ok",
                      "result": {
                        "items": [
                          {
                            "imei": "865134050130039",
                            "createDate": "2022-07-29T23:51:01.044Z",
                            "sentTime": "2022-07-29T23:51:01.044Z",
                            "confirmedDate": "2022-09-27T18:24:00.200Z",
                            "responseDate": "2022-09-27T18:24:00.200Z",
                            "transmissionType": "listener",
                            "status": "confirmed",
                            "taskId": "fc44d76f-de69-4dee-b0ef-6a59885ac5a9",
                            "tag": "PING",
                            "name": "BEHAVIOR#PING",
                            "description": "PING"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/DeviceNotFound"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get-device-sent-behaviors",
        "description": "Gets a list of the behaviors sent to a device over some date range.\n"
      }
    }
  },
  "components": {
    "schemas": {
      "SentBehavior": {
        "description": "A behavior command sent to a device",
        "type": "object",
        "title": "Sent Behavior",
        "x-examples": {
          "example-1": {
            "imei": "868239050345326",
            "createDate": "2022-09-27T15:50:02.432Z",
            "sentTime": "2022-09-27T15:51:00.200Z",
            "confirmedDate": "2022-09-27T18:24:00.200Z",
            "responseDate": "2022-09-27T18:24:00.200Z",
            "transmissionType": "listener",
            "name": "BEHAVIOR#PING",
            "tag": "PING",
            "taskId": "b875a598-cebc-4b29-ae47-f337c29e411a",
            "status": "confirmed",
            "description": "Ping",
            "parameterValues": []
          }
        },
        "properties": {
          "imei": {
            "type": "string"
          },
          "createDate": {
            "type": "string"
          },
          "sentTime": {
            "type": "string"
          },
          "confirmedDate": {
            "type": "string"
          },
          "responseDate": {
            "type": "string"
          },
          "transmissionType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "taskId": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "parameterValues": {
            "type": "array"
          }
        }
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "result": {
            "type": "object"
          }
        },
        "required": [
          "message",
          "success"
        ],
        "x-examples": {
          "example-1": {
            "value": {
              "success": true,
              "message": "ok",
              "result": {
                "imei": "12345"
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "message"
        ],
        "x-examples": {
          "example-1": {
            "value": {
              "success": false,
              "message": "Unauthorized"
            }
          }
        }
      }
    },
    "responses": {
      "DeviceNotFound": {
        "description": "The specified resource was not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Device Not Found"
                }
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Unauthorized"
                }
              }
            }
          }
        }
      },
      "Error": {
        "description": "Server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Error"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.usehapn.com/oauth2/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Behaviors",
      "description": "Device behaviors management"
    }
  ],
  "security": [
    {
      "OAuth2": []
    }
  ]
}
```