For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/actions-datastores/bulk-write-datastore-items.md. A documentation index is available at /llms.txt.
Language
Datadog site

Bulk write datastore items

POSThttps://api.datadoghq.com/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.us3.datadoghq.com/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.us5.datadoghq.com/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.datadoghq.eu/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.ap1.datadoghq.com/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.ap2.datadoghq.com/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.uk1.datadoghq.com/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.ddog-gov.com/api/v2/actions-datastores/{datastore_id}/items/bulkhttps://api.us2.ddog-gov.com/api/v2/actions-datastores/{datastore_id}/items/bulk

Overview

Creates or replaces multiple items in a datastore by their keys in a single operation.

This endpoint requires the apps_datastore_write permission.

Arguments

Path Parameters

Name
Type
Description
datastore_id [required]
string

The unique identifier of the datastore to retrieve.

Request

Body Data (required)

Field
Type
Description
data
object

Data wrapper containing the items to insert and their configuration for the bulk insert operation.

Response

OK

Response after successfully inserting multiple items into a datastore, containing the identifiers of the created items.

Field
Type
Description
data [required]
[object]

An array of data objects containing the identifiers of the successfully inserted items.

Code Example

Bulk write datastore items returns "OK" response
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF
# Path parameters
export datastore_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/actions-datastores/${datastore_id}/items/bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "values": [
        {
          "id": "cust_3141",
          "name": "Johnathan"
        },
        {
          "id": "cust_3142",
          "name": "Mary"
        }
      ]
    },
    "type": "items"
  }
}
EOF