For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ja/api/latest/agent-observability/create-or-update-annotations.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create or update annotations

警告Note: 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/annotation-queues/{queue_id}/annotationshttps://api.us3.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.us5.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.datadoghq.eu/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.ap1.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.ap2.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.uk1.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.ddog-gov.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.us2.ddog-gov.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotations

概要

Create or update annotations on interactions in a queue. Each annotation is matched by interaction_id and the requesting user's identity. Results and errors in the response are linked to request items by interaction_id. Errors for individual items are returned in the errors field without blocking the rest of the batch. Requests where every item is denied by queue access rules return 403.

引数

パスパラメーター

名前
タイプ
説明
queue_id [required]
string

The ID of the Agent Observability annotation queue.

リクエスト

Body Data (required)

Payload for creating or updating annotations.

フィールド
タイプ
説明
data [required]
object

Data object for creating or updating annotations.

応答

OK — annotations created or updated. For mixed batches, denied items and other per-item errors are listed in errors.

Response containing the created or updated annotations.

フィールド
タイプ
説明
data [required]
object

Data object for the annotations response.

コード例

# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF