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

# Set margin mode for a market

> Switch a market between `cross` and `isolated` margin; read the current value via `GET /exchange/market-settings`.



## OpenAPI

````yaml https://vooi-api-app.fly.dev/swagger/json post /exchange/margin-mode
openapi: 3.1.0
info:
  title: VOOI API
  description: Unified perps API
  version: '1.0'
  contact: {}
servers:
  - url: https://perps-api.vooi.io
security: []
tags: []
paths:
  /exchange/margin-mode:
    post:
      tags:
        - Exchange
      summary: Set margin mode for a market
      description: >-
        Switch a market between `cross` and `isolated` margin; read the current
        value via `GET /exchange/market-settings`.
      operationId: ExchangeController_setMarginMode
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetMarginModeBodyDto'
      responses:
        '201':
          description: ''
        '503':
          description: ExchangeApiError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDTO'
      security:
        - bearer: []
components:
  schemas:
    SetMarginModeBodyDto:
      type: object
      properties:
        asset:
          type: string
          minLength: 1
          description: >-
            Asset identifier: base symbol (e.g. "ETH") or full pair (e.g.
            "ETHUSDC").
          example: ETH
        exchange:
          type: string
          enum:
            - aster
            - binance
            - bybit
            - extended
            - gate
            - hyperliquid
            - lighter
            - mexc
            - ondo
            - robinhood
          description: Supported perpetual exchange
        marginMode:
          type: string
          enum:
            - cross
            - isolated
          description: >-
            Margin mode to set: cross uses shared account balance, isolated
            locks a fixed margin per position
      required:
        - asset
        - exchange
        - marginMode
      title: SetMarginMode
    ErrorResponseDTO:
      type: object
      properties:
        message:
          type: string
          example: 'Invalid order id: 123'
        statusCode:
          example: 503
          type: number
      required:
        - message
      title: ErrorResponse
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

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