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

# List Prospect Events

> List engagement events for a prospect, newest-first.

Required filter is ``(prospect_identifier, prospect_identifier_type)``;
that pair is part of the supporting index ``idx_engagement_log_user_prospect``
(migration 147) on ``(user_id, prospect_identifier_type,
prospect_identifier, occurred_at DESC)`` so the seek to the first
page is index-driven even when the user has millions of unrelated
rows. The index does NOT include ``id``, so the ORDER BY tie-break
on ``id DESC`` falls through to a small in-page sort. That's fine
in practice: rows sharing a single microsecond ``occurred_at`` are
rare (only happens when a webhook handler fans out events inside
one transaction), and the tie-break scan is bounded by the page
size (``limit + 1``).



## OpenAPI

````yaml https://api.bavlio.com/openapi.json get /api/v1/engagement-log/prospect/{prospect_identifier}
openapi: 3.1.0
info:
  title: Bavlio API
  description: >-
    Outreach automation API — lead enrichment, email campaigns, LinkedIn
    automation, and AI agent. Full docs at https://docs.bavlio.com.
  version: 1.0.0
  x-guidance:
    product: Bavlio Data API
    protocols:
      - x402
    description: >-
      Pay-per-call B2B data endpoints for AI agents. USDC on Base mainnet via
      x402 v2. See /openapi.json for pricing. Landing page + marketing details:
      https://bavlio.com/developers
    network: eip155:8453
    docs_url: https://docs.bavlio.com
  x-payment-merchant-address: '0xcca4725e0e931982830bff523b141e1a7a58d3e7'
servers: []
security: []
tags:
  - name: API Keys
    description: >-
      Create, list, and revoke API keys for programmatic access. JWT
      authentication required.
  - name: credits
    description: Credit balance, cost estimates, and transaction history.
  - name: campaigns
    description: Create, manage, launch, and monitor email campaigns.
  - name: campaign-personalization
    description: AI-powered email subject and body personalization for campaigns.
  - name: email-finder
    description: Find and verify email addresses for prospects.
  - name: sender-profiles
    description: Manage sender identity profiles for outreach.
  - name: sender-profile-chat
    description: Interactive chat for building sender profiles.
  - name: templates
    description: Email template CRUD.
  - name: suppression
    description: Do-not-contact suppression list management.
  - name: datasets
    description: Lead dataset listing, download, and updates.
  - name: user-extractions
    description: Uploaded lead file management and processing.
  - name: enrichment-chat
    description: Interactive chat for data enrichment sessions.
  - name: enrichment-processing
    description: Batch lead enrichment processing.
  - name: File Upload (CSV/Excel)
    description: Upload and preview CSV/Excel lead files.
  - name: connected-accounts
    description: LinkedIn account connections via Unipile.
  - name: linkedin-content
    description: LinkedIn post creation, scheduling, and management.
  - name: linkedin-playground
    description: Direct LinkedIn actions (profile lookup, messaging, engagement).
  - name: bavimail-proxy
    description: BaviMail domain, alias, and email management.
  - name: agent
    description: Bavi AI agent chat with SSE streaming.
  - name: notifications
    description: Notification preferences and delivery.
  - name: referral
    description: Referral code management and stats.
  - name: feedback
    description: User feedback submission.
  - name: authentication
    description: JWT token verification and user info.
  - name: users
    description: User quota and usage information.
  - name: Health
    description: Health checks and system status.
  - name: Personalization
    description: Core lead personalization engine.
  - name: Session Management
    description: Enrichment session lifecycle.
  - name: Session Processing
    description: Session data processing.
  - name: webhooks
    description: Inbound webhook handlers (Stripe, BaviMail, Unipile).
paths:
  /api/v1/engagement-log/prospect/{prospect_identifier}:
    get:
      tags:
        - engagement_log
      summary: List Prospect Events
      description: >-
        List engagement events for a prospect, newest-first.


        Required filter is ``(prospect_identifier, prospect_identifier_type)``;

        that pair is part of the supporting index
        ``idx_engagement_log_user_prospect``

        (migration 147) on ``(user_id, prospect_identifier_type,

        prospect_identifier, occurred_at DESC)`` so the seek to the first

        page is index-driven even when the user has millions of unrelated

        rows. The index does NOT include ``id``, so the ORDER BY tie-break

        on ``id DESC`` falls through to a small in-page sort. That's fine

        in practice: rows sharing a single microsecond ``occurred_at`` are

        rare (only happens when a webhook handler fans out events inside

        one transaction), and the tie-break scan is bounded by the page

        size (``limit + 1``).
      operationId: >-
        list_prospect_events_api_v1_engagement_log_prospect__prospect_identifier__get
      parameters:
        - name: prospect_identifier
          in: path
          required: true
          schema:
            type: string
            title: Prospect Identifier
        - name: type
          in: query
          required: false
          schema:
            type: string
            description: Prospect identifier type
            default: email
            title: Type
          description: Prospect identifier type
        - name: event_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by event_type
            title: Event Type
          description: Filter by event_type
        - name: channel
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by channel
            title: Channel
          description: Filter by channel
        - name: campaign_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Filter by campaign
            title: Campaign Id
          description: Filter by campaign
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Opaque pagination cursor
            title: Cursor
          description: Opaque pagination cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EngagementListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    EngagementListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EngagementEvent'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - items
      title: EngagementListResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EngagementEvent:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          type: string
          format: uuid
          title: User Id
        prospect_identifier:
          type: string
          title: Prospect Identifier
        prospect_identifier_type:
          type: string
          enum:
            - email
            - linkedin_provider_id
            - prospect_uuid
          title: Prospect Identifier Type
        channel:
          type: string
          enum:
            - email
            - linkedin
          title: Channel
        event_type:
          type: string
          enum:
            - sent
            - received
            - classified
            - state_transition
            - suppressed
            - cross_channel_engagement_detected
          title: Event Type
        campaign_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Campaign Id
        campaign_lead_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Campaign Lead Id
        classification_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Classification Id
        raw_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Raw Event Id
        payload_summary:
          additionalProperties: true
          type: object
          title: Payload Summary
        occurred_at:
          type: string
          title: Occurred At
        created_at:
          type: string
          title: Created At
      type: object
      required:
        - id
        - user_id
        - prospect_identifier
        - prospect_identifier_type
        - channel
        - event_type
        - occurred_at
        - created_at
      title: EngagementEvent
      description: Projection of an ``engagement_log`` row for read API consumers.
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````

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