TOC & Recently Viewed

Recently Viewed Topics

Assign Tags to Assets

User Permissions: Basic (16)

To assign tags to assets, or remove tags from assets, use the API endpoint described below.

Before You Begin

  • Determine the UUID of any tag you want to use in this procedure.
  • Determine the UUID of any asset you want to use in this procedure.

HTTP Request

Note: To authenticate your request, be sure to include API keys in the HTTP header of the request. For more information, see Authorization.

Request Path Syntax

POST https://cloud.tenable.com/tags/assets/assignments

Request Path Parameters

None.

Request Path Example

See "Request Path Syntax."

Request Body Syntax

{ "action": {string}, "assets": [ {string}, {string}, {string} ], "tags": [ {string}, {string}, {string}, ] }

Request Body Attributes

Attribute Type Description Required?
action string

Specifies the action you want to take:

  • add—Assign a tag to an asset.
  • remove—Remove a tag from an asset
required
assets array An array of asset UUIDs. required
tags array An array of tag UUIDs. required

Request Body Example 1: Add One Tag to Multiple Assets

{ "action": "add", "assets": [ "208d8f5f-73a9-47cd-8b04-4aa99f38af79", "c2332afe-5bfd-41fe-9e2e-5462dd3df455", "9166eea2-d4aa-4a99-99eb-fee1c36d6457", "5fc79177-e820-4ff7-ac28-6a5a995fea8b", "fc0a57cb-66fc-43a5-a628-13ef10664fe8" ], "tags": [ "18179e00-b0e0-4fd7-be91-e9e854fe66b9" ] }

Request Body Example 2: Add Multiple Tags to One Asset

{ "action": "add", "assets": [ "208d8f5f-73a9-47cd-8b04-4aa99f38af79" ], "tags": [ "18179e00-b0e0-4fd7-be91-e9e854fe66b9", "f45a48b4-50e7-41c3-afb9-2e01f5423698", "fb7fae7d-8acb-48e4-928c-d93103e9e73f" ] }

Request Body Example 3: Add Multiple Tags to Multiple Assets

{ "action": "add", "assets": [ "208d8f5f-73a9-47cd-8b04-4aa99f38af79", "c2332afe-5bfd-41fe-9e2e-5462dd3df455", "9166eea2-d4aa-4a99-99eb-fee1c36d6457", "5fc79177-e820-4ff7-ac28-6a5a995fea8b", "fc0a57cb-66fc-43a5-a628-13ef10664fe8" ], "tags": [ "18179e00-b0e0-4fd7-be91-e9e854fe66b9", "f45a48b4-50e7-41c3-afb9-2e01f5423698", "fb7fae7d-8acb-48e4-928c-d93103e9e73f" ] }

HTTP Response

Response Codes

Status Description
200 Returns the UUID of the asynchronous asset update job. For more information, see "Response Body Syntax."
400 Returned if Tenable.io could not find the specified assets.
429

Returned if you attempt to send too many requests in a specific period of time. For more information, see Rate Limiting.

Response Body Syntax

{ "job_uuid": {string} }

Response Body Attributes

Attribute Type Description
job_uuid string The UUID of the asynchronous asset update job.

Response Body Example

{ "job_uuid": "62210d02a7056d0297f50a8ddfbd549e:aef1d0bc94e1ea3fad09" }

Reference Guide

https://cloud.tenable.com/api#/resources/tags/assign-asset-tags

Copyright © 2019 Tenable, Inc. All rights reserved. Tenable, Tenable.io, Tenable Network Security, Nessus, SecurityCenter, SecurityCenter Continuous View and Log Correlation Engine are registered trademarks of Tenable, Inc.. Tenable.sc, Lumin, Assure, and the Cyber Exposure Company are trademarks of Tenable, Inc. All other products or services are trademarks of their respective owners.