• Tools
Tools
  • Tools
loading...
No Results
  • ActiveCampaign
  • AirDroid Business
    • Index
    • Clear app data and cache
    • Create a group
    • Delete groups
    • Disable lost mode
    • Error codes
    • Enable lost mode
    • Field reference
    • Get average screen time
    • Get account activities
    • Get a group
    • Get a group id by group name
    • Get a device by name
    • Get a device app by name
    • Get an activity log
    • Get all devices
    • Get all device apps
    • Get all devices with filter
    • Get device info push
    • Get device location report
    • Get device network connection history
    • Get device application usage duration
    • Get device application report
    • Get device online status report
    • Get device remote access report
    • Get data usage overview and trends
    • Get tag ids by tag names
    • Get top 10 apps by usage duration
    • Get top 10 data usage apps
    • Lock a device
    • Move devices to a group
    • Open app to foreground
    • Power off a device
    • Reboot device
    • Remote operation
    • Set tags
    • Turn off device screen
    • Unenroll a device
    • Update a device name
    • Update a device remark
    • Update a group name
    • Update a group remark
  • Asana
  • AWS-S3
  • AWS Lambda
  • Appstore
  • BambooHR
  • Bitbucket
  • Brevo
  • Coda
  • Code
  • ConvertKit
  • CSV
  • Crypto
  • Clockify
  • Data Shaping
  • Date & Time
  • Delay
  • DingTalk
  • Discourse
  • Discord
  • Dropbox
  • Elastic Security
  • FeiShu
  • Freshdesk
  • Freshservice
  • Freshworks CRM
  • Gerrit
  • Gitlab
  • Github
  • Grafana
  • Google Ads
  • Google Docs
  • Google Drive
  • Google Gmail
  • Google Sheets
  • Google Analytics
  • Google Calendar
  • Google Developer
  • Harvest
  • HaloPSA
  • Hacker News
  • Hubspot
  • Help Scout
  • Intercom
  • Jira
  • Jenkins
  • Kafka
  • Lemlist
  • MySQL
  • Monday
  • Metabase
  • MailChimp
  • Microsoft Excel
  • Microsoft Outlook
  • Notion
  • Nextcloud
  • Odoo
  • Ortto
  • Okta
  • PayPal
  • Paddle
  • Pipedrive
  • PostHog
  • PostgreSQL
  • Qdrant
  • QRCode
  • QuickBooks
  • Redis
  • Stripe
  • Splunk
  • Shopify
  • Segment
  • ServiceNow
  • Search&Crawl
  • Text
  • Trello
  • Twilio
  • Todoist
  • Wikipedia
  • WordPress
  • WooCommerce
  • Xml
  • YouTube
  • Zulip
  • Zoom
  • Zendesk
  • Zammad
  • Zoho CRM
Home > Tools > AirDroid Business

Set tags

Tool Name: airdroid_business_set_tags

Risk Level: 🟠 Medium Risk

Execution Mode: âš¡ Synchronous

Category: Device Management

Quick Start (Copy & Use)

Summary: Set tags on a device (supports append or overwrite mode).

Prerequisites: DeviceId (device ID) + TagIds (array of tag IDs).

Success Criteria: StatusCode == 200 and ErrorMessage is empty string.

What to Do Next: Use Get All Devices to verify that tags have been set.

Minimal Request Example:

{
  "DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
  "TagIds": [101, 102]
}

Minimal Response Example:

{
  "StatusCode": 200,
  "ErrorMessage": ""
}

Recipes (Common Recipes)

Recipe 1: Append Tags (Keep Existing Tags)

When to use: Add new tags to a device while keeping its existing tags.

{
  "DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
  "TagIds": [101, 102],
  "IsCover": false
}

Recipe 2: Overwrite Tags (Replace All Existing Tags)

When to use: Replace all existing tags on a device with new ones.

{
  "DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
  "TagIds": [103, 104, 105],
  "IsCover": true
}

Recipe 3: Look Up Tag IDs First Then Set

When to use: You only know the tag names and need to get tag IDs first.

{
  "DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
  "TagIds": [101, 102],
  "IsCover": false
}

Prerequisite step: Call Get Tag IDs by Tag Names first to convert tag names to IDs.

1. Overview

1.1 Description

Set tags on a specified device. Supports two modes:

  • Append mode (IsCover=false): Add new tags to existing ones
  • Overwrite mode (IsCover=true): Replace all existing tags with new ones

1.2 When to Use

  • Add classification tags to devices (e.g., department, location, usage)
  • Batch update device tag classifications
  • Reorganize device tag system

1.3 Execution Mode and Response

