arazzo: 1.0.1
info:
title: Unity Analytics Validate and Record
summary: Validate an analytics event batch against the schema, then record it only when validation passes.
description: >-
A safe ingestion pattern for Unity Analytics. The workflow first validates a
batch of analytics events against the project's event schemas without
recording them, branches on whether the batch is valid, and records the
events for real only when validation succeeds. Analytics ingestion is
authenticated with an x-api-key header, supplied inline on each step. Every
step spells out its request inline so the flow can be read and executed
without opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-4280.10
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4280.10
capability_name: Product Telemetry Instrumentation
spec: unity-events-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: eventsApi
url: ../openapi/unity-events-api-openapi.yml
type: openapi
workflows:
- workflowId: analytics-validate-and-record
summary: Validate an event batch and record it only if valid.
description: >-
Validates a batch of analytics events, then records them when the first
event reports valid, otherwise ends without recording.
inputs:
type: object
required:
- apiKey
- projectId
- eventName
- eventVersion
- eventTimestamp
- eventUuid
- installationUuid
- sessionUuid
properties:
apiKey:
type: string
description: The Analytics API key sent in the x-api-key header.
projectId:
type: string
description: The Unity project identifier.
eventName:
type: string
description: Custom event name (for example "level_completed").
eventVersion:
type: string
description: Version of the event schema.
eventTimestamp:
type: string
description: ISO 8601 timestamp of when the event occurred.
eventUuid:
type: string
description: Unique event identifier for deduplication.
installationUuid:
type: string
description: Unique installation identifier.
sessionUuid:
type: string
description: Unique session identifier.
parameters:
type: object
description: Optional custom event parameters as key-value pairs.
steps:
- stepId: validate
description: >-
Validate the analytics event batch against the project's schemas without
recording it.
operationId: validateEvents
parameters:
- name: x-api-key
in: header
value: $inputs.apiKey
- name: projectId
in: path
value: $inputs.projectId
requestBody:
contentType: application/json
payload:
events:
- name: $inputs.eventName
eventVersion: $inputs.eventVersion
eventTimestamp: $inputs.eventTimestamp
eventUuid: $inputs.eventUuid
installationUuid: $inputs.installationUuid
sessionUuid: $inputs.sessionUuid
parameters: $inputs.parameters
successCriteria:
- condition: $statusCode == 200
outputs:
validationResults: $response.body#/events
onSuccess:
- name: eventsValid
type: goto
stepId: record
criteria:
- condition: $response.body#/events/0/valid == true
- name: eventsInvalid
type: end
criteria:
- condition: $response.body#/events/0/valid == false
- stepId: record
description: >-
Record the validated analytics event batch for real.
operationId: recordEvents
parameters:
- name: x-api-key
in: header
value: $inputs.apiKey
- name: projectId
in: path
value: $inputs.projectId
requestBody:
contentType: application/json
payload:
events:
- name: $inputs.eventName
eventVersion: $inputs.eventVersion
eventTimestamp: $inputs.eventTimestamp
eventUuid: $inputs.eventUuid
installationUuid: $inputs.installationUuid
sessionUuid: $inputs.sessionUuid
parameters: $inputs.parameters
successCriteria:
- condition: $statusCode == 204
outputs:
validationResults: $steps.validate.outputs.validationResults
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.