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

# Enable unified account mode

> Check account mode and prepare the enable-unified-account action if needed.

If the account is already in unified mode (or portfolio margin), returns
the current mode with null typed_data — no signing needed. Otherwise,
returns EIP-712 typed data for the user to sign. After signing, submit
the signature via the /execute endpoint.



## OpenAPI

````yaml /v2/combined_spec.json post /v2/global_markets_perps/enable_unified_account
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v2/global_markets_perps/enable_unified_account:
    post:
      tags:
        - Global Markets Perps
      summary: Enable unified account mode
      description: >-
        Check account mode and prepare the enable-unified-account action if
        needed.


        If the account is already in unified mode (or portfolio margin), returns

        the current mode with null typed_data — no signing needed. Otherwise,

        returns EIP-712 typed data for the user to sign. After signing, submit

        the signature via the /execute endpoint.
      operationId: v2_global_markets_perps_enable_unified_account
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/GlobalMarketsPerpsEnableUnifiedAccountRequest
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GlobalMarketsPerpsEnableUnifiedAccountResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.global_markets_perps.global_markets_perps_enable_unified_account(owner="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.globalMarketsPerps.globalMarketsPerpsEnableUnifiedAccount({
                owner: "<value>",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    GlobalMarketsPerpsEnableUnifiedAccountRequest:
      properties:
        owner:
          type: string
          title: Owner
          description: User's EOA address
      type: object
      required:
        - owner
      title: GlobalMarketsPerpsEnableUnifiedAccountRequest
      description: Request to enable unified account mode on Hyperliquid.
    GlobalMarketsPerpsEnableUnifiedAccountResponse:
      properties:
        mode:
          type: string
          title: Mode
          description: Current account abstraction mode (e.g. 'default', 'unifiedAccount')
        typed_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Typed Data
          description: EIP-712 typed data for wallet signing, or null if already unified
        action:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Action
          description: >-
            Raw Hyperliquid action (passed back to the execute endpoint), or
            null
        nonce:
          anyOf:
            - type: integer
            - type: 'null'
          title: Nonce
          description: Timestamp-based nonce, or null if no action needed
      type: object
      required:
        - mode
      title: GlobalMarketsPerpsEnableUnifiedAccountResponse
      description: >-
        Returned by the enable_unified_account endpoint.


        If the account is already in unified mode, typed_data/action/nonce are
        null.

        If not, they contain the EIP-712 payload the user must sign.
      example:
        action:
          type: evmUserModify
          usingBigBlocks: true
        mode: default
        nonce: 1747010983250
        typed_data:
          domain:
            chainId: 1337
            name: Exchange
            verifyingContract: '0x0000000000000000000000000000000000000000'
            version: '1'
          message:
            connectionId: '0xc4e1f04d6b1bf2f2f7a6c0e8a5f3b1d2c9e0a4b7d1c3e5f7a9b1d3e5f7a9e9a2'
            source: a
          primaryType: Agent
          types:
            Agent:
              - name: source
                type: string
              - name: connectionId
                type: bytes32
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````