---
title: Etiquetas
description: "El endpoint de etiquetas permite asignar etiquetas a hosts, por ejemplo: role:database."
breadcrumbs: Documentación > API > Etiquetas
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/llms.txt).

# Etiquetas

El endpoint de etiquetas permite asignar etiquetas a hosts,
por ejemplo: `role:database`. Esas etiquetas se aplican a
todas las métricas enviadas por el host. Consulta hosts por su nombre
(`yourhost.example.com`) cuando busques y apliques
etiquetas a un host concreto.

El componente de tu infraestructura responsable de una etiqueta se identifica
por una fuente. Por ejemplo, algunas fuentes válidas incluyen nagios, hudson, jenkins,
users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc.

Más información sobre etiquetas en [Empezando con etiquetas](https://docs.datadoghq.com/getting_started/tagging.md).

## [Obtener etiquetas](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/tags/get-all-host-tags.md)

| Datadog site      | API endpoint                                        |
| ----------------- | --------------------------------------------------- |
| 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 |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/tags/hosts      |
| 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 |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/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  |

## [Obtener etiquetas de hosts](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/tags/get-host-tags.md)

| Datadog site      | API endpoint                                                    |
| ----------------- | --------------------------------------------------------------- |
| 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} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| 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} |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/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}  |

## [Añadir etiquetas a un host](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/tags/add-tags-to-a-host.md)

| Datadog site      | API endpoint                                                     |
| ----------------- | ---------------------------------------------------------------- |
| 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} |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| 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} |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/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}  |

## [Actualizar etiquetas de hosts](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/tags/update-host-tags.md)

| Datadog site      | API endpoint                                                    |
| ----------------- | --------------------------------------------------------------- |
| 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} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| 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} |
| uk1.datadoghq.com | PUT https://api.uk1.datadoghq.com/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}  |

## [Eliminar etiquetas de hosts](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/tags/remove-host-tags.md)

| Datadog site      | API endpoint                                                       |
| ----------------- | ------------------------------------------------------------------ |
| 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} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v1/tags/hosts/{host_name}      |
| 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} |
| uk1.datadoghq.com | DELETE https://api.uk1.datadoghq.com/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}  |
