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

# Get Account Positions

> This endpoint retrieves the account positions by market.



## OpenAPI

````yaml GET /api/v1/positions
openapi: 3.1.0
info:
  title: User Account API
  version: 1.0.0
servers:
  - url: https://user-account.sandbox.rails.xyz
security: []
paths:
  /api/v1/positions:
    get:
      summary: Get Account Positions
      operationId: getAccountPositions
      parameters:
        - $ref: '#/components/parameters/market'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/positionsResponse'
              example:
                positions:
                  - market: ETH-USDT
                    value: '3772.272138'
                    quantity: '1.0'
                    funding: '92.49110924999998'
                    realizedPnl: '0.1'
                    unrealizedPnl: '-33.25166999999965'
                    liquidationPrice: '3500.652918'
                    type: LONG
                    notionalValue: '3739.020468'
                    marginMode: C
                  - market: BTC-USDT
                    value: '-65000.272138'
                    quantity: '-1.0'
                    funding: '920.49110924999998'
                    realizedPnl: '1.5'
                    unrealizedPnl: '400.25166999999965'
                    liquidationPrice: '61033.135417'
                    type: SHORT
                    notionalValue: '-65400.523808'
                    marginMode: I
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - bearerAuth: []
components:
  parameters:
    market:
      name: market
      in: query
      description: >-
        Market name. Example value: `ETH-USDT`. To get all supported markets,
        call [/api/v1/markets](/latest/perps/rest-api/get-supported-markets)
        endpoint. Omit this parameter to get results across all markets.
      required: false
      schema:
        type: string
  schemas:
    positionsResponse:
      type: object
      properties:
        positions:
          type: array
          description: List of positions for the account.
          items:
            type: object
            properties:
              market:
                type: string
                description: >-
                  Market name. Example value: `ETH-USDT`. To get all supported
                  markets, call
                  [/api/v1/markets](/latest/perps/rest-api/get-supported-markets)
                  endpoint.
              value:
                type: string
                description: Value of the position.
              quantity:
                type: string
                description: Quantity of the position.
              funding:
                type: string
                description: Funding fee for the position.
              realizedPnl:
                type: string
                description: Realized PnL for the position.
              unrealizedPnl:
                type: string
                description: Unrealized PnL for the position.
              liquidationPrice:
                type: string
                description: Liquidation price for the position.
              type:
                type: string
                enum:
                  - LONG
                  - SHORT
                description: Type of the position.
              notionalValue:
                type: string
                description: Notional value of the position.
              marginMode:
                type: string
                enum:
                  - C
                  - I
                description: >-
                  Margin mode for the position. `C` for cross margin, `I` for
                  isolated margin.
            required:
              - market
              - value
              - quantity
              - funding
              - realizedPnl
              - unrealizedPnl
              - liquidationPrice
              - type
              - notionalValue
              - marginMode
      required:
        - positions
  responses:
    Unauthorized:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: A human-readable message describing the error.
            required:
              - message
          example:
            message: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````