Record analytics events
POST
/api/v1/analytics/events
const url = 'https://api.ultimateteam.ai/api/v1/analytics/events';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"events":[{"event_type":"example","feature":"example","metadata":{},"session_id":"example","timestamp":1}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ultimateteam.ai/api/v1/analytics/events \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "events": [ { "event_type": "example", "feature": "example", "metadata": {}, "session_id": "example", "timestamp": 1 } ] }'Accept a batch of analytics events (1-50). Authenticated.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
BatchEventsRequest
Request body for batch event recording.
Attributes: events: List of analytics events (1-50).
object
events
required
Events
Batch of events (1-50)
Array<object>
AnalyticsEventA single analytics event in a batch.
Attributes: event_type: Type of event (page_view, feature_use, session_start, session_end). feature: Feature name (required for feature_use events). timestamp: Unix epoch timestamp of the event. metadata: Optional extra metadata. session_id: Session identifier (required for session_start/session_end).
Examplegenerated
{ "events": [ { "event_type": "example", "feature": "example", "metadata": {}, "session_id": "example", "timestamp": 1 } ]}Responses
Section titled “ Responses ”Successful Response
Media typeapplication/json
Response Record Events Api V1 Analytics Events Post
object
key
additional properties
integer
Examplegenerated
{ "additionalProperty": 1}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}