Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2396,6 +2396,116 @@ components:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: The server cannot process the request because it contains invalid data.
schemas:
AIImpactUserActivityAttributes:
additionalProperties: false
description: |-
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.
properties:
day:
description: The day the activity refers to, in `YYYY-MM-DD` format.
example: "2026-05-26"
pattern: "^\\d{4}-\\d{2}-\\d{2}$"
type: string
is_active:
description: Whether the user actively used the listed AI tools on that day.
example: true
type: boolean
models:
$ref: "#/components/schemas/AIImpactUserActivityModels"
tools:
$ref: "#/components/schemas/AIImpactUserActivityTools"
user_email:
description: |-
The email address of the user. It is case-insensitive and is matched against the
email addresses of commit authors.
example: user@example.com
pattern: "^[^@]+@[^@.]+(?:\\.[^@.]+)+$"
type: string
required:
- user_email
- is_active
- day
- tools
type: object
AIImpactUserActivityData:
additionalProperties: false
description: A single daily AI tool activity entry.
properties:
attributes:
$ref: "#/components/schemas/AIImpactUserActivityAttributes"
type:
$ref: "#/components/schemas/AIImpactUserActivityType"
required:
- type
- attributes
type: object
AIImpactUserActivityDataArray:
description: |-
A batch of daily AI tool activity entries. A batch must contain between 1 and 1,000 entries.
example:
- 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
items:
$ref: "#/components/schemas/AIImpactUserActivityData"
maxItems: 1000
minItems: 1
type: array
AIImpactUserActivityModels:
description: |-
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.
example:
- claude-sonnet-4.5
- gpt-5
items:
description: The name of an AI model.
example: claude-sonnet-4.5
type: string
type: array
AIImpactUserActivityRequest:
additionalProperties: false
description: Request to send daily AI tool activity for one or more users.
properties:
data:
$ref: "#/components/schemas/AIImpactUserActivityDataArray"
required:
- data
type: object
AIImpactUserActivityTools:
description: |-
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.
example:
- Claude Code
- Cursor
items:
description: The name of an AI coding tool.
example: Claude Code
minLength: 1
pattern: ".*\\S.*"
type: string
minItems: 1
type: array
AIImpactUserActivityType:
default: ai_impact_user_activity
description: JSON:API type for AI Impact user activity entries.
enum:
- ai_impact_user_activity
example: ai_impact_user_activity
type: string
x-enum-varnames:
- AI_IMPACT_USER_ACTIVITY
APIErrorResponse:
description: API error response.
properties:
Expand Down Expand Up @@ -141616,6 +141726,59 @@ paths:
operator: OR
permissions:
- security_monitoring_findings_read
/api/v2/ai_impact/user_activity:
post:
description: |-
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.
operationId: CreateAIImpactUserActivity
requestBody:
content:
application/json:
examples:
default:
value:
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
schema:
$ref: "#/components/schemas/AIImpactUserActivityRequest"
required: true
responses:
"200":
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: |-
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.
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
summary: Send AI tool user activity
tags:
- AI Impact
x-codegen-request-body-name: body
/api/v2/annotation:
get:
description: Returns a flat list of annotations matching the given page, time window, and optional widget filter.
Expand Down Expand Up @@ -244846,6 +245009,9 @@ servers:
default: api
description: The subdomain where the API is deployed.
tags:
- description: |-
Send AI coding tool usage data to measure the impact of AI tools on software delivery.
name: AI Impact
- description: |-
Configure your API endpoints through the Datadog API.
name: API Management
Expand Down
42 changes: 42 additions & 0 deletions examples/v2/ai-impact/CreateAIImpactUserActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// 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.AiImpactApi;
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();
AiImpactApi apiInstance = new AiImpactApi(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 AiImpactApi#createAIImpactUserActivity");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading