Tool Name: airdroid_business_delete_groups
Risk Level: 🔴 High Risk
Execution Mode: ⚡ Synchronous
Category: Group Management
Quick Start (Copy & Use)
One-liner: Batch-delete one or more empty groups (groups with no devices).
You need: GroupIds (array of group IDs to delete), Confirm (must be true), Reason (reason for deletion)
Success criteria: StatusCode == 200 AND ErrorMessage == ""
What to do next: Confirm the groups have been deleted; no further action needed
⚠️ High-Risk Operation Warning: This operation is irreversible. Deleted groups cannot be recovered.
Minimum request example:
{
"GroupIds": [100, 101, 102],
"Confirm": true,
"Reason": "Removing obsolete test groups"
}
Minimum response example:
{
"StatusCode": 200,
"ErrorMessage": ""
}
Recipes (Common Recipes)
Recipe 1: Delete a single empty group
Scenario: Delete a single group that is no longer in use
{
"GroupIds": [100],
"Confirm": true,
"Reason": "Consolidating department groups"
}
Recipe 2: Batch-delete multiple groups
Scenario: Clean up multiple obsolete test groups
{
"GroupIds": [100, 101, 102],
"Confirm": true,
"Reason": "Removing obsolete test groups after project completion"
}
Recipe 3: Move devices out first, then delete the group
Scenario: Delete a group that contains devices (must move devices out first)
Step 1: Get devices in the group
{
"Keyword": {"group_name": "Old Group"},
"SelectedColumns": ["device_id"]
}
Step 2: Move devices to another group
{
"DeviceIds": [1001, 1002, 1003],
"GroupId": 200
}
Step 3: Delete the empty group
{
"GroupIds": [100],
"Confirm": true,
"Reason": "Migrated devices to new group, removing old group"
}
1. Overview
1.1 Description
Batch-delete one or more device groups in AirDroid Business. This is a high-risk operation. Only empty groups (containing no devices) can be deleted, and the deletion is irreversible.
1.2 When to Use
- Clean up obsolete groups: Remove groups that are no longer in use
- Organizational restructuring: Clean up surplus groups after merging or reorganizing the group structure
- Test cleanup: Delete temporary groups created in test environments
1.3 Execution Mode & Response
This is a synchronous operation that returns the deletion result immediately.
- Return value: StatusCode and ErrorMessage
- Typical latency: < 2 seconds
1.4 Prerequisites
| Condition | Description | How to Check |
|---|---|---|
| Group is empty | Group must contain no devices | Use Get a Group to check if device_count is 0 |
| Not the default group | Default group cannot be deleted | Use Get a Group to check if is_default is "0" |
| Group exists | Groups to delete must exist | Use Get a Group ID by Group Name to verify |
| User confirmation | Must obtain explicit user authorization | Confirm must be true |
1.5 Prerequisite Tools
| Dependency Tool | Purpose | Necessity |
|---|---|---|
| Get a Group ID by Group Name | Get group IDs to delete | If only group names are known |
| Get a Group | Check if group is empty | 🔴 Recommended |
| Get All Devices | Confirm no devices in the group | Alternative method |
| Move Devices to a Group | Move devices out of the group | If group has devices |
2. Inputs
2.1 Parameter List
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| GroupIds | number-array | ✅ Yes | - | Array of group IDs to delete |
| Confirm | bool | ✅ Yes | - | Safety confirmation; must be true |
| Reason | string | ✅ Yes | - | Reason for deletion; used for audit |
2.2 Parameter Details
`GroupIds`
Array of group IDs to delete.
- Type: number-array (array of integers)
- Format requirements:
- Non-empty array
- Each element must be a positive integer greater than 0
- Maximum count: Up to 50 groups per request
- Source:
How to obtain:
- Use Get a Group ID by Group Name to look up by group name
- Use the group_id field from Get All Devices response
- Use the id field from Get a Group response
- How to fill in a GI node:
- Constant value: Enter an array directly, e.g. [100, 101, 102]
- Upstream output reference: Get from Get a Group ID by Group Name output GroupIds
- Example:
[100, 101, 102]
Important: Only empty groups (device_count = 0) can be deleted.
`Confirm`
Safety confirmation parameter to prevent accidental deletion.
- Type: bool
- Format requirements: Must be explicitly set to true for deletion to proceed
- Design purpose:
- Prevents accidental deletion from automated workflows
- Forces the Agent to confirm user intent before calling
- How to fill in a GI node:
- Constant value: Enter true (only after user confirmation)
- Example:
true
⚠️ Agent behavior requirements:
- Must confirm the deletion intent with the user before calling this tool
- Must set Confirm to true only after receiving explicit user consent
- Must not perform deletion without user confirmation
`Reason`
Reason for deletion, used for audit trails and compliance records.
- Type: string
- Format requirements:
- Cannot be empty or contain only spaces
- Should concisely explain the deletion reason
- Purpose:
- Recorded in the system audit log
- Facilitates post-hoc traceability
- Satisfies compliance requirements
- How to fill in a GI node:
- Constant value: Enter a string directly, e.g. "Consolidating regional groups"
- Upstream output reference: Get the deletion reason from user input
- Example:
"Consolidating regional groups after org restructure"
or
"Removing obsolete test groups"
3. Outputs
3.1 Response Examples
Success response:
{
"StatusCode": 200,
"ErrorMessage": ""
}
Error response (not confirmed):
{
"StatusCode": 200,
"ErrorMessage": "Confirm must be set to true to execute deletion. This is a safety measure to prevent accidental deletion."
}
Error response (missing reason):
{
"StatusCode": 200,
"ErrorMessage": "Reason is required for audit trail. Provide a brief explanation for this deletion."
}
Error response (group not empty):
{
"StatusCode": 200,
"ErrorMessage": "Group is not empty. Move devices out first."
}
Error response (parameter error):
{
"StatusCode": -1,
"ErrorMessage": "GroupIds must be a non-empty array of group IDs. Obtain via 'Get a Group ID by Group Name' tool."
}
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: Delete a single group
Request parameters:
{
"GroupIds": [100],
"Confirm": true,
"Reason": "Department no longer uses separate device group"
}
Response:
{
"StatusCode": 200,
"ErrorMessage": ""
}
4.2 Advanced Example: Batch-delete groups
Request parameters:
{
"GroupIds": [100, 101, 102],
"Confirm": true,
"Reason": "Removing obsolete test groups after project completion"
}
Response:
{
"StatusCode": 200,
"ErrorMessage": ""
}
4.3 Error Example: Confirmation not set
Request parameters:
{
"GroupIds": [100],
"Confirm": false,
"Reason": "Test deletion"
}
Response:
{
"StatusCode": 200,
"ErrorMessage": "Confirm must be set to true to execute deletion. This is a safety measure to prevent accidental deletion."
}
4.4 Error Example: Group not empty
Request parameters:
{
"GroupIds": [100],
"Confirm": true,
"Reason": "Removing old group"
}
Response:
{
"StatusCode": 200,
"ErrorMessage": "Group is not empty. Move devices out first via 'Move Devices to a Group' 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 | GroupIds is empty or has invalid format | ❌ 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 | GroupIds must be a non-empty array... | GroupIds is empty | Provide a valid group ID array |
| -1 | Maximum 50 groups per request... | Exceeds per-request limit | Delete in batches of up to 50 |
| 200 | Confirm must be set to true... | Deletion not confirmed | Get user confirmation and set Confirm=true |
| 200 | Reason is required... | Deletion reason not provided | Provide a deletion reason |
| 200 | Group is not empty... | Group contains devices | Move devices out first, then delete |
| 200 | Cannot delete default group | Attempting to delete the default group | Default group cannot be deleted |
| 200 | Group not found | Group does not exist | Verify the GroupId is correct |
| 500 | Request timeout after 60 seconds. | Request timed out | Retry later |
5.3 Agent Self-Healing Decision Table
| StatusCode | Auto-Retry | Retry Strategy | Requires Manual Intervention |
|---|---|---|---|
| -1 | ❌ | - | Fix parameters and call again |
| 200 (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 deletion: Delete up to 50 groups per request; leverage batch capability
- Batch processing: For more than 50 groups, split into multiple requests
6.2 Security Considerations
⚠️ High-Risk Operation Warning: This operation permanently deletes groups and cannot be undone.
| Parameter | Description |
|---|---|
| Confirm | Must be set to true to execute; defaults to not executing (prevents accidental triggers) |
| Reason | Required; used for audit logs, e.g. "Consolidating regional groups" |
Pre-execution checklist:
- ☐ Confirm the group is empty (device_count = 0)
- ☐ Confirm it is not the default group (is_default = "0")
- ☐ Confirm the target is correct (verify group name and ID)
- ☐ Obtain explicit user authorization
- ☐ Record the deletion reason for audit
6.3 Idempotency
Idempotency of this operation: Not idempotent.
- First call: Successfully deletes the group
- Second call with same parameters: Fails because the group no longer exists
- It is recommended to use Get a Group to confirm the group exists before deleting
7. Related Tools
7.1 Prerequisite Tools
| Tool Name | Purpose |
|---|---|
| Get a Group ID by Group Name | Get GroupId by group name |
| Get a Group | Check if group is empty and whether it is the default group |
| Get All Devices | Confirm the device count in the group |
| Move Devices to a Group | Move devices out of the group (to make it empty) |
7.2 Follow-up Tools
| Tool Name | Purpose |
|---|---|
| None | No follow-up action needed after deletion |
7.3 Similar Tools Comparison
| Tool Name | Use Case | Difference |
|---|---|---|
| Delete Groups | Delete empty groups | High-risk operation; requires confirmation |
| Create a Group | Create a group | Creates a resource |
8. Tool Chains
8.1 Safe Group Deletion
Scenario: Perform safety checks before deleting a group
Tool chain:
Get a Group ID by Group Name → Get a Group → [Check] → Delete Groups
Steps:
- Call Get a Group ID by Group Name to get the group ID
- Call Get a Group to check group details
- Verify device_count = 0 and is_default = "0"
- Confirm deletion intent with the user
- Call Delete Groups after user confirmation
8.2 Empty a Group Then Delete
Scenario: Delete a group that contains devices
Tool chain:
Get All Devices → Move Devices to a Group (batch) → Delete Groups
Steps:
- Call Get All Devices to get all devices in the group
- Use Move Devices to a Group to move devices to another group
- Confirm deletion intent with the user
- Call Delete Groups to delete the empty group
8.3 Batch Clean Up Obsolete Groups
Scenario: Clean up multiple groups that are no longer in use
Tool chain:
[Multiple] Get a Group ID by Group Name → [Collect IDs] → Delete Groups
Steps:
- Collect all group names to delete
- Call Get a Group ID by Group Name for each to get IDs
- Check each group is empty
- Confirm the deletion list with the user
- Call Delete Groups to batch-delete (up to 50 per request)
Leave a Reply.