Skip to content

Commit 1889cb0

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Product Analytics Server-Side Events API endpoint (#3047)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 75d6faf commit 1889cb0

18 files changed

+1087
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 332 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41244,6 +41244,114 @@ components:
4124441244
type: string
4124541245
x-enum-varnames:
4124641246
- PROCESS
41247+
ProductAnalyticsServerSideEventError:
41248+
description: Error details.
41249+
properties:
41250+
detail:
41251+
description: Error message.
41252+
example: Malformed payload
41253+
type: string
41254+
status:
41255+
description: Error code.
41256+
example: '400'
41257+
type: string
41258+
title:
41259+
description: Error title.
41260+
example: Bad Request
41261+
type: string
41262+
type: object
41263+
ProductAnalyticsServerSideEventErrors:
41264+
description: Error response.
41265+
properties:
41266+
errors:
41267+
description: Structured errors.
41268+
items:
41269+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventError'
41270+
type: array
41271+
type: object
41272+
ProductAnalyticsServerSideEventItem:
41273+
description: A Product Analytics server-side event.
41274+
properties:
41275+
account:
41276+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemAccount'
41277+
application:
41278+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemApplication'
41279+
event:
41280+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemEvent'
41281+
session:
41282+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemSession'
41283+
type:
41284+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemType'
41285+
usr:
41286+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemUsr'
41287+
required:
41288+
- application
41289+
- event
41290+
- type
41291+
type: object
41292+
ProductAnalyticsServerSideEventItemAccount:
41293+
description: The account linked to your event.
41294+
properties:
41295+
id:
41296+
description: The account ID used in Datadog.
41297+
example: account-67890
41298+
type: string
41299+
required:
41300+
- id
41301+
type: object
41302+
ProductAnalyticsServerSideEventItemApplication:
41303+
description: The application in which you want to send your events.
41304+
properties:
41305+
id:
41306+
description: 'The application ID of your application. It can be found in
41307+
your
41308+
41309+
[application management page](https://app.datadoghq.com/rum/list).'
41310+
example: 123abcde-123a-123b-1234-123456789abc
41311+
type: string
41312+
required:
41313+
- id
41314+
type: object
41315+
ProductAnalyticsServerSideEventItemEvent:
41316+
description: Fields used for the event.
41317+
properties:
41318+
name:
41319+
description: The name of your event, which is used for search in the same
41320+
way as view or action names.
41321+
example: payment.processed
41322+
type: string
41323+
required:
41324+
- name
41325+
type: object
41326+
ProductAnalyticsServerSideEventItemSession:
41327+
description: The session linked to your event.
41328+
properties:
41329+
id:
41330+
description: The session ID captured by the SDK.
41331+
example: session-abcdef
41332+
type: string
41333+
required:
41334+
- id
41335+
type: object
41336+
ProductAnalyticsServerSideEventItemType:
41337+
description: The type of Product Analytics event. Must be `server` for server-side
41338+
events.
41339+
enum:
41340+
- server
41341+
example: server
41342+
type: string
41343+
x-enum-varnames:
41344+
- SERVER
41345+
ProductAnalyticsServerSideEventItemUsr:
41346+
description: The user linked to your event.
41347+
properties:
41348+
id:
41349+
description: The user ID used in Datadog.
41350+
example: user-12345
41351+
type: string
41352+
required:
41353+
- id
41354+
type: object
4124741355
Project:
4124841356
description: A Project
4124941357
properties:
@@ -78016,6 +78124,218 @@ paths:
7801678124
x-permission:
7801778125
operator: OPEN
7801878126
permissions: []
78127+
/api/v2/prodlytics:
78128+
post:
78129+
description: 'Send server-side events to Product Analytics. Server-side events
78130+
are retained for 15 months.
78131+
78132+
78133+
Server-Side events in Product Analytics are helpful for tracking events that
78134+
occur on the server,
78135+
78136+
as opposed to client-side events, which are captured by Real User Monitoring
78137+
(RUM) SDKs.
78138+
78139+
This allows for a more comprehensive view of the user journey by including
78140+
actions that happen on the server.
78141+
78142+
Typical examples could be `checkout.completed` or `payment.processed`.
78143+
78144+
78145+
Ingested server-side events are integrated into Product Analytics to allow
78146+
users to select and filter
78147+
78148+
these events in the event picker, similar to how views or actions are handled.
78149+
78150+
78151+
**Requirements:**
78152+
78153+
- At least one of `usr`, `account`, or `session` must be provided with a valid
78154+
ID.
78155+
78156+
- The `application.id` must reference a Product Analytics-enabled application.
78157+
78158+
78159+
**Custom Attributes:**
78160+
78161+
Any additional fields in the payload are flattened and searchable as facets.
78162+
78163+
For example, a payload with `{"customer": {"tier": "premium"}}` is searchable
78164+
with
78165+
78166+
the syntax `@customer.tier:premium` in Datadog.
78167+
78168+
78169+
The status codes answered by the HTTP API are:
78170+
78171+
- 202: Accepted: The request has been accepted for processing
78172+
78173+
- 400: Bad request (likely an issue in the payload formatting)
78174+
78175+
- 401: Unauthorized (likely a missing API Key)
78176+
78177+
- 403: Permission issue (likely using an invalid API Key)
78178+
78179+
- 408: Request Timeout, request should be retried after some time
78180+
78181+
- 413: Payload too large (batch is above 5MB uncompressed)
78182+
78183+
- 429: Too Many Requests, request should be retried after some time
78184+
78185+
- 500: Internal Server Error, the server encountered an unexpected condition
78186+
that prevented it from fulfilling the request, request should be retried after
78187+
some time
78188+
78189+
- 503: Service Unavailable, the server is not ready to handle the request
78190+
probably because it is overloaded, request should be retried after some time'
78191+
operationId: SubmitProductAnalyticsEvent
78192+
requestBody:
78193+
content:
78194+
application/json:
78195+
examples:
78196+
event-with-account:
78197+
description: Send a server-side event linked to an account.
78198+
summary: Event with account ID
78199+
value:
78200+
account:
78201+
id: account-456
78202+
application:
78203+
id: 123abcde-123a-123b-1234-123456789abc
78204+
event:
78205+
name: checkout.completed
78206+
type: server
78207+
event-with-custom-attributes:
78208+
description: Send a server-side event with additional custom attributes.
78209+
summary: Event with custom attributes
78210+
value:
78211+
application:
78212+
id: 123abcde-123a-123b-1234-123456789abc
78213+
customer:
78214+
tier: premium
78215+
event:
78216+
name: payment.processed
78217+
type: server
78218+
usr:
78219+
id: '123'
78220+
event-with-session:
78221+
description: Send a server-side event linked to a session.
78222+
summary: Event with session ID
78223+
value:
78224+
application:
78225+
id: 123abcde-123a-123b-1234-123456789abc
78226+
event:
78227+
name: form.submitted
78228+
session:
78229+
id: session-789
78230+
type: server
78231+
simple-event-with-user:
78232+
description: Send a server-side event linked to a user.
78233+
summary: Simple event with user ID
78234+
value:
78235+
application:
78236+
id: 123abcde-123a-123b-1234-123456789abc
78237+
event:
78238+
name: payment.processed
78239+
type: server
78240+
usr:
78241+
id: '123'
78242+
schema:
78243+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItem'
78244+
description: Server-side event to send (JSON format).
78245+
required: true
78246+
responses:
78247+
'202':
78248+
content:
78249+
application/json:
78250+
schema:
78251+
type: object
78252+
description: Request accepted for processing (always 202 empty JSON).
78253+
'400':
78254+
content:
78255+
application/json:
78256+
schema:
78257+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78258+
description: Bad Request
78259+
'401':
78260+
content:
78261+
application/json:
78262+
schema:
78263+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78264+
description: Unauthorized
78265+
'403':
78266+
content:
78267+
application/json:
78268+
schema:
78269+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78270+
description: Forbidden
78271+
'408':
78272+
content:
78273+
application/json:
78274+
schema:
78275+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78276+
description: Request Timeout
78277+
'413':
78278+
content:
78279+
application/json:
78280+
schema:
78281+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78282+
description: Payload Too Large
78283+
'429':
78284+
content:
78285+
application/json:
78286+
schema:
78287+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78288+
description: Too Many Requests
78289+
'500':
78290+
content:
78291+
application/json:
78292+
schema:
78293+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78294+
description: Internal Server Error
78295+
'503':
78296+
content:
78297+
application/json:
78298+
schema:
78299+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78300+
description: Service Unavailable
78301+
security:
78302+
- apiKeyAuth: []
78303+
servers:
78304+
- url: https://{subdomain}.{site}
78305+
variables:
78306+
site:
78307+
default: datadoghq.com
78308+
description: The regional site for customers.
78309+
enum:
78310+
- datadoghq.com
78311+
- us3.datadoghq.com
78312+
- us5.datadoghq.com
78313+
- ap1.datadoghq.com
78314+
- ap2.datadoghq.com
78315+
- datadoghq.eu
78316+
subdomain:
78317+
default: browser-intake
78318+
description: The subdomain where the API is deployed.
78319+
- url: '{protocol}://{name}'
78320+
variables:
78321+
name:
78322+
default: browser-intake-datadoghq.com
78323+
description: Full site DNS name.
78324+
protocol:
78325+
default: https
78326+
description: The protocol for accessing the API.
78327+
- url: https://{subdomain}.{site}
78328+
variables:
78329+
site:
78330+
default: datadoghq.com
78331+
description: Any Datadog deployment.
78332+
subdomain:
78333+
default: browser-intake
78334+
description: The subdomain where the API is deployed.
78335+
summary: Send server-side events
78336+
tags:
78337+
- Product Analytics
78338+
x-codegen-request-body-name: body
7801978339
/api/v2/product-analytics/accounts/facet_info:
7802078340
post:
7802178341
description: Get facet information for account attributes including possible
@@ -90212,6 +90532,18 @@ tags:
9021290532
See the [Live Processes page](https://docs.datadoghq.com/infrastructure/process/)
9021390533
for more information.
9021490534
name: Processes
90535+
- description: 'Send server-side events to Product Analytics. Server-Side Events Ingestion
90536+
allows you to collect custom events
90537+
90538+
from any server-side source, and retains events for 15 months. Server-side events
90539+
are helpful for understanding
90540+
90541+
causes of a funnel drop-off which are external to the client-side (for example,
90542+
payment processing error).
90543+
90544+
See the [Product Analytics page](https://docs.datadoghq.com/product_analytics/)
90545+
for more information.'
90546+
name: Product Analytics
9021590547
- description: Manage your Real User Monitoring (RUM) applications, and search or
9021690548
aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/)
9021790549
for more information

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,13 @@ datadog\_api\_client.v2.api.processes\_api module
431431
:members:
432432
:show-inheritance:
433433

434+
datadog\_api\_client.v2.api.product\_analytics\_api module
435+
----------------------------------------------------------
436+
437+
.. automodule:: datadog_api_client.v2.api.product_analytics_api
438+
:members:
439+
:show-inheritance:
440+
434441
datadog\_api\_client.v2.api.reference\_tables\_api module
435442
---------------------------------------------------------
436443

0 commit comments

Comments
 (0)