This operation is synchronous and returns results immediately.

1.4 Prerequisites

Condition Description How to Check
Device exists Device must be registered in AirDroid Business Use Get All Devices to confirm
Tags exist Tag IDs must be valid Use Get Tag IDs by Tag Names to confirm

1.5 Prerequisite Tools

Dependency Tool Purpose Necessity
Get All Devices Get DeviceId If you only know the device name
Get a Device by Name Get DeviceId by device name If you only know the device name
Get Tag IDs by Tag Names Get TagIds from tag names Required if you only know tag names

2. Inputs

2.1 Parameter List

Parameter Type Required Default Description
DeviceId string Yes - Device unique identifier
TagIds number-array Yes - Array of tag IDs (max 5)
IsCover boolean No false Whether to overwrite existing tags

2.2 Parameter Details

`DeviceId`

Device unique identifier.

  • Type: string
  • Format: Non-empty string
  • Source:

How to obtain:

  1. Via Get All Devices tool - use the device_id field from the response
  2. Via Get a Device by Name tool - exact name query

The device_id field from the output can be used directly as this parameter.

  • Example:
  "fa6edcff65ab444e8b5e0eb08df4175d"

`TagIds`

Array of tag IDs to set.

  • Type: number-array
  • Format:
    • JSON array containing one or more integer tag IDs
    • Maximum 5 tags
  • Source:

How to obtain:

Via Get Tag IDs by Tag Names tool to convert tag names to IDs

  • Example:
  [101, 102, 103]

`IsCover`

Whether to overwrite existing tags.

  • Type: boolean
  • Available values:
    • false (default): Append mode — adds new tags to existing ones
    • true: Overwrite mode — replaces all existing tags with the new ones
  • Notes:
    • In append mode, already existing tags will not be duplicated
    • In overwrite mode, all existing tags are removed, keeping only the newly set tags
  • Example:
  false

2.3 Parameter Combination Logic

  • DeviceId and TagIds are both required
  • IsCover is optional, defaults to false (append mode)
  • TagIds can contain a maximum of 5 tag IDs

3. Outputs

3.1 Response Example

Success response:

{
  "StatusCode": 200,
  "ErrorMessage": ""
}

Error response:

{
  "StatusCode": -1,
  "ErrorMessage": "DeviceId is required. Obtain via 'Get All Devices' or 'Get A Device By Name' tool."
}

3.2 Field Descriptions

Field Path Type Description
StatusCode number Status code. 200=success, -1=parameter error, 500=network exception
ErrorMessage string Error message. Empty string on success

4. Examples

4.1 Basic Example: Append Tags

Request Parameters:

{
  "DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
  "TagIds": [101, 102],
  "IsCover": false
}

Response:

{
  "StatusCode": 200,
  "ErrorMessage": ""
}

4.2 Advanced Example: Overwrite All Tags

Request Parameters:

{
  "DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
  "TagIds": [103, 104, 105],
  "IsCover": true
}

Response:

{
  "StatusCode": 200,
  "ErrorMessage": ""
}

4.3 Error Example: Tag Count Exceeded

Request Parameters:

{
  "DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
  "TagIds": [101, 102, 103, 104, 105, 106]
}

Response:

{
  "StatusCode": 200,
  "ErrorMessage": "Maximum 5 tags allowed per device"
}

5. Error Handling

5.1 AB Three-Layer Error Codes

StatusCode Meaning Use Case Agent Response
-1 Parameter validation error Local validation failure (missing required params, format errors) Do not retry, fix parameters and retry
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, DNS resolution failure May retry (max 2 times, 5-second interval)

5.2 Common Errors

StatusCode ErrorMessage Example Cause Fix
-1 DeviceId is required. Device ID is empty Use Get All Devices to get device ID
-1 TagIds is required. Tag ID array is empty Use Get Tag IDs by Tag Names to get tag IDs
-1 IsCover must be boolean. IsCover type is wrong Ensure true or false is passed
200 Tag not found Tag ID does not exist Confirm tag ID is correct
200 Maximum 5 tags allowed Tag count exceeds limit Reduce to 5 or fewer tags
500 Request timeout after 60 seconds. Request timeout Retry later

5.3 Agent Self-Healing Decision Table

StatusCode Auto Retry Retry Strategy Manual Intervention Needed
-1 No - Check parameters and retry
200 (ErrorMessage non-empty) No - Fix based on error message
500 Yes Max 2 retries, 5-second interval If persistent, manual

6. Best Practices

6.1 Performance Optimization

  • Single device operation: This tool can only set tags for one device at a time; batch setting requires loop calls
  • Tag count limit: Maximum 5 tags per device; plan your tag system accordingly

