# Tags

Tags are where you'll have the ability to tag customers with a certain condition, for example, "Golf Member" then within Stampede, you'll be able to create a segment that searches for customers with this tag/multiple tags.

## Fetch the current tags of a guest

<mark style="color:blue;">`GET`</mark> `/v1/guests/:guest_id/tags`

#### Query Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| guest\_id | String |             |

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

{% endtab %}
{% endtabs %}

## Add a new/existing tag to a guest

<mark style="color:orange;">`PUT`</mark> `/v1/guests/:guest_id/tags`

#### Request Body

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

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

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

## Delete a tag by name from a guest (Idempotent)

<mark style="color:red;">`DELETE`</mark> `/v1/guests/:guest_id/tags/by-name`

Remove a tag from a customer profile by name. This endpoint is idempotent - it's safe to call multiple times. Returns 200 OK whether the tag was found or not, as long as the customer exists.

#### Request Body

| Name                                        | Type   | Description                                  |
| ------------------------------------------- | ------ | -------------------------------------------- |
| tag\_name<mark style="color:red;">\*</mark> | String | Name of the tag to remove (1-255 characters) |

{% tabs %}
{% tab title="200: OK Tag deleted or not found" %}

```json
{
  "message": "Tag removed from customer profile"
}
```

or

```json
{
  "message": "Tag not found on customer profile"
}
```

{% endtab %}

{% tab title="404: Not Found Customer doesn" %}

{% 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.stampede.ai/guests/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.
