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

# Set the position's extra isolated margin

> Sets a desired total rather than applying a delta, making an identical retry safe. Reductions use a fresh authoritative book and reject when the new liquidation risk would be unsafe.



## OpenAPI

````yaml /openapi.yaml put /v1/positions/{position_id}/isolated-margin
openapi: 3.1.0
info:
  title: Funding Perpetuals API
  version: 1.0.0
  description: >-
    Programmatic access to Funding Perpetuals paper-trading challenge accounts.
    API trades use the same real order books and simulated execution engine as
    the web trading interface.
  contact:
    url: https://fundingperpetuals.com/support
servers:
  - url: https://developers.fundingperpetuals.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: General
  - name: Accounts
  - name: Markets
  - name: Positions
  - name: Orders
  - name: Fills
  - name: Strategy Orders
paths:
  /v1/positions/{position_id}/isolated-margin:
    put:
      tags:
        - Positions
      summary: Set the position's extra isolated margin
      description: >-
        Sets a desired total rather than applying a delta, making an identical
        retry safe. Reductions use a fresh authoritative book and reject when
        the new liquidation risk would be unsafe.
      operationId: setPositionIsolatedMargin
      parameters:
        - $ref: '#/components/parameters/PositionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - extra_margin
              properties:
                extra_margin:
                  type: number
                  minimum: 0
      responses:
        '200':
          description: Isolated margin target applied.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Position'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/TradeRejected'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    PositionId:
      name: position_id
      in: path
      required: true
      schema:
        type: string
  schemas:
    Position:
      type: object
      required:
        - id
        - account_id
        - market_id
        - provider
        - symbol
        - coin
        - side
        - size
        - entry_price
        - leverage
        - margin_mode
        - isolated_margin_extra
        - status
        - opened_at
      properties:
        id:
          type: string
        account_id:
          type: string
        market_id:
          type: string
        provider:
          type: string
        symbol:
          type: string
        coin:
          type: string
        side:
          type: string
          enum:
            - long
            - short
        size:
          type: number
        entry_price:
          type: number
        leverage:
          type: number
        margin_mode:
          type: string
          enum:
            - cross
            - isolated
        liquidation_price:
          type: number
        isolated_margin_extra:
          type: number
        status:
          type: string
          enum:
            - open
            - closed
        opened_at:
          type: number
        closed_at:
          type: number
        size_decimals:
          type: integer
          minimum: 0
        exit_price:
          type: number
        realized_pnl:
          type: number
        realized_margin_basis:
          type: number
        fees:
          type: number
        funding:
          type: number
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    TradeRejectionEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/TradeRejection'
    Error:
      type: object
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
        message:
          type: string
        request_id:
          type: string
          format: uuid
    TradeRejection:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            order_id:
              type: string
            rule_id:
              type: string
            details:
              type: object
              additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      headers:
        WWW-Authenticate:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: Resource not found or not owned by the authenticated user.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Conflict:
      description: The request conflicts with current state or an idempotency record.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    TradeRejected:
      description: The trading engine rejected the requested operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TradeRejectionEnvelope'
    RateLimited:
      description: A per-key, per-IP, or deployment request budget is exhausted.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  headers:
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        minimum: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Funding Perpetuals API key
      description: API key beginning with `fp_live_`.

````