> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Conversation Events

> Count local events matching the given filters



## OpenAPI

````yaml /openapi/agent-sdk.json get /api/conversations/{conversation_id}/events/count
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/conversations/{conversation_id}/events/count:
    get:
      tags:
        - Events
      summary: Count Conversation Events
      description: Count local events matching the given filters
      operationId: >-
        count_conversation_events_api_conversations__conversation_id__events_count_get
      parameters:
        - in: path
          name: conversation_id
          required: true
          schema:
            format: uuid
            title: Conversation Id
            type: string
        - in: query
          name: kind
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: >-
              Optional filter by event kind/type (e.g., ActionEvent,
              MessageEvent)
        - in: query
          name: source
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Optional filter by event source (e.g., agent, user, environment)
        - in: query
          name: body
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Optional filter by message content (case-insensitive)
        - in: query
          name: timestamp__gte
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: 'Filter: event timestamp >= this datetime'
        - in: query
          name: timestamp__lt
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: 'Filter: event timestamp < this datetime'
      responses:
        '200':
          content:
            application/json:
              schema:
                title: >-
                  Response Count Conversation Events Api Conversations 
                  Conversation Id  Events Count Get
                type: integer
          description: Successful Response
        '404':
          description: Conversation not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.