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

# Get event logs with filters and pagination

> Paginated list of EventLog records, with optional filters (`organizationId`, `userId`, `contactId`, `direction`, `automationTriggered`) and a `days` lookback window. Powers the audit/event-log surface; non-SUPERADMIN callers are pinned to their own org.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/event-logs
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/event-logs:
    get:
      tags:
        - Event Logs
      summary: Get event logs with filters and pagination
      description: >-
        Paginated list of EventLog records, with optional filters
        (`organizationId`, `userId`, `contactId`, `direction`,
        `automationTriggered`) and a `days` lookback window. Powers the
        audit/event-log surface; non-SUPERADMIN callers are pinned to their own
        org.
      operationId: get_event_logs
      parameters:
        - in: query
          name: page
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: limit
          required: false
          schema:
            type: integer
            minimum: 1
            default: 50
        - in: query
          name: organizationId
          required: false
          schema:
            type: string
        - in: query
          name: userId
          required: false
          schema:
            type: string
        - in: query
          name: contactId
          required: false
          schema:
            type: string
        - in: query
          name: direction
          required: false
          schema:
            type: string
        - in: query
          name: automationTriggered
          required: false
          schema:
            type: string
        - in: query
          name: days
          required: false
          schema:
            type: number
            default: 7
      responses:
        '200':
          description: Event logs returned with pagination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventLogListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventLogErrorResponse'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventLogErrorResponse'
        '500':
          description: Error fetching event logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventLogErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    EventLogListResponse:
      type: object
      description: Response from `GET /api/event-logs`.
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: array
          items:
            $ref: '#/components/schemas/EventLogDto'
        pagination:
          $ref: '#/components/schemas/EventLogPagination'
      required:
        - success
        - data
        - pagination
      additionalProperties: true
      example:
        success: true
        data:
          - _id: 65e0a0b0c0d0e0f0a0b0c0d0
            organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
            userId: 65b1f0a2c3d4e5f6a7b8c9d0
            eventType: message.received
            direction: inbound
            automationTriggered: true
            createdAt: '2026-05-18T14:30:00.000Z'
        pagination:
          currentPage: 1
          totalPages: 7
          totalCount: 312
          hasNext: true
          hasPrev: false
    EventLogErrorResponse:
      type: object
      description: Error envelope returned by event-log endpoints.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
      required:
        - success
        - message
      additionalProperties: true
      example:
        success: false
        message: Event log not found
        error: NOT_FOUND
    EventLogDto:
      type: object
      description: >-
        A persisted EventLog record. Most fields come straight from the EventLog
        model; `contactFirstName`/`contactLastName` are joined in by the
        controller for the list view.
      properties:
        _id:
          type: string
        organizationId:
          type: string
        userId:
          type: string
        contactId:
          type: string
          nullable: true
        conversationId:
          type: string
          nullable: true
        direction:
          type: string
          description: Direction or category of the logged event (e.g. inbound/outbound).
        automationTriggered:
          type: boolean
        eventType:
          type: string
        payload:
          type: object
          additionalProperties: true
          description: Raw event payload — shape varies by event type.
        contactFirstName:
          type: string
          nullable: true
          description: Joined-in contact first name (list view only).
        contactLastName:
          type: string
          nullable: true
          description: Joined-in contact last name (list view only).
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 65e0a0b0c0d0e0f0a0b0c0d0
        organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
        userId: 65b1f0a2c3d4e5f6a7b8c9d0
        contactId: 65c2d0e0f0a0b0c0d0e0f0a0
        conversationId: 65d3e0f0a0b0c0d0e0f0a0b0
        direction: inbound
        automationTriggered: true
        eventType: message.received
        payload:
          channelType: sms
          body: Yes please!
        contactFirstName: Jane
        contactLastName: Doe
        createdAt: '2026-05-18T14:30:00.000Z'
        updatedAt: '2026-05-18T14:30:00.000Z'
    EventLogPagination:
      type: object
      properties:
        currentPage:
          type: integer
        totalPages:
          type: integer
        totalCount:
          type: integer
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
      required:
        - currentPage
        - totalPages
        - totalCount
        - hasNext
        - hasPrev
      additionalProperties: true
      example:
        currentPage: 1
        totalPages: 7
        totalCount: 312
        hasNext: true
        hasPrev: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````