For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/reference-tables/upsert-rows.md. A documentation index is available at /llms.txt.
Language
Datadog site

Upsert rows

POSThttps://api.datadoghq.com/api/v2/reference-tables/tables/{id}/rowshttps://api.us3.datadoghq.com/api/v2/reference-tables/tables/{id}/rowshttps://api.us5.datadoghq.com/api/v2/reference-tables/tables/{id}/rowshttps://api.datadoghq.eu/api/v2/reference-tables/tables/{id}/rowshttps://api.ap1.datadoghq.com/api/v2/reference-tables/tables/{id}/rowshttps://api.ap2.datadoghq.com/api/v2/reference-tables/tables/{id}/rowshttps://api.uk1.datadoghq.com/api/v2/reference-tables/tables/{id}/rowshttps://api.ddog-gov.com/api/v2/reference-tables/tables/{id}/rowshttps://api.us2.ddog-gov.com/api/v2/reference-tables/tables/{id}/rows

Descripción general

Create or update rows in a Reference Table by their primary key values. If a row with the specified primary key exists, it is updated; otherwise, a new row is created.

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
id [required]
string

Unique identifier of the reference table to upsert rows into

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
[object]

List of row resources to create or update in the reference table. The request payload can be up to 1 MiB.

Respuesta

Rows created or updated successfully

Ejemplo de código

Upsert rows
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF
## default

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF

## Upsert a row with mixed string and int values

# Path parameters
export id="CHANGE_ME"

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF