For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/agent-observability/batch-update-agent-observability-dataset-records.md. A documentation index is available at /llms.txt.
Language
Datadog site

Batch update Agent Observability dataset records

ADVERTENCIANote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.us3.datadoghq.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.us5.datadoghq.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.datadoghq.eu/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.ap1.datadoghq.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.ap2.datadoghq.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.uk1.datadoghq.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.ddog-gov.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_updatehttps://api.us2.ddog-gov.com/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_update

Descripción general

Insert, update, and delete records in a single dataset operation. By default, a new dataset version is created when the batch is applied.

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
project_id [required]
string

The ID of the Agent Observability project.

dataset_id [required]
string

The ID of the Agent Observability dataset.

Solicitud

Body Data (required)

Batch update payload.

Campo
Type
Descripción
data [required]
object

Data object for batch-updating records in an Agent Observability dataset.

Respuesta

OK

Response containing records after a create or update operation.

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

List of affected dataset records.

Ejemplo de código

Batch update Agent Observability dataset records
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF
# Path parameters
export project_id="a33671aa-24fd-4dcd-9b33-a8ec7dde7751"
export dataset_id="9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"

# 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/llm-obs/v1/${project_id}/datasets/${dataset_id}/batch_update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "create_new_version": true,
      "delete_records": [
        "rec-old-record-1"
      ],
      "insert_records": [
        {
          "expected_output": {
            "answer": "Paris"
          },
          "input": {
            "question": "What is the capital of France?"
          },
          "tags": [
            "topic:geography"
          ]
        }
      ],
      "update_records": [
        {
          "expected_output": {
            "answer": "Paris, France"
          },
          "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c"
        }
      ]
    },
    "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d",
    "type": "datasets"
  }
}
EOF