> ## 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 an event

> Submit an event for processing. Events are queued asynchronously and processed by the rules engine.



## OpenAPI

````yaml /api-reference/openapi.json post /events
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:
    post:
      tags:
        - Events
      summary: Track an event
      description: >-
        Submit an event for processing. Events are queued asynchronously and
        processed by the rules engine.
      operationId: EventsController_trackEvent
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrackEventDto'
      responses:
        '202':
          description: Event accepted and queued for processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackEventResponseDto'
        '400':
          description: Invalid request data
        '401':
          description: Invalid or missing API key
        '404':
          description: Project not found or not active
      security:
        - api-key: []
components:
  schemas:
    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

````