> For the complete documentation index, see [llms.txt](https://docs.r0app.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r0app.com/api/prm-resources/tags.md).

# Tags

### Summary

Tags are a form of metadata that can be associated with different objects, allowing for more efficient organization, searching, and categorization. Think of tags as labels that are attached to a particular object, much like attaching a sticky note to a document in a file cabinet. For example, you might have a 'Soccer' tag that you assign to everyone on your soccer team.

### View tags

## Fetch a list of tags

<mark style="color:blue;">`GET`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/tags`

Returns a paginated list of an organization's tags.

#### Query Parameters

| Name       | Type    | Description                                                                                                                                                        |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| include\[] | String  | If set to `deleted` all active and [deleted records](/api/introduction/deleting-resources.md) will be returned in the response.                                    |
| page       | Integer | For more info, see the [pagination section ](/api/introduction/getting-started.md#pagination)in the [Getting started](/api/introduction/getting-started.md) guide. |
| limit      | Integer | For more info, see the [pagination section ](/api/introduction/getting-started.md#pagination)in the [Getting started](/api/introduction/getting-started.md) guide. |
| search     | String  | Optional: can be used to search for tags. (Don't forget to URL encode query parameters)                                                                            |

#### Example request

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

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/tags \
    -X GET \
    -H 'Authorization: Bearer <token>'
```

{% endtab %}
{% endtabs %}

### View contacts associated with a tag

## Fetch a list of contacts with a given tag

<mark style="color:blue;">`GET`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/tags/:tag_id/contacts`

Returns a paginated list of an contacts that have a given tag associated with them.

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| :tag\_id<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name       | Type    | Description                                                                                                                                                        |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| include\[] | String  | If set to `deleted` all active and [deleted records](/api/introduction/deleting-resources.md) will be returned in the response.                                    |
| page       | Integer | For more info, see the [pagination section ](/api/introduction/getting-started.md#pagination)in the [Getting started](/api/introduction/getting-started.md) guide. |
| limit      | Integer | For more info, see the [pagination section ](/api/introduction/getting-started.md#pagination)in the [Getting started](/api/introduction/getting-started.md) guide. |

#### Example request

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

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/tags/:tag_id/contacts \
    -X GET \
    -H 'Authorization: Bearer <token>'
```

{% endtab %}
{% endtabs %}

### Create a tag

## Create a tag

<mark style="color:green;">`POST`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/tags`

#### Request Body

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| tag\[name]<mark style="color:red;">\*</mark> | String |             |

#### Example request

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

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/tags \
    -X POST \
    -H 'Authorization: Bearer <token>' \
    -d 'tag[name]=Soccer'
```

{% endtab %}
{% endtabs %}

### Update a tag

## Update a tag

<mark style="color:purple;">`PATCH`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/tags/:tag_id`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| :tag\_id<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| tag\[name]<mark style="color:red;">\*</mark> | String |             |

#### Example request

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

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/tags/:tag_id \
    -X PATCH \
    -H 'Authorization: Bearer <token>' \
    -d 'tag[name]=Football'
```

{% endtab %}
{% endtabs %}

### Delete a tag

## Delete a tag

<mark style="color:red;">`DELETE`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/tags/:tag_id`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| :tag\_id<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name         | Type   | Description                                                                   |
| ------------ | ------ | ----------------------------------------------------------------------------- |
| soft\_delete | String | [Learn more about deleting records](/api/introduction/deleting-resources.md). |

#### Example request

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

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/tags/:tag_id \
    -X DELETE \
    -H 'Authorization: Bearer <token>'
```

{% 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.r0app.com/api/prm-resources/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.
