# Tags

## Get tags

<mark style="color:blue;">`GET`</mark> `https://api.raindrop.io/rest/v1/tags/{collectionId}`

#### Path Parameters

| Name         | Type   | Description                                                                                |
| ------------ | ------ | ------------------------------------------------------------------------------------------ |
| collectionId | number | Optional collection ID, when not specified all tags from all collections will be retrieved |

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

```javascript
{
    "result": true,
    "items": [
        {
            "_id": "api",
            "count": 100
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Rename tag

<mark style="color:orange;">`PUT`</mark> `https://api.raindrop.io/rest/v1/tags/{collectionId}`

#### Path Parameters

| Name         | Type   | Description                                                                   |
| ------------ | ------ | ----------------------------------------------------------------------------- |
| collectionId | number | It's possible to restrict rename action to just one collection. It's optional |

#### Request Body

| Name    | Type   | Description                                                |
| ------- | ------ | ---------------------------------------------------------- |
| replace | string | New name                                                   |
| tags    | array  | Specify **array** with **only one** string (name of a tag) |

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

```javascript
{
    "result": true
}
```

{% endtab %}
{% endtabs %}

## Merge tags

<mark style="color:orange;">`PUT`</mark> `https://api.raindrop.io/rest/v1/tags/{collectionId}`

Basically this action rename bunch of `tags` to new name (`replace` field)

#### Path Parameters

| Name         | Type   | Description                                                                  |
| ------------ | ------ | ---------------------------------------------------------------------------- |
| collectionId | string | It's possible to restrict merge action to just one collection. It's optional |

#### Request Body

| Name    | Type   | Description  |
| ------- | ------ | ------------ |
| replace | string | New name     |
| tags    | array  | List of tags |

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

```javascript
{
    "result": true
}
```

{% endtab %}
{% endtabs %}

## Remove tag(s)

<mark style="color:red;">`DELETE`</mark> `https://api.raindrop.io/rest/v1/tags/{collectionId}`

#### Path Parameters

| Name         | Type   | Description                                                                   |
| ------------ | ------ | ----------------------------------------------------------------------------- |
| collectionId | string | It's possible to restrict remove action to just one collection. It's optional |

#### Request Body

| Name | Type  | Description  |
| ---- | ----- | ------------ |
| tags | array | List of tags |

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

```javascript
{
    "result": true
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://developer.raindrop.io/v1/tags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
