> For the complete documentation index, see [llms.txt](https://docs.connect.jfrog.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.connect.jfrog.io/developers/api-reference/connect-api-reference/overview/device-tags.md).

# Tags

The device\_tags endpoint is only used for the deletion of tags.

If you would like to add a tag to your device via our Rest API, see [Change devices details](/developers/api-reference/connect-api-reference/overview/change-devices-details.md).

## Delete Tags from devices

<mark style="color:red;">`DELETE`</mark> `https://api.connect.jfrog.io/v1/device_tags`

Using this call, you can delete a tag from devices.

#### Request Body

| Name                                          | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tag\_name<mark style="color:red;">\*</mark>   | string | <p><br>The tag name you want to delete<br>A tag with that name must exist.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| user\_token<mark style="color:red;">\*</mark> | string | This is your account token. Can be found under the Settings category on Connect dashboard.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| device\_filter                                | object | <p>A JSON object with the filter you would like to apply on your devices fleet. This filter will be applied and the result will be the devices that receive this update. The object has multiple keys: <br><strong>1.</strong> <code>"project": {"name": "\<project\_name>"}</code> set the <code>\<project\_name></code> as your project name from Connect dashboard. The <code>project</code> key <strong>must</strong> exist and the value of it is a JSON with the key <code>name</code>. <br><strong>2.</strong> <code>"groups": \[{"name": "\<group\_name>"}]</code> set the <code>\<group\_name></code> as a group name from Connect dashboard.  The <code>groups</code> key is a <strong>must</strong> key but the value of it can be an empty list. The value of it is a <code>list</code> of <code>JSON</code> objects each has a key called <code>name</code>. If multiple groups exist, all devices within those groups will receive the update.<br><strong>3.</strong> <code>"filters": \[{"type": "\<filter\_type>", "operand": "\<operand>", "value": "\<value>"}]</code> the filters key lets you add custom filters. Set the <code>\<type></code> key as the type of the filter (possible types can be found under this form). Set the <code>\<operand></code> key as the operand for this filter (possible operands can be found under this form). Set the <code>\<value></code> key as the value for this filter (the value depends on the type of the filter, examples can be found under this form).<br><br>You can set multiple filters, if you do so, they will all be applied on top of each other (examples can be found under this form). The <code>filters</code> key is a <strong>must</strong> key but the value of it can be an empty list.</p> |

{% tabs %}
{% tab title="200  Successfully changed" %}

```json
{"message": "Success"}
```

{% endtab %}

{% tab title="400 Error occurred." %}

```
{"error_message": "<ERROR_MESSAGE>"}
```

{% endtab %}

{% tab title="429 Rate limit reached." %}

```
{}
```

{% endtab %}
{% endtabs %}

**Possible types and values:**

* **`device_filter`** objec&#x74;**:**
  * **`filters`** key:&#x20;
    * Possible values for the `type` key:
      * `specific_device` - Set this value if you want to filter one specific device. The value of the  `value` key of this type is the ID of the device you want to filter (you can obtain the id on Connect dashboard). The possible `operand` key values for this type are: `is`, `is_not`
      * `tag` - Set this value if you want to filter devices by a tag. The value of the `value` key of this type is the name of the tag you want to filter (you can obtain the tag name on Connect dashboard). The possible `operand` key values for this type are: `is`, `is_not`
      * `app` - Set this value if you want to filter devices by the apps that are set to them. The value of the `value` key of this type is the app name. The possible `operand` key values for this type are: `is`, `is_not`.
      * `device_state` - Set this value if you want to filter devices by their state. The possible values of the `value` key of this type are: `online`, `offline`.  The possible `operand` key value of this type is: `is`&#x20;
      * `update_status` - Set this value if you want to filter devices by their last update status. The possible values of the `value` key of this type are: `pending`, `in_progress`, `success`, `failed`, `aborted`. The possible `operand` key value of this type is: `is`, `is_not`

{% hint style="warning" %}
All values must be of type: **`String`**.
{% endhint %}

**Full payload example:**&#x20;

```
{
    "user_token": "<user token>",
    "tag_name": "some-tag-name",
    "device_filter": {"project": {"name": "Demo"},
                       "groups": [{"name": "TestGroup1"}, {"name": "TestGroup2"}],
                       "filters": [{"type": "specific_device",
                                    "operand": "is",
                                    "value": "d-4ec7-1be9"}]},
}
```

#### Code Example

{% tabs %}
{% tab title="Python" %}

```python
import json
import requests

#Upswift tokens
user_token = "<user token>"

json_content = {'user_token': user_token,
                'tag_name': 'some-name',
                'device_filter': {'project': {'name': 'Demo'},
                                   'groups': [{'name': 'TestGroup1'}, {'name': 'TestGroup2'}],
                                   'filters': [{'type': 'specific_device',
                                                'operand': 'is',
                                                'value': 'd-4ec7-1be9'}]}
                }
                                
                             
                
call_request = requests.delete("https://api.connect.jfrog.io/v1/device_tags", json=json_content)
call_response = json.loads(call_request.text)

if call_request.status_code != 200:
    if call_request.status_code == 429:
        error = "API limit reached"
    else:
        error = call_response["error_message"]
    print(error)
else:
    response_message = call_response["message"]


```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.connect.jfrog.io/developers/api-reference/connect-api-reference/overview/device-tags.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
