> ## Documentation Index
> Fetch the complete documentation index at: https://docs.engagefabric.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Track multiple events in a batch

> Submit multiple events for processing in a single request. Useful for offline sync or bulk imports.



## OpenAPI

````yaml /api-reference/openapi.json post /events/batch
openapi: 3.0.0
info:
  title: EngageFabric API
  description: >-
    EngageFabric is a multi-tenant SaaS gamification framework. This API
    provides endpoints for managing players, tracking events, quests,
    adventures, leaderboards, lobbies, and real-time features.
  version: 1.0.0
  contact:
    name: EngageFabric Support
    url: https://engagefabric.com
    email: support@engagefabric.com
  license:
    name: Proprietary
    url: https://engagefabric.com/terms
servers:
  - url: https://api.engagefabric.com
    description: Production
  - url: http://localhost:3000
    description: Development
security: []
tags:
  - name: auth
    description: Authentication endpoints
  - name: tenants
    description: Tenant management
  - name: projects
    description: Project management
  - name: players
    description: Player management and game state
  - name: events
    description: Event ingestion and tracking
  - name: quests
    description: Quest management and progress
  - name: adventures
    description: Adventure/season management
  - name: leaderboards
    description: Leaderboard rankings
  - name: lobbies
    description: Multiplayer lobby management
  - name: chat
    description: Real-time chat
  - name: rules
    description: Rules engine configuration
paths:
  /events/batch:
    post:
      tags:
        - Events
      summary: Track multiple events in a batch
      description: >-
        Submit multiple events for processing in a single request. Useful for
        offline sync or bulk imports.
      operationId: EventsController_trackEventBatch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrackEventBatchDto'
      responses:
        '202':
          description: Batch accepted for processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackEventBatchResponseDto'
        '400':
          description: Invalid request data
        '401':
          description: Invalid or missing API key
      security:
        - api-key: []
components:
  schemas:
    TrackEventBatchDto:
      type: object
      properties:
        events:
          description: Array of events to track
          type: array
          items:
            $ref: '#/components/schemas/TrackEventDto'
      required:
        - events
    TrackEventBatchResponseDto:
      type: object
      properties:
        accepted:
          type: number
          description: Number of events accepted
          example: 10
        rejected:
          type: number
          description: Number of events rejected
          example: 2
        skipped:
          type: number
          description: Number of events skipped (duplicates)
          example: 1
        results:
          description: Results for each event
          type: array
          items:
            $ref: '#/components/schemas/TrackEventResponseDto'
      required:
        - accepted
        - rejected
        - skipped
        - results
    TrackEventDto:
      type: object
      properties:
        projectId:
          type: string
          description: Project ID
          example: 123e4567-e89b-12d3-a456-426614174000
        externalUserId:
          type: string
          description: External user ID from client system
          example: user_12345
        eventType:
          type: string
          description: Event type
          example: lesson_completed
        properties:
          type: object
          description: Event properties
          example:
            lessonId: math-101
            score: 95
            duration: 300
        timestamp:
          type: string
          description: Event timestamp (ISO 8601)
          example: '2025-11-17T10:30:00Z'
        idempotencyKey:
          type: string
          description: Idempotency key for preventing duplicate processing
          example: evt_user12345_lesson_20251117_103000
      required:
        - projectId
        - externalUserId
        - eventType
    TrackEventResponseDto:
      type: object
      properties:
        eventId:
          type: string
          description: Event ID
          example: 123e4567-e89b-12d3-a456-426614174000
        status:
          type: string
          description: Processing status
          example: PENDING
          enum:
            - PENDING
            - PROCESSING
            - PROCESSED
            - FAILED
            - SKIPPED
        skipped:
          type: boolean
          description: Whether event was skipped due to idempotency
          example: false
        message:
          type: string
          description: Message
          example: Event queued for processing
        existingEventId:
          type: string
          description: Existing event ID if duplicate
      required:
        - eventId
        - status
        - skipped
        - message

````