6.2 Security Considerations

🟡 Write operation:

  • Overwrite risk: Using IsCover=true removes all existing tags; use with caution
  • Confirm target: Verify DeviceId is correct before setting
  • Validate tag IDs: Use Get Tag IDs by Tag Names to verify tag IDs exist

6.3 Idempotency

IsCover=true (overwrite mode): Naturally idempotent. Multiple calls produce the same result.

IsCover=false (append mode): Conditionally idempotent. Already existing tags will not be duplicated and produce no side effects.

7. Related Tools

7.1 Prerequisite Tools

Tool Name Purpose
Get All Devices Get DeviceId
Get a Device by Name Get DeviceId by device name
Get Tag IDs by Tag Names Get TagIds from tag names

7.2 Follow-up Tools

Tool Name Purpose
Get All Devices Verify tags have been set (tags field)

8. Tool Chains

8.1 Set Tags by Tag Names

Scenario: You know the tag names and need to set these tags on a device.

Tool Chain:

Get Tag IDs by Tag Names → Set Tags

Steps:

  1. Call Get Tag IDs by Tag Names to get tag IDs
  2. Extract tag ID array from TagIds.found
  3. Call Set Tags to assign tags to the device

Example:

Input: TagNames = ["Sales", "VIP"]
Output: found = {"Sales": 101, "VIP": 102}
Use: TagIds = [101, 102] to call Set Tags

8.2 Find Device by Name and Set Tags

Scenario: You know the device name and tag names, need to set tags.

Tool Chain:

Get a Device by Name + Get Tag IDs by Tag Names → Set Tags

Steps:

  1. Call Get a Device by Name in parallel to get DeviceId
  2. Call Get Tag IDs by Tag Names in parallel to get TagIds
  3. Use the obtained DeviceId and TagIds to call Set Tags

8.3 Batch Set Same Tags on Multiple Devices

Scenario: Set the same tags on multiple devices.

Tool Chain:

Get Tag IDs by Tag Names → Get All Devices → [Loop] Set Tags

Steps:

  1. Call Get Tag IDs by Tag Names to get tag IDs
  2. Call Get All Devices to get target device list
  3. Iterate through devices and call Set Tags for each one

8.4 Set and Verify

Scenario: Set tags and confirm the operation succeeded.

Tool Chain:

Set Tags → Get All Devices (verify)

Steps:

  1. Call Set Tags to set tags
  2. Confirm ErrorMessage is empty
  3. Call Get All Devices to query the device and confirm the tags field has been updated

Appendix Reference:

  • Field Reference: https://www.goinsight.ai/tools/field-reference/
  • Error Code Quick Reference: https://www.goinsight.ai/tools/error-codes/
Updated on: Feb 13, 2026
Was This Page Helpful?
Prev Remote operation
Next Turn off device screen
Discussion

Leave a Reply. Cancel reply

Your email address will not be published. Required fields are marked*

Product-related questions?Contact Our Support Team to Get a Quick Solution>
On this page
  • Quick Start (Copy & Use)
  • Recipes (Common Recipes)
    • Recipe 1: Append Tags (Keep Existing Tags)
    • Recipe 2: Overwrite Tags (Replace All Existing Tags)
    • Recipe 3: Look Up Tag IDs First Then Set
  • 1. Overview
    • 1.1 Description
    • 1.2 When to Use
    • 1.3 Execution Mode and Response
    • 1.4 Prerequisites
    • 1.5 Prerequisite Tools
  • 2. Inputs
    • 2.1 Parameter List
    • 2.2 Parameter Details
    • 2.3 Parameter Combination Logic
  • 3. Outputs
    • 3.1 Response Example
    • 3.2 Field Descriptions
  • 4. Examples
    • 4.1 Basic Example: Append Tags
    • 4.2 Advanced Example: Overwrite All Tags
    • 4.3 Error Example: Tag Count Exceeded
  • 5. Error Handling
    • 5.1 AB Three-Layer Error Codes
    • 5.2 Common Errors
    • 5.3 Agent Self-Healing Decision Table
  • 6. Best Practices
    • 6.1 Performance Optimization
    • 6.2 Security Considerations
    • 6.3 Idempotency
  • 7. Related Tools
    • 7.1 Prerequisite Tools
    • 7.2 Follow-up Tools
  • 8. Tool Chains
    • 8.1 Set Tags by Tag Names
    • 8.2 Find Device by Name and Set Tags
    • 8.3 Batch Set Same Tags on Multiple Devices
    • 8.4 Set and Verify
loading...
No Results