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

# Set portfolio margin override

> Specify the margin override value for a portfolio to either increase notional requirements or opt-in to higher leverage.

<Tabs groupId="programming-language">
  <Tab value="Java" title="Java">
    ```java theme={null}
    PortfoliosService portfoliosService = IntxServiceFactory.createPortfoliosService(client);
    SetPortfolioMarginOverrideRequest request = new SetPortfolioMarginOverrideRequest.Builder().build();
    SetPortfolioMarginOverrideResponse response = portfoliosService.setPortfolioMarginOverride(request);
    ```

    For more information, please visit the [INTX Java SDK](https://github.com/coinbase-samples/intx-sdk-java).
  </Tab>

  <Tab value=".NET" title=".NET">
    ```cs theme={null}
    var portfoliosService = new PortfoliosService(client);
    var request = new SetPortfolioMarginOverrideRequest();
    var response = portfoliosService.SetPortfolioMarginOverride(request);
    ```

    For more information, please visit the [INTX .NET SDK](https://github.com/coinbase-samples/intx-sdk-dotnet).
  </Tab>

  <Tab value="Go" title="Go">
    ```go theme={null}
    portfoliosSvc := portfolios.NewPortfoliosService(client)
    request := &portfolios.SetMarginOverrideRequest{}
    response, err := portfoliosSvc.SetMarginOverride(context.Background(), request)
    ```

    For more information, please visit the [INTX Go SDK](https://github.com/coinbase-samples/intx-sdk-go).
  </Tab>

  <Tab value="Python" title="Python">
    ```python theme={null}
    client = IntxClient()
    request = SetMarginOverrideRequest()
    response = client.set_margin_override(request)
    ```

    For more information, please visit the [INTX Python SDK](https://github.com/coinbase-samples/intx-sdk-py).
  </Tab>

  <Tab value="Typescript" title="TS/JS">
    ```js theme={null}
    const portfoliosService = new PortfoliosService(client);

    portfoliosService.updateMarginOverride({
        portfolioId: 'PORTFOLIO_ID_HERE',
        marginOverride: '0.1',
    }).then(async (response) => {
        console.log('Margin Override Updated: ', response);
    })
    ```

    For more information, please visit the [INTX TS SDK](https://github.com/coinbase-samples/intx-sdk-ts).
  </Tab>

  <Tab value="CLI" title="CLI">
    ```
    intxctl set-margin-override --help
    ```

    For more information, please visit the [INTX CLI](https://github.com/coinbase-samples/intx-cli).
  </Tab>
</Tabs>


## OpenAPI

````yaml POST /api/v1/portfolios/margin
openapi: 3.0.3
info:
  title: REST API
  description: >
    # Welcome to Coinbase INTX API

    ## Introduction

    The INTX APIs allow institutions to trade and manage orders on the
    International Exchange. The following API pages detail various REST API
    endpoints we offer.

    ## Getting Started

    To get started, please visit one of the following pages:

    - [Quickstart](/international-exchange/introduction/quickstart)

    -
    [Overview](/api-reference/international-exchange-api/rest-api/introduction)

    -
    [Authentication](/api-reference/international-exchange-api/rest-api/authentication)

    - [Rate Limits](/international-exchange/introduction/rate-limits-overview)

    ## FIX API

    - [FIX API reference](/international-exchange/fix-api/fix-api-overview)

    ## WebSocket API

    - [WebSocket API
    reference](/international-exchange/websocket-feed/websocket-overview)
  version: '1.0'
servers:
  - url: https://api.international.coinbase.com
security: []
paths:
  /api/v1/portfolios/margin:
    post:
      tags:
        - Portfolios
      summary: Set portfolio margin override
      description: >-
        Specify the margin override value for a portfolio to either increase
        notional requirements or opt-in to higher leverage.
      operationId: setPortfolioMarginOverride
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - portfolio_id
                - margin_override
              properties:
                portfolio_id:
                  description: >-
                    Identifies the portfolio by UUID (e.g.,
                    `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID
                    (e.g., `5189861793641175`)
                  type: string
                margin_override:
                  description: >-
                    The margin override value for the portfolio. Specified as a
                    decimal value representing notional requirement (e.g., 0.1 =
                    10% notional requirement, 0.25 = 25% notional requirement)
                  type: string
      responses:
        '200':
          description: Portfolio margin override set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioUpdateMarginOverride_v1'
        '400':
          description: Invalid attribute
        '403':
          description: Invalid permission
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
components:
  schemas:
    PortfolioUpdateMarginOverride_v1:
      type: object
      properties:
        portfolio_id:
          description: The unique identifier of the portfolio the fill was executed under
          type: string
          format: string
          example: t4umaqa-1-1
        margin_override:
          description: >-
            The margin override value for the portfolio, indicating notional
            requirement to hold futures positions
          type: number
          format: double
          example: 0.2
  securitySchemes:
    auth_client_id:
      type: apiKey
      name: CB-ACCESS-KEY
      in: header
      description: The Client ID that owns the API Key for the request
    auth_passphrase:
      type: apiKey
      name: CB-ACCESS-PASSPHRASE
      in: header
      description: The pass phrase affiliated with the API Key
    auth_signature:
      type: apiKey
      name: CB-ACCESS-SIGN
      in: header
      description: >-
        A HMAC SHA-256 signature using the API Key secret on the string
        TIMESTAMP, METHOD, REQUEST_PATH, BODY
    auth_timestamp:
      type: apiKey
      name: CB-ACCESS-TIMESTAMP
      in: header
      description: The timestamp of when the request is being made

````