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

# Set Position Mode

> Set position mode for a perpetual connector.

Args:
    account_name: Name of the account
    connector_name: Name of the perpetual connector
    position_mode: Position mode to set (HEDGE or ONEWAY)

Returns:
    Success message with status

Raises:
    HTTPException: 400 if not a perpetual connector or invalid position mode



## OpenAPI

````yaml /api-reference/openapi.json post /trading/{account_name}/{connector_name}/position-mode
openapi: 3.1.0
info:
  title: Hummingbot API
  description: API for managing Hummingbot trading instances
  version: 1.0.1
servers:
  - url: http://localhost:8000
    description: Local development server
security: []
paths:
  /trading/{account_name}/{connector_name}/position-mode:
    post:
      tags:
        - Trading
      summary: Set Position Mode
      description: |-
        Set position mode for a perpetual connector.

        Args:
            account_name: Name of the account
            connector_name: Name of the perpetual connector
            position_mode: Position mode to set (HEDGE or ONEWAY)

        Returns:
            Success message with status

        Raises:
            HTTPException: 400 if not a perpetual connector or invalid position mode
      operationId: >-
        set_position_mode_trading__account_name___connector_name__position_mode_post
      parameters:
        - name: account_name
          in: path
          required: true
          schema:
            type: string
            title: Account Name
        - name: connector_name
          in: path
          required: true
          schema:
            type: string
            title: Connector Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PositionModeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBasic: []
components:
  schemas:
    PositionModeRequest:
      properties:
        position_mode:
          type: string
          title: Position Mode
          description: Position mode (HEDGE or ONEWAY)
      type: object
      required:
        - position_mode
      title: PositionModeRequest
      description: Request model for setting position mode on perpetual connectors
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic

````