Tool Name: airdroid_business_move_devices_to_group
Risk Level: 🟠 Medium Risk
Execution Mode: ⚡ Synchronous
Category: Group Management
Quick Start (Copy & Use)
One-liner: Move one or more devices to a specified device group.
You need: DeviceIds (array of device IDs, required), GroupId (target group ID, required)
Success criteria: StatusCode == 200 AND ErrorMessage == ""
What to do next: Confirm devices are in the target group via Get All Devices, or proceed with group-level management
⚠️ Side effect warning: Devices will apply the target group's Policy/Kiosk configuration. If the target group has no configuration, devices will return to a no-policy state.
Minimum request example:
{
"DeviceIds": ["fa6edcff65ab444e8b5e0eb08df4175d", "a286bea023eb4bfc8ef04770ee7dbb5e"],
"GroupId": 100
}
Minimum response example:
{
"StatusCode": 200,
"ErrorMessage": ""
}
Recipes (Common Recipes)
Recipe 1: Move a single device to a group
Scenario: Move one device to a specific group
{
"DeviceIds": ["fa6edcff65ab444e8b5e0eb08df4175d"],
"GroupId": 100
}
Recipe 2: Batch-move multiple devices
Scenario: Move several devices to the same group at once
{
"DeviceIds": [
"fa6edcff65ab444e8b5e0eb08df4175d",
"a286bea023eb4bfc8ef04770ee7dbb5e",
"c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8"
],
"GroupId": 200
}
Recipe 3: Look up group by name then move devices
Scenario: Know the target group name but not the ID
Step 1: Get the target group ID
{
"GroupName": "Sales Team"
}
Response:
{
"GroupIds": [100],
"StatusCode": 200,
"ErrorMessage": ""
}
Step 2: Move devices to the group
{
"DeviceIds": ["fa6edcff65ab444e8b5e0eb08df4175d"],
"GroupId": 100
}
Recipe 4: Move devices out before deleting a group
Scenario: Need to delete a group that contains devices; move them out first
Step 1: Get devices in the group via Get All Devices
Step 2: Move devices to another group
{
"DeviceIds": ["fa6edcff65ab444e8b5e0eb08df4175d", "a286bea023eb4bfc8ef04770ee7dbb5e"],
"GroupId": 200
}
Step 3: Delete the now-empty group via Delete Groups
1. Overview
1.1 Description
Move one or more devices to a specified device group in AirDroid Business. This is a synchronous operation that immediately reassigns the devices to the target group.
1.2 When to Use
- Device reassignment: Move devices to a different group when organizational structure changes
- New device onboarding: Assign newly enrolled devices to their designated group
- Group migration: Move all devices from one group to another before deleting the old group
- Temporary grouping: Temporarily move devices to a maintenance or staging group
1.3 Execution Mode & Response
This is a synchronous operation that returns the result immediately.
- Return value: StatusCode and ErrorMessage
- Typical latency: < 2 seconds
1.4 Prerequisites
| Condition | Description | How to Check |
|---|---|---|
| Devices exist | DeviceIds must correspond to existing devices | Use Get All Devices or Get a Device by Name to verify |
| Target group exists | GroupId must correspond to an existing group | Use Get a Group to verify |
| Sufficient permissions | Account must have permission to move devices | - |
1.5 Prerequisite Tools
| Dependency Tool | Purpose | Necessity |
|---|---|---|
| Get All Devices | Get device IDs from the device list | If device IDs are unknown |
| Get a Device by Name | Get device ID by exact device name | If only the device name is known |
| Get a Group ID by Group Name | Get target group ID by group name | If only the group name is known |
| Get a Group | Verify target group exists | Recommended |
2. Inputs
2.1 Parameter List
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| DeviceIds | string-array | ✅ Yes | - | Array of device unique identifiers |
| GroupId | number | ✅ Yes | - | Target group unique identifier |
2.2 Parameter Details
`DeviceIds`
Array of device unique identifiers to move.
- Type: string-array (array of strings)
- Format requirements:
- Non-empty array
- Each element is a device ID string (e.g., "fa6edcff65ab444e8b5e0eb08df4175d")
- Source:
How to obtain:
- Use Get All Devices — returns device_id in the Devices array
- Use Get a Device by Name — for exact device name match; the device_id field can be used directly
- How to fill in a GI node:
- Constant value: Enter an array directly, e.g. ["fa6edcff65ab444e8b5e0eb08df4175d"]
- Upstream output reference: Get from Get All Devices or Get a Device by Name output
- Example:
["fa6edcff65ab444e8b5e0eb08df4175d", "a286bea023eb4bfc8ef04770ee7dbb5e"]
`GroupId`
Unique identifier of the target group to move the devices to.
- Type: number (integer)
- Format requirements: Must be a positive integer greater than 0
- Source:
How to obtain:
- Use Get a Group ID by Group Name for name-based lookup
- Use the group_id field from Get All Devices device info
- How to fill in a GI node:
- Constant value: Enter a number directly, e.g. 100
- Upstream output reference: Get from Get a Group ID by Group Name output GroupIds[0]
- Example:
100
3. Outputs
3.1 Response Examples
Success response:
{
"StatusCode": 200,
"ErrorMessage": ""
}
Error response (invalid device IDs):
{
"StatusCode": -1,
"ErrorMessage": "device_ids must be a list of strings. Obtain via 'Get All Devices' tool."
}
Error response (invalid group ID):
{
"StatusCode": -1,
"ErrorMessage": "group_id must be an integer. Obtain via 'Get a Group ID by Group Name' tool."
}
Error response (rate limited):
{
"StatusCode": 200,
"ErrorMessage": "Rate limited. Please retry after a few seconds."
}
3.2 Field Descriptions
| Field Path | Type | Description |
|---|---|---|
| StatusCode | number | Status code. See 5.1 AB Three-Layer Error Codes |
| ErrorMessage | string | Error message. Empty string on success |
4. Examples
4.1 Basic Example: Move a single device
Request parameters:
{
"DeviceIds": ["fa6edcff65ab444e8b5e0eb08df4175d"],
"GroupId": 100
}
Response:
{
"StatusCode": 200,
"ErrorMessage": ""
}
4.2 Advanced Example: Batch-move multiple devices
Request parameters:
{
"DeviceIds": [
"fa6edcff65ab444e8b5e0eb08df4175d",
"a286bea023eb4bfc8ef04770ee7dbb5e",
"c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8"
],
"GroupId": 200
}
Response:
{
"StatusCode": 200,
"ErrorMessage": ""
}
4.3 Error Example: Invalid device IDs format
Request parameters:
{
"DeviceIds": "not_an_array",
"GroupId": 100
}
Response:
{
"StatusCode": -1,
"ErrorMessage": "device_ids must be a list of strings. Obtain via 'Get All Devices' tool."
}
4.4 Error Example: Invalid group ID format
Request parameters:
{
"DeviceIds": ["fa6edcff65ab444e8b5e0eb08df4175d"],
"GroupId": "not_a_number"
}
Response:
{
"StatusCode": -1,
"ErrorMessage": "group_id must be an integer. Obtain via 'Get a Group ID by Group Name' tool."
}
5. Error Handling
5.1 AB Three-Layer Error Codes
Core principle: AB uses a three-layer error code strategy. The Agent should decide its handling approach based on the StatusCode.
| StatusCode | Meaning | Scenario | Agent Action |
|---|---|---|---|
| -1 | Parameter validation error | DeviceIds is not a list or GroupId is not an integer | ❌ Do not retry; fix parameters and call again |
| 200 | Business success or business error | HTTP request succeeded; check ErrorMessage | Empty ErrorMessage = success; non-empty = business error |
| 500 | Network/request exception | Timeout, connection failure | ⚠️ Retry up to 2 times with 5-second intervals |
5.2 Common Errors
| StatusCode | ErrorMessage Example | Cause | Fix |
|---|---|---|---|
| -1 | device_ids must be a list of strings... | DeviceIds is not an array | Provide a valid string array of device IDs |
| -1 | group_id must be an integer... | GroupId is not an integer | Provide a valid integer group ID |
| -1 | access_token is required. | Access token is missing | Ensure credential is configured |
| 200 | Rate limited. Please retry after a few seconds. | API rate limit exceeded | Wait a few seconds and retry |
| 200 | access_token is invalid. | Token is invalid or expired | Refresh the AccessToken |
| 500 | Request timeout after 60 seconds. | Request timed out | Retry later |
| 500 | Request error: ... | Network connectivity issue | Check network and retry |
5.3 Agent Self-Healing Decision Table
| StatusCode | Auto-Retry | Retry Strategy | Requires Manual Intervention |
|---|---|---|---|
| -1 | ❌ | - | Fix parameters and call again |
| 200 (rate limited) | ⚠️ | Wait a few seconds and retry | - |
| 200 (other non-empty ErrorMessage) | ❌ | - | Fix based on error message |
| 500 | ⚠️ | Retry up to 2 times with 5-second intervals | Escalate if failures persist |
6. Best Practices
6.1 Performance Optimization
- Batch moves: Move multiple devices in a single call rather than one at a time
- Pre-validate: Verify device IDs and group ID exist before calling to avoid errors
6.2 Security Considerations
🟡 Write operation: This operation modifies device group assignment.
⚠️ Side effects:
- Devices will apply the target group's Policy/Kiosk configuration
- If the target group has no configuration, devices will return to a no-policy state
- Always confirm the target group's configuration before moving devices
- Verify target: Ensure the target GroupId is correct before moving devices
- Configuration impact: Be aware that moving devices may change their applied policies
- Batch safety: When moving many devices, consider the impact on device management
6.3 Idempotency
Idempotency of this operation: Idempotent.
- Moving devices to their current group has no effect
- Multiple calls with the same parameters produce the same result
7. Related Tools
7.1 Prerequisite Tools
| Tool Name | Purpose |
|---|---|
| Get All Devices | Get device IDs from the device list |
| Get a Device by Name | Get device ID by exact device name match |
| Get a Group ID by Group Name | Get target group ID by group name |
| Get a Group | Verify target group exists and check its configuration |
7.2 Follow-up Tools
| Tool Name | Purpose |
|---|---|
| Get All Devices | Confirm devices are in the target group |
| Delete Groups | Delete the now-empty source group (if needed) |
7.3 Similar Tools Comparison
| Tool Name | Use Case | Difference |
|---|---|---|
| Move Devices to a Group | Move devices between groups | Reassigns devices; applies target group config |
| Create a Group | Create a new group | Creates a resource; does not move devices |
8. Tool Chains
8.1 Look Up Group by Name and Move Devices
Scenario: User provides the target group name; move devices into that group
Tool chain:
Get a Group ID by Group Name → Move Devices to a Group
Steps:
- Call Get a Group ID by Group Name to get the target group ID
- Verify the group exists (GroupIds is not empty)
- Use the GroupId to call Move Devices to a Group
8.2 Look Up Devices by Name and Move
Scenario: User provides device names and target group; move the devices
Tool chain:
Get a Device by Name → Move Devices to a Group
Steps:
- Call Get a Device by Name to get the device ID
- Collect all device IDs into an array
- Call Move Devices to a Group with the device IDs and target group ID
8.3 Empty a Group Before Deleting
Scenario: Move all devices out of a group so it can be deleted
Tool chain:
Get All Devices → Move Devices to a Group → Delete Groups
Steps:
- Call Get All Devices to get all devices in the source group
- Call Move Devices to a Group to move them to another group
- Confirm the source group is now empty
- Call Delete Groups to delete the empty group (requires user confirmation)
8.4 Create a Group and Move Devices Into It
Scenario: Create a new group and immediately assign devices to it
Tool chain:
Create a Group → Move Devices to a Group
Steps:
- Call Create a Group to create the new group
- Use the returned GroupId and the device IDs to call Move Devices to a Group
Leave a Reply.