> ## 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.

# Update Leverage

> This endpoint updates the leverage for a given market.



## OpenAPI

````yaml POST /api/v1/update-leverage
openapi: 3.1.0
info:
  title: Order API
  version: 1.0.0
servers:
  - url: https://order.trade.rails.xyz
security: []
paths:
  /api/v1/update-leverage:
    post:
      summary: Update Leverage
      operationId: updateLeverage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                market:
                  type: string
                  description: >-
                    Market name. Example value: `ETH-USDT`. To get all supported
                    markets, call
                    [/api/v1/markets](/latest/rest-api/get-supported-markets)
                    endpoint.
                leverage:
                  type: string
                  description: >-
                    Leverage to set for the market. Supported values: `1`, `2`,
                    `3`, `4`, `5`.
              required:
                - market
                - leverage
            example:
              market: ETH-USDT
              leverage: '5'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A message describing the result of the update leverage
                      operation.
                required:
                  - message
              example:
                message: leverage updated successfully
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  body:
                    type: string
                    description: A message describing the error.
                  statusCode:
                    type: integer
                    description: HTTP status code.
                required:
                  - body
                  - statusCode
              example:
                body: invalid market
                statusCode: 400
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - bearerAuth: []
components:
  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

````