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

# Send behavior to multiple devices in bulk.

Send a behavior to multiple devices at the same time. Returns a single taskid to track the status of the behavior task.


# 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/bulk": {
      "post": {
        "summary": "Send behavior to multiple devices in bulk.",
        "tags": [
          "Behaviors"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkSendBehaviorBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk send behavior result",
            "content": {
              "application/json": {
                "schema": {
                  "description": "",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string",
                      "minLength": 1
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "taskId": {
                          "type": "string",
                          "description": "The task identifier for the bulk behavior."
                        }
                      }
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                },
                "examples": {
                  "example-1": {
                    "value": {
                      "success": true,
                      "message": "ok",
                      "result": {
                        "taskId": "1e937f98-3e2d-4423-bcbb-711b3a6cf6d2"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The specified resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example-1": {
                    "value": {
                      "success": false,
                      "message": "Device(s) Not Found"
                    }
                  },
                  "example-2": {
                    "value": {
                      "success": false,
                      "message": "Some of the devices behaviors were not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "bulk-send-behavior",
        "description": "Send a behavior to multiple devices at the same time. Returns a single taskid to track the status of the behavior task.\n"
      }
    }
  },
  "components": {
    "schemas": {
      "BulkSendBehaviorBody": {
        "description": "Device behavior definition",
        "type": "object",
        "x-examples": {
          "example-1": {
            "imeis": [
              "868239050345326",
              "868239050345327"
            ],
            "name": "REPORT_FREQ",
            "parameters": {
              "frequency": 5
            }
          }
        },
        "title": "Bulk send behavior body",
        "properties": {
          "imeis": {
            "description": "List of device IMEIs.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "description": "The behavior name identifier",
            "type": "string"
          },
          "parameters": {
            "description": "The behavior parameters if applies",
            "type": "object"
          },
          "highPriority": {
            "description": "Send the behavior with higher priority. If true, the system will do its best effort to deliver it to the device. Otherwise the behavior will reach the device the next time it reports to the system.",
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "imeis",
          "name"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "message"
        ],
        "x-examples": {
          "example-1": {
            "value": {
              "success": false,
              "message": "Unauthorized"
            }
          }
        }
      }
    },
    "responses": {
      "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": []
    }
  ]
}
```