---
title: Send AI tool user activity
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > DORA Metrics
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Send AI tool user activity{% #send-ai-tool-user-activity %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                      |
| ----------------- | ----------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/ai_impact/user_activity |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/ai_impact/user_activity |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/ai_impact/user_activity      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/ai_impact/user_activity      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/ai_impact/user_activity  |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/ai_impact/user_activity |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/ai_impact/user_activity     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/ai_impact/user_activity |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/ai_impact/user_activity |

### Overview

Send daily AI coding tool activity for one or more users. Each entry records whether a user was active on a given day, along with the AI tools and models they used. An entry is stored once per tool, and sending the same user, day, and tool again overwrites the previous value.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type     | Description                                                                                                                                                                                                                                                            |
| ------------ | ---------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | [object] | A batch of daily AI tool activity entries. A batch must contain between 1 and 1,000 entries.                                                                                                                                                                           |
| data         | attributes [*required*] | object   | Daily AI coding tool activity for a single user. Each entry reports whether the user was active on a given day and which AI tools and models they used.                                                                                                                |
| attributes   | day [*required*]        | string   | The day the activity refers to, in `YYYY-MM-DD` format.                                                                                                                                                                                                                |
| attributes   | is_active [*required*]  | boolean  | Whether the user actively used the listed AI tools on that day.                                                                                                                                                                                                        |
| attributes   | models                       | [string] | The AI models the user used on that day, for example `claude-sonnet-4.5` or `gpt-5`. Values are lowercased and duplicates are removed.                                                                                                                                 |
| attributes   | tools [*required*]      | [string] | The AI coding tools the user used on that day, for example `Claude Code`, `Cursor`, or `GitHub Copilot`. Known tools are normalized to a canonical name (`claude_code`, `cursor`, `copilot`), and other values are converted to snake case. Entries must not be empty. |
| attributes   | user_email [*required*] | string   | The email address of the user. It is case-insensitive and is matched against the email addresses of commit authors.                                                                                                                                                    |
| data         | type [*required*]       | enum     | JSON:API type for AI Impact user activity entries. Allowed enum values: `ai_impact_user_activity`                                                                                                                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "day": "2026-05-26",
        "is_active": true,
        "models": [
          "claude-sonnet-4.5",
          "gpt-5"
        ],
        "tools": [
          "Claude Code",
          "Cursor"
        ],
        "user_email": "user@example.com"
      },
      "type": "ai_impact_user_activity"
    }
  ]
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% /tab %}

{% tab title="400" %}
Bad Request: the batch is empty, has more than 1,000 entries, or contains an invalid entry. An entry is invalid when `user_email`, `is_active`, or `day` is missing, `tools` is missing or an empty array, `user_email` is not a valid email address, `day` is not in `YYYY-MM-DD` format, or a tool name is empty. The error message identifies the index of the first invalid entry. Fix the payload and send the request again.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Not Authorized
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/ai_impact/user_activity" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "day": "2026-05-26",
        "is_active": true,
        "models": [
          "claude-sonnet-4.5",
          "gpt-5"
        ],
        "tools": [
          "Claude Code",
          "Cursor"
        ],
        "user_email": "user@example.com"
      },
      "type": "ai_impact_user_activity"
    }
  ]
}
EOF 
                
##### 

```python
"""
Send AI tool user activity returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi
from datadog_api_client.v2.model.ai_impact_user_activity_attributes import AIImpactUserActivityAttributes
from datadog_api_client.v2.model.ai_impact_user_activity_data import AIImpactUserActivityData
from datadog_api_client.v2.model.ai_impact_user_activity_request import AIImpactUserActivityRequest
from datadog_api_client.v2.model.ai_impact_user_activity_type import AIImpactUserActivityType

body = AIImpactUserActivityRequest(
    data=[
        AIImpactUserActivityData(
            attributes=AIImpactUserActivityAttributes(
                day="2026-05-26",
                is_active=True,
                models=[
                    "claude-sonnet-4.5",
                    "gpt-5",
                ],
                tools=[
                    "Claude Code",
                    "Cursor",
                ],
                user_email="user@example.com",
            ),
            type=AIImpactUserActivityType.AI_IMPACT_USER_ACTIVITY,
        ),
    ],
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DORAMetricsApi(api_client)
    api_instance.create_ai_impact_user_activity(body=body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" python3 "example.py"
##### 

```ruby
# Send AI tool user activity returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new

