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

# Send Events

> Record customer actions with metadata to power rewards and engagement.

Send events to capture customer actions. Each event has a name (for example, `place_order`) and optional metadata.

<Info>
  Security: Provide `apikey` header.
</Info>

<Info>
  **Automatic Customer Creation**: If the customer specified by `customerId` doesn't exist in Gameball, a new customer profile will be automatically created when using this API. You don't need to create the customer separately before sending events.
</Info>


## OpenAPI

````yaml POST /api/v4.0/integrations/events
openapi: 3.1.0
info:
  title: Gameball API
  description: >-
    Gameball REST API v4.0 - Complete API reference for integrating loyalty,
    gamification, and customer engagement features
  version: 4.0.0
servers:
  - url: https://api.gameball.co
security:
  - bearerAuth: []
paths:
  /api/v4.0/integrations/events:
    post:
      summary: Send Events
      description: >-
        Send events to capture customer actions, enabling targeted rewards and
        engagement.
      operationId: sendEvents
      requestBody:
        description: >-
          Event payload containing the customerId and one or more events with
          metadata.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventRequest'
            examples:
              sample:
                summary: Sample request
                value:
                  customerId: '1848877205'
                  events:
                    write_review:
                      product_id: '1653503260'
                      review: 5 Stars Product
      responses:
        '200':
          description: Events accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              examples:
                accepted:
                  value:
                    success: true
                    message: Events processed
      security:
        - apiKey: []
components:
  schemas:
    EventRequest:
      type: object
      required:
        - customerId
        - events
      properties:
        customerId:
          type: string
          description: Unique identifier for the customer
        events:
          type: object
          description: A mapping of event names to metadata objects
          additionalProperties:
            type: object
            additionalProperties: true
    Success:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: apikey

````