openapi: 3.0.1 info: title: Unity Analytics Allocations Player Data API description: The Unity Analytics REST API provides endpoints for ingesting custom analytics events from game clients and servers. Events are used to track player behavior, game performance, and feature adoption. The API supports batched event ingestion with automatic retry and buffering for high-volume game telemetry. version: v1.0.0 termsOfService: https://unity.com/legal/terms-of-service contact: name: Unity Support url: https://support.unity.com license: name: Unity Terms of Service url: https://unity.com/legal/terms-of-service servers: - url: https://analytics.services.api.unity.com description: Unity Analytics Production Server security: - apiKeyAuth: [] tags: - name: Player Data description: Manage player-scoped key-value data paths: /v1/data/projects/{projectId}/players/{playerId}: get: operationId: getPlayerData summary: Get Player Data description: Returns all data items stored for the specified player. tags: - Player Data parameters: - name: projectId in: path required: true schema: type: string - name: playerId in: path required: true schema: type: string - name: keys in: query required: false schema: type: array items: type: string description: Filter by specific keys responses: '200': description: Player data items content: application/json: schema: $ref: '#/components/schemas/PlayerDataList' '401': description: Unauthorized /v1/data/projects/{projectId}/players/{playerId}/items: post: operationId: setPlayerData summary: Set Player Data Items description: Creates or updates one or more key-value data items for a player. Supports optimistic concurrency via write locks. tags: - Player Data parameters: - name: projectId in: path required: true schema: type: string - name: playerId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SetPlayerDataRequest' responses: '200': description: Data items saved content: application/json: schema: $ref: '#/components/schemas/PlayerDataList' '400': description: Bad Request /v1/data/projects/{projectId}/players/{playerId}/items/{key}: delete: operationId: deletePlayerDataItem summary: Delete Player Data Item description: Deletes a specific data item by key for a player. tags: - Player Data parameters: - name: projectId in: path required: true schema: type: string - name: playerId in: path required: true schema: type: string - name: key in: path required: true schema: type: string responses: '204': description: Item deleted '404': description: Item not found components: schemas: PlayerDataList: type: object properties: results: type: array items: $ref: '#/components/schemas/DataItem' links: type: object properties: next: type: string DataItem: type: object properties: key: type: string description: Data key (up to 255 characters) value: description: Data value (any JSON-serializable value) writeLock: type: string description: Optimistic concurrency lock token created: type: string format: date-time modified: type: string format: date-time SetPlayerDataRequest: type: object required: - data properties: data: type: array items: type: object required: - key - value properties: key: type: string value: {} writeLock: type: string securitySchemes: apiKeyAuth: type: apiKey in: header name: x-api-key externalDocs: description: Unity Analytics Documentation url: https://docs.unity.com/ugs/en-us/manual/analytics/manual/rest-api