body = DatadogAPIClient::V2::AIImpactUserActivityRequest.new({
  data: [
    DatadogAPIClient::V2::AIImpactUserActivityData.new({
      attributes: DatadogAPIClient::V2::AIImpactUserActivityAttributes.new({
        day: "2026-05-26",
        is_active: true,
        models: [
          "claude-sonnet-4.5",
          "gpt-5",
        ],
        tools: [
          "Claude Code",
          "Cursor",
        ],
        user_email: "user@example.com",
      }),
      type: DatadogAPIClient::V2::AIImpactUserActivityType::AI_IMPACT_USER_ACTIVITY,
    }),
  ],
})
p api_instance.create_ai_impact_user_activity(body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" rb "example.rb"
##### 

```go
// Send AI tool user activity returns "OK" response

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.AIImpactUserActivityRequest{
		Data: []datadogV2.AIImpactUserActivityData{
			{
				Attributes: datadogV2.AIImpactUserActivityAttributes{
					Day:      "2026-05-26",
					IsActive: true,
					Models: []string{
						"claude-sonnet-4.5",
						"gpt-5",
					},
					Tools: []string{
						"Claude Code",
						"Cursor",
					},
					UserEmail: "user@example.com",
				},
				Type: datadogV2.AIIMPACTUSERACTIVITYTYPE_AI_IMPACT_USER_ACTIVITY,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDORAMetricsApi(apiClient)
	r, err := api.CreateAIImpactUserActivity(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DORAMetricsApi.CreateAIImpactUserActivity`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" go run "main.go"
##### 

```java
// Send AI tool user activity returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DoraMetricsApi;
import com.datadog.api.client.v2.model.AIImpactUserActivityAttributes;
import com.datadog.api.client.v2.model.AIImpactUserActivityData;
import com.datadog.api.client.v2.model.AIImpactUserActivityRequest;
import com.datadog.api.client.v2.model.AIImpactUserActivityType;
import java.util.Arrays;
import java.util.Collections;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient);

    AIImpactUserActivityRequest body =
        new AIImpactUserActivityRequest()
            .data(
                Collections.singletonList(
                    new AIImpactUserActivityData()
                        .attributes(
                            new AIImpactUserActivityAttributes()
                                .day("2026-05-26")
                                .isActive(true)
                                .models(Arrays.asList("claude-sonnet-4.5", "gpt-5"))
                                .tools(Arrays.asList("Claude Code", "Cursor"))
                                .userEmail("user@example.com"))
                        .type(AIImpactUserActivityType.AI_IMPACT_USER_ACTIVITY)));

    try {
      apiInstance.createAIImpactUserActivity(body);
    } catch (ApiException e) {
      System.err.println("Exception when calling DoraMetricsApi#createAIImpactUserActivity");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" java "Example.java"
##### 

```rust
// Send AI tool user activity returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI;
use datadog_api_client::datadogV2::model::AIImpactUserActivityAttributes;
use datadog_api_client::datadogV2::model::AIImpactUserActivityData;
use datadog_api_client::datadogV2::model::AIImpactUserActivityRequest;
use datadog_api_client::datadogV2::model::AIImpactUserActivityType;

#[tokio::main]
async fn main() {
    let body = AIImpactUserActivityRequest::new(vec![AIImpactUserActivityData::new(
        AIImpactUserActivityAttributes::new(
            "2026-05-26".to_string(),
            true,
            vec!["Claude Code".to_string(), "Cursor".to_string()],
            "user@example.com".to_string(),
        )
        .models(vec!["claude-sonnet-4.5".to_string(), "gpt-5".to_string()]),
        AIImpactUserActivityType::AI_IMPACT_USER_ACTIVITY,
    )]);
    let configuration = datadog::Configuration::new();
    let api = DORAMetricsAPI::with_config(configuration);
    let resp = api.create_ai_impact_user_activity(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" cargo run
{% /tab %}
