---
title: Tags
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Tags
---

# Tags

The tag endpoint allows you to assign tags to hosts, for example: `role:database`. Those tags are applied to all metrics sent by the host. Refer to hosts by name (`yourhost.example.com`) when fetching and applying tags to a particular host.

The component of your infrastructure responsible for a tag is identified by a source. For example, some valid sources include nagios, hudson, jenkins, users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc. Find a complete list of source type names under [API Source Attributes](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value.md).

Read more about tags on [Getting Started with Tags](https://docs.datadoghq.com/getting_started/tagging.md).

## Get All Host Tags →{% #get-all-host-tags %}

| Datadog site      | API endpoint                                        |
| ----------------- | --------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v1/tags/hosts |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v1/tags/hosts |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/tags/hosts      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v1/tags/hosts      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v1/tags/hosts  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v1/tags/hosts     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v1/tags/hosts |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v1/tags/hosts |

## Get Host Tags →{% #get-host-tags %}

| Datadog site      | API endpoint                                                    |
| ----------------- | --------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v1/tags/hosts/{host_name} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v1/tags/hosts/{host_name} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v1/tags/hosts/{host_name}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v1/tags/hosts/{host_name}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v1/tags/hosts/{host_name}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v1/tags/hosts/{host_name} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v1/tags/hosts/{host_name} |

## Add tags to a host →{% #add-tags-to-a-host %}

| Datadog site      | API endpoint                                                     |
| ----------------- | ---------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v1/tags/hosts/{host_name} |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v1/tags/hosts/{host_name} |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v1/tags/hosts/{host_name}      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v1/tags/hosts/{host_name}  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v1/tags/hosts/{host_name}     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v1/tags/hosts/{host_name} |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v1/tags/hosts/{host_name} |

## Update host tags →{% #update-host-tags %}

| Datadog site      | API endpoint                                                    |
| ----------------- | --------------------------------------------------------------- |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v1/tags/hosts/{host_name} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v1/tags/hosts/{host_name} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v1/tags/hosts/{host_name}      |
| us2.ddog-gov.com  | PUT https://api.us2.ddog-gov.com/api/v1/tags/hosts/{host_name}  |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v1/tags/hosts/{host_name}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v1/tags/hosts/{host_name} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v1/tags/hosts/{host_name} |

## Remove host tags →{% #remove-host-tags %}

| Datadog site      | API endpoint                                                       |
| ----------------- | ------------------------------------------------------------------ |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v1/tags/hosts/{host_name} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v1/tags/hosts/{host_name} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v1/tags/hosts/{host_name}      |
| us2.ddog-gov.com  | DELETE https://api.us2.ddog-gov.com/api/v1/tags/hosts/{host_name}  |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v1/tags/hosts/{host_name}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v1/tags/hosts/{host_name} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v1/tags/hosts/{host_name} |
