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

# List Interactions

> List interactions metadata (optimized for table display).

This endpoint returns only metadata for interactions to improve performance.
Use /interaction/{interaction_id} to get full interaction details.

Parameters:
- api_name: Name of the API (optional).
- page: Page number for pagination (default: 1).
- limit: Maximum number of interactions per page (default: 50).
- sort_by: Field to sort interactions by (optional).
- sort_order: Sorting order ('asc' or 'desc') (default: 'asc').
- filters: Additional filters for querying interactions (optional).
- current_user: Current user for authentication (required for admin role).

Returns:
- List of interaction metadata (without large response data).

Raises:
- HTTPException(401): If the user is not authorized.



## OpenAPI

````yaml post /api/interaction/list
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/interaction/list:
    post:
      tags:
        - Interaction
      summary: List Interactions
      description: >-
        List interactions metadata (optimized for table display).


        This endpoint returns only metadata for interactions to improve
        performance.

        Use /interaction/{interaction_id} to get full interaction details.


        Parameters:

        - api_name: Name of the API (optional).

        - page: Page number for pagination (default: 1).

        - limit: Maximum number of interactions per page (default: 50).

        - sort_by: Field to sort interactions by (optional).

        - sort_order: Sorting order ('asc' or 'desc') (default: 'asc').

        - filters: Additional filters for querying interactions (optional).

        - current_user: Current user for authentication (required for admin
        role).


        Returns:

        - List of interaction metadata (without large response data).


        Raises:

        - HTTPException(401): If the user is not authorized.
      operationId: list_interactions
      parameters:
        - name: api_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Api Name
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
            title: Page
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            title: Limit
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Sort By
        - name: sort_order
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: asc
            title: Sort Order
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - additionalProperties: true
                  type: object
                - type: 'null'
              title: Filters
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InteractionCountResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    InteractionCountResponse:
      properties:
        interactions:
          items:
            $ref: '#/components/schemas/InteractionMetadata'
          type: array
          title: Interactions
          description: List of interaction metadata.
        count:
          type: integer
          title: Count
          description: Total number of interactions matching the query.
      type: object
      required:
        - interactions
        - count
      title: InteractionCountResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InteractionMetadata:
      properties:
        _id:
          type: string
          title: Id
          description: Unique identifier for the interaction.
        user_id:
          type: string
          title: User Id
          description: User ID who created the interaction.
        api_name:
          type: string
          title: Api Name
          description: Name of the API.
        api_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Title
          description: Title of the API.
        user_input:
          type: string
          title: User Input
          description: User input text.
        created_at:
          type: string
          title: Created At
          description: Creation timestamp.
        duration:
          type: number
          title: Duration
          description: Duration of the interaction in seconds.
        status_code:
          type: integer
          title: Status Code
          description: HTTP status code of the response.
        response_size:
          type: integer
          title: Response Size
          description: Size of the response content in bytes.
      type: object
      required:
        - _id
        - user_id
        - api_name
        - user_input
        - created_at
        - duration
        - status_code
        - response_size
      title: InteractionMetadata
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````