Import tags via API
This guide shows the minimal API call to bulk-import tag values from an XLSX file. Use for manual/custom tags – not discovery-managed, read-only tags.
Prerequisites
Section titled “Prerequisites”- API token (header
token: <value>) with permission to edit the target assets. - XLSX file with a column to match assets and a column with the tag values.
- Know the asset type (e.g.,
All Machines) and which tag you’re setting. - Endpoint:
POST /rest/action/bulktag/xlsx - Content-Type:
application/octet-stream
Parameters (query string)
Section titled “Parameters (query string)”resourceType: asset type to update (e.g.,All%20Machines).matchColumn: column name in XLSX used to match rows.matchTag: tag in vScope that corresponds tomatchColumn(e.g.,Name).valueColumn: column in XLSX with the tag values to import (e.g.,Your Manual Tag).apply:falseto preview (dry run),trueto commit changes.
Example (curl)
Section titled “Example (curl)”curl -X POST \ -H 'token: <TOKEN>' \ -H 'Content-Type: application/octet-stream' \ --data-binary @./your-file.xlsx \ "https://<vscope>/rest/action/bulktag/xlsx?resourceType=All%20Machines&matchColumn=Name&matchTag=Name&valueColumn=Your%20Manual%20Tag&apply=false"- Run with
apply=falseto see the preview counts. - If correct, rerun with
apply=trueto commit.
- Keep tag names consistent; avoid overlapping with discovery-managed tags.
- Ensure the match column uniquely identifies assets (e.g.,
Name,IP,Serial). - For large files, test on a small subset first.
Optional: using Postman
Section titled “Optional: using Postman”- Set method
POST, URL as above with query params. - Headers:
token: <TOKEN>,Content-Type: application/octet-stream. - Body:
binary→ select your XLSX file. - Send with
apply=false, thentrueto commit.
If the request fails, check token/permissions, Content-Type header, and that resourceType matches an existing asset type.