Phemex Positions API

The Positions API from Phemex — 6 operation(s) for positions.

Operations 6

PUT /positions/leverage Set leverage #
PUT /positions/riskLimit Set risk limit #
POST /positions/assign Assign margin #
PUT /g-positions/switch-pos-mode-sync Switch position mode #
PUT /g-positions/leverage Set hedged leverage #
POST /g-positions/assign Assign balance to position #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/phemex-positions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

phemex-positions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Phemex Contract Trading Account Positions API
  description: REST API for trading perpetual contracts on Phemex, including order placement, position management, account queries, and market data.
  version: 1.0.0
  contact:
    name: Phemex Support
    url: https://phemex.com/help-center
servers:
- url: https://api.phemex.com
  description: Production
- url: https://testnet-api.phemex.com
  description: Testnet
security:
- HmacAuth: []
tags:
- name: Positions
paths:
  /positions/leverage:
    put:
      summary: Set leverage
      description: Modify position leverage for a symbol.
      operationId: setContractLeverage
      tags:
      - Positions
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: leverage
        in: query
        schema:
          type: number
      - name: leverageEr
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Leverage set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /positions/riskLimit:
    put:
      summary: Set risk limit
      description: Adjust position risk limit.
      operationId: setContractRiskLimit
      tags:
      - Positions
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: riskLimit
        in: query
        schema:
          type: integer
      - name: riskLimitEv
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Risk limit set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /positions/assign:
    post:
      summary: Assign margin
      description: Allocate balance to isolated margin position.
      operationId: assignContractMargin
      tags:
      - Positions
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: posBalanceEv
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Margin assigned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /g-positions/switch-pos-mode-sync:
    put:
      summary: Switch position mode
      description: Switch between OneWay and Hedged position modes.
      operationId: switchPositionMode
      tags:
      - Positions
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: targetPosMode
        in: query
        required: true
        schema:
          type: string
          enum:
          - OneWay
          - Hedged
      responses:
        '200':
          description: Mode switched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /g-positions/leverage:
    put:
      summary: Set hedged leverage
      description: Set leverage for hedged positions — supports separate long/short leverage.
      operationId: setHedgedLeverage
      tags:
      - Positions
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: leverageRr
        in: query
        schema:
          type: string
        description: Leverage for one-way mode
      - name: longLeverageRr
        in: query
        schema:
          type: string
        description: Leverage for long positions
      - name: shortLeverageRr
        in: query
        schema:
          type: string
        description: Leverage for short positions
      responses:
        '200':
          description: Leverage set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /g-positions/assign:
    post:
      summary: Assign balance to position
      description: Assign balance to a specific hedged position side.
      operationId: assignHedgedMargin
      tags:
      - Positions
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: posSide
        in: query
        required: true
        schema:
          type: string
          enum:
          - Long
          - Short
      - name: posBalanceRv
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Balance assigned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: object
  securitySchemes:
    HmacAuth:
      type: apiKey
      in: header
      name: x-phemex-access-token
      description: HMAC SHA256 signed request. Also requires x-phemex-request-expiry and x-phemex-request-signature headers.