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

# Read historical Long/Short exposure

> Executed Futures position counts, including periods before positions closed.

`read` is required for one authorized exact link without instrument restrictions.
First read the analytics snapshot and copy its `membership_revision` and
`direction_revision` as `revision`. Supply the same scope and selected pair.

Each page contains at most 2,000 chronological observations within the rolling
year. Follow the exclusive `before` until zero, only as far as the review needs.
Reuse the same revision tokens; a stale revision requires a fresh snapshot and
restart of the needed history. Never merge pages from different revisions.

Closed positions count while they had positive executed Futures exposure. Spot
and unfilled positions are excluded. Unknown evidence and a zero/zero ratio
remain unavailable; they are not zero exposure or a zero ratio.

See [Account analytics](/api/templates-and-history#account-analytics).


## OpenAPI

````yaml api/openapi.json GET /v1/dashboard/long-short/history
openapi: 3.1.0
info:
  title: Liftx integrations
  version: 1.0.0
  description: >-
    The Liftx API, TradingView webhook and session-owned integration settings.
    External access requires Pro or trial entitlement and is unmetered within
    bounded resource limits. Receipt acceptance does not confirm execution
    completion. MCP uses personal OAuth access and the same trading permissions
    and command receipts.
servers:
  - url: https://api.liftx.io
security: []
paths:
  /v1/dashboard/long-short/history:
    get:
      summary: Get Long/Short exposure history
      description: >-
        Read up to 2,000 observations in the rolling one-year history window.
        Closed positions count while they had positive executed Futures
        exposure; Spot and unfilled positions are excluded. First call
        liftx_analytics_get_long_short_snapshot for the same scope/pair; copy
        membership_revision unchanged and direction_revision as revision. Page
        backward using before and the same tokens. A stale revision fails with
        retryable unavailability: obtain a fresh snapshot and restart the needed
        history; never mix revisions or poll continuously. Undefined counts and
        zero-denominator ratios are not zero exposure or a zero ratio. Requires
        read permission for one authorized exact link with unrestricted
        instrument access. No account-wide or instrument-policy bypass; no
        trading action.
      operationId: get_v1_dashboard_long_short_history
      parameters:
        - name: exchange_link_id
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 9007199254740991
        - name: environment
          in: query
          required: true
          schema:
            type: string
            enum:
              - live
              - demo
        - name: pair_id
          in: query
          required: false
          schema:
            type: string
            maxLength: 64
            description: >-
              Opaque reporting pair_id from liftx_analytics_list_assets; omit
              for All Assets. Not an executable instrument_id.
            pattern: ^([a-f0-9]{64})?$
        - name: membership_revision
          in: query
          required: true
          schema:
            type: string
            maxLength: 128
            minLength: 1
        - name: revision
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 160
            description: >-
              Copy direction_revision from the analytics snapshot, not its
              revision field.
        - name: before
          in: query
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LongShortHistory'
        default:
          description: >-
            Integration errors use Error; existing trading handlers retain their
            own JSON or text/plain error codec. Inspect status and content type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            text/plain:
              schema:
                type: string
      security:
        - ApiKey: []
components:
  schemas:
    LongShortHistory:
      type: object
      properties:
        scope:
          $ref: '#/components/schemas/AnalyticsScope'
        pair_id:
          type: string
        state:
          type: string
          enum:
            - ready
            - loading
            - updating
            - unavailable
        revision:
          type: string
        membership_revision:
          type: string
        as_of:
          type: integer
          format: int64
        before:
          type: integer
          format: int64
          minimum: 0
        points:
          type: array
          items:
            $ref: '#/components/schemas/LongShortHistoryPoint'
          maxItems: 2000
      required:
        - scope
        - pair_id
        - state
        - revision
        - membership_revision
        - as_of
        - before
        - points
      additionalProperties: false
      description: >-
        Chronological executed-exposure observations, including positions that
        later closed. before=0 exhausts the rolling one-year window; otherwise
        copy the exclusive boundary to page backward under the same membership
        and direction revision. Incomplete evidence never establishes flat
        exposure.
    Error:
      type: object
      properties:
        success:
          const: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          additionalProperties: false
      required:
        - success
        - error
      additionalProperties: false
    AnalyticsScope:
      type: object
      properties:
        exchange_link_id:
          type: integer
          format: int64
          minimum: 0
          maximum: 9007199254740991
        environment:
          type: string
          enum:
            - live
            - demo
      required:
        - exchange_link_id
        - environment
      additionalProperties: false
    LongShortHistoryPoint:
      type: object
      properties:
        time:
          type: integer
          format: int64
        longs:
          anyOf:
            - type: integer
              format: int64
              minimum: 0
              maximum: 9007199254740991
            - type: 'null'
        shorts:
          anyOf:
            - type: integer
              format: int64
              minimum: 0
              maximum: 9007199254740991
            - type: 'null'
        complete:
          type: boolean
        resolution:
          type: integer
          format: int64
          enum:
            - 1
      required:
        - time
        - longs
        - shorts
        - complete
        - resolution
      additionalProperties: false
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: lx_api_<credential UUID>.<256-bit secret>

````

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