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

# Search session rows for a tracker with filter conditions



## OpenAPI

````yaml /api-reference/openapi.json post /v1/trackers/{tracker_code}/sessions
openapi: 3.1.0
info:
  title: Leadinfo Data API
  version: 0.1.0
  x-logo:
    url: https://asset.leadinfo.com/assets/email_logo.png
servers:
  - url: https://data.leadinfo.com
    description: Production
security: []
paths:
  /v1/trackers/{tracker_code}/sessions:
    post:
      tags:
        - traffic
      summary: Search session rows for a tracker with filter conditions
      operationId: search_sessions_for_tracker_v1_trackers__tracker_code__sessions_post
      parameters:
        - name: tracker_code
          in: path
          required: true
          schema:
            type: string
            title: Tracker Code
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionsSearchBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Paginated_SessionOut_'
        '401':
          description: Invalid credentials.
        '403':
          description: Tracker not owned by this client.
        '422':
          description: Invalid filter/query parameters.
      security:
        - HTTPBearer: []
components:
  schemas:
    SessionsSearchBody:
      properties:
        start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Start Date
          description: >-
            Inclusive start of the window. Defaults to end_date, so omitting
            both dates returns today. Widen explicitly for multi-day analytics
            and expect higher latency on long ranges with high-traffic trackers.
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
          description: Inclusive end of the window. Defaults to today.
        offset:
          type: integer
          maximum: 100000
          minimum: 0
          title: Offset
          description: Rows to skip; use meta.next_offset for the next page.
          default: 0
        domain_filter:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain Filter
        limit:
          type: integer
          maximum: 1000
          minimum: 1
          title: Limit
          default: 100
        include_total:
          type: boolean
          title: Include Total
          default: false
        filters:
          items:
            $ref: '#/components/schemas/SessionFilterRule'
          type: array
          title: Filters
      type: object
      title: SessionsSearchBody
    Paginated_SessionOut_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SessionOut'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/PageMeta'
      type: object
      required:
        - data
        - meta
      title: Paginated[SessionOut]
    SessionFilterRule:
      properties:
        field:
          type: string
          enum:
            - source
            - medium
            - campaign
            - term
            - content
            - referrer_host
            - click_provider
            - duration
            - pages
          title: Field
        operator:
          type: string
          enum:
            - equals
            - not_equals
            - contains
            - in
            - greater_than
            - less_than
            - is_known
            - is_unknown
          title: Operator
        value:
          anyOf:
            - {}
            - type: 'null'
          title: Value
      type: object
      required:
        - field
        - operator
      title: SessionFilterRule
    SessionOut:
      properties:
        event_date:
          type: string
          format: date
          title: Event Date
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
        company_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Company Id
        company_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Company Name
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        medium:
          anyOf:
            - type: string
            - type: 'null'
          title: Medium
        campaign:
          anyOf:
            - type: string
            - type: 'null'
          title: Campaign
        term:
          anyOf:
            - type: string
            - type: 'null'
          title: Term
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
        click_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Click Id
        click_provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Click Provider
        referrer_host:
          anyOf:
            - type: string
            - type: 'null'
          title: Referrer Host
        duration:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration
        pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Pages
        landing_page:
          anyOf:
            - type: string
            - type: 'null'
          title: Landing Page
          description: Path of the session's first page view (its landing page).
      type: object
      required:
        - event_date
      title: SessionOut
    PageMeta:
      properties:
        total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total
        has_more:
          type: boolean
          title: Has More
        returned:
          type: integer
          title: Returned
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
        offset:
          type: integer
          title: Offset
          default: 0
        next_offset:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Offset
          description: The offset of the next page; null on the last page.
      type: object
      required:
        - has_more
        - returned
      title: PageMeta
      description: |-
        Paging of a list: every list endpoint returns at most `limit` rows from
        `offset`; while `has_more` is true, ask again with `offset=next_offset`.
        `total` is opt-in via `include_total=true` since it costs an extra COUNT
        query.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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