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

# Set conversation events

> Attach an event log snapshot to the conversation — the same events
`Gleap.trackEvent()` buffers in the SDK flow and attaches when a
conversation is created. Scoped to this conversation only (not the
contact), so events from other sessions never mix in. Shown to agents in
the conversation's "Logs" panel. Each call replaces the previous snapshot
(max 500 events, 2 MB). Not delivered via webhooks or the stream.
For contact-level events that drive outbound rules, use
`POST /contacts/{userId}/events` instead.



## OpenAPI

````yaml https://api.gleap.io/api-docs.json put /s2s/conversations/{conversationId}/events
openapi: 3.0.0
info:
  title: gleap-server
  version: 14.0.0
  contact: {}
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /s2s/conversations/{conversationId}/events:
    put:
      tags:
        - S2S Conversations
      summary: Set conversation events
      description: >-
        Attach an event log snapshot to the conversation — the same events

        `Gleap.trackEvent()` buffers in the SDK flow and attaches when a

        conversation is created. Scoped to this conversation only (not the

        contact), so events from other sessions never mix in. Shown to agents in

        the conversation's "Logs" panel. Each call replaces the previous
        snapshot

        (max 500 events, 2 MB). Not delivered via webhooks or the stream.

        For contact-level events that drive outbound rules, use

        `POST /contacts/{userId}/events` instead.
      operationId: SetEvents
      parameters:
        - in: path
          name: conversationId
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/S2SPutConversationEventsBody'
      responses:
        '204':
          description: No Content
      security:
        - s2s: []
components:
  schemas:
    S2SPutConversationEventsBody:
      properties:
        events:
          items:
            $ref: '#/components/schemas/S2SConversationEventInput'
          type: array
          description: >-
            Snapshot of the events that led up to this conversation (max 500
            entries, 2 MB). Replaces any previous snapshot for this
            conversation.
      required:
        - events
      type: object
      additionalProperties: false
    S2SConversationEventInput:
      properties:
        name:
          type: string
          description: Event name, e.g. "screen_opened" or "pageView".
        date:
          type: string
          description: ISO timestamp of when the event happened; defaults to now.
        data:
          description: Arbitrary event payload (flat key→value object).
      required:
        - name
      type: object
      additionalProperties: false
  securitySchemes:
    s2s:
      type: http
      scheme: bearer
      bearerFormat: Service account token (JWT)

````