Add and Remove User-defined Tags

Use the IoT Security API to add and remove custom user tags for IoT devices.

Synopsis

URI
/pub/v4.0/device/update
HTTP Method
PUT
FQDN
<customer-name>.iot.paloaltonetworks.com

Description

Add or remove one or more user tags for IoT devices.

Request Fields

The URL of this request contains the following parameters:
Field
Description
customerid
(
Required
) The customer ID specifies the API call for a specific tenant.
The following value is a string.
The payload of this request contains the following parameters:
Field
Description
tags
This is an array of user tags being assigned to devices. The tags are strings that cannot contain special characters.
To remove previously assigned user tags, include all the tags you want to assign except those you want to remove. The new set of tags replaces the previous set. To remove the only tag assigned to one or more devices, pass an empty array:
[]
.
deviceidlist
(
Required
) This is an array of one or more device IDs to which you are applying user tags. Each item in the array is a string.
Request to Add a User-defined Tag Example
curl 'https://acmecorp.iot.paloaltonetworks.com/pub/v4.0/device/update?customerid=acmecorp' -H 'X-Key-Id: <key_id>' -H 'X-Access-Key: <access_key>' --header 'Content-Type: application/json' --data-raw '{ "tags": [ "imaging device", "Peninsula-Park" ], "deviceidlist": [ "00:e0:81:e6:01:4b", "00:e0:81:e6:02:55", "0c:c4:7a:a8:c3:22" ] }'

Success Response

Upon success, the HTTP response code is 200.
Success Response Example
{ "api": "/pub/v4.0/device/update", "ver":"v4.0", "code": 1, "message": "OK", "updatedDeviceNum": 3 }

Error Response

Upon error, the reply includes an HTTP response code, an error message, and additional information describing the error. The HTTP response code is one of the following:
Field
Description
400
Bad Request. Got an invalid JSON.
401
Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.
402
Unauthorized access. User does not have the required license type to run this API.
403
Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.
500
Internal server error. A unified status for API communication type errors.
Error Response Format
{code: STATUS_CODE, msg: GENERAL_MESSAGE}

Recommended For You