> ## 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.sandbox.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/perps/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:
                $ref: '#/components/schemas/errorResponse'
              example:
                error:
                  slug: UPDATE_LEVERAGE_NOT_ALLOWED
                  code: PRP-0702
                message: leverage update not allowed
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimitedNoQuota'
      security:
        - bearerAuth: []
components:
  schemas:
    errorResponse:
      type: object
      properties:
        error:
          type: object
          description: An object containing error details.
          properties:
            slug:
              type: string
              description: A short string identifier for the error type.
            code:
              type: string
              description: A string code representing the error.
          required:
            - slug
            - code
        message:
          type: string
          description: A human-readable message describing the error.
      required:
        - error
        - message
  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
    RateLimitedNoQuota:
      description: ''
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
          example:
            error:
              slug: TOO_MANY_REQUESTS
              code: SYS-0003
            message: api call rate limit exceeded
  headers:
    Retry-After:
      description: >-
        Number of seconds to wait before making another request (429 responses
        only)
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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