For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/api/latest/network-device-monitoring/update-the-tags-for-an-interface.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update the tags for an interface

PATCHhttps://api.datadoghq.com/api/v2/ndm/tags/interfaces/{interface_id}https://api.us3.datadoghq.com/api/v2/ndm/tags/interfaces/{interface_id}https://api.us5.datadoghq.com/api/v2/ndm/tags/interfaces/{interface_id}https://api.datadoghq.eu/api/v2/ndm/tags/interfaces/{interface_id}https://api.ap1.datadoghq.com/api/v2/ndm/tags/interfaces/{interface_id}https://api.ap2.datadoghq.com/api/v2/ndm/tags/interfaces/{interface_id}https://api.uk1.datadoghq.com/api/v2/ndm/tags/interfaces/{interface_id}https://api.ddog-gov.com/api/v2/ndm/tags/interfaces/{interface_id}https://api.us2.ddog-gov.com/api/v2/ndm/tags/interfaces/{interface_id}

Overview

Updates the tags associated with the specified interface.

Arguments

Path Parameters

Name
Type
Description
interface_id [required]
string

The ID of the interface for which to update tags.

Request

Body Data (required)

Field
Type
Description
data
object

Response data for listing interface tags.

Response

OK

Response for listing interface tags.

Field
Type
Description
data
object

Response data for listing interface tags.

Code Example

Update the tags for an interface returns "OK" response
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF