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

# Toggle Feature Flag

> Toggle a feature flag on/off.

_Does not require authentication_



## OpenAPI

````yaml https://spec.speakeasy.com/aries/aries/aries-trading-platform-api-with-code-samples patch /v1/config/toggle-feature-flag/{key}
openapi: 3.0.3
info:
  title: Aries Trading Platform API
  description: >-
    Complete API documentation for the Aries trading platform including user
    management, authentication, account management, order management, market
    data, and analytics
  contact:
    name: Aries Financial
    email: dev@aries.com
  version: 1.0.0
servers:
  - url: https://api.tradearies.dev
    description: Production server
security: []
tags:
  - name: Accounts
    description: Account management endpoints for positions, orders, and balances
  - name: Analytics
    description: >-
      Analytics endpoints for market data analysis including top gainers,
      losers, volume leaders, sector analysis, analyst ratings, market breadth,
      and net inflow
  - name: Authentication
    description: User authentication endpoints
  - name: Calendars
    description: Calendar endpoints for economic events and historical data
  - name: Market Data
    description: >-
      Market data endpoints for symbol search, real-time data access, and equity
      details
  - name: Orders
    description: >-
      Order management endpoints for placing, updating, canceling, and
      previewing orders
  - name: Users
    description: User management endpoints
  - name: Health
    description: Service health endpoints
paths:
  /v1/config/toggle-feature-flag/{key}:
    patch:
      tags:
        - Settings
      summary: Toggle Feature Flag
      description: |-
        Toggle a feature flag on/off.

        _Does not require authentication_
      operationId: toggleFeatureFlag
      parameters:
        - name: key
          in: path
          description: The feature flag key to toggle
          required: true
          schema:
            type: string
          example: new_ui_enabled
      responses:
        '200':
          description: Feature flag toggled successfully
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Bad request - Invalid key or feature flag not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Failed to toggle feature flag
                codes:
                  - code: FAILED_TO_TOGGLE_FEATURE_FLAG
                    description: Failed to toggle feature flag
        '500':
          description: Internal server error
      x-codeSamples:
        - lang: java
          label: Java (SDK)
          source: >-
            package hello.world;


            import java.lang.Exception;

            import org.openapis.openapi.AriesJava;

            import org.openapis.openapi.models.errors.ErrorResponse;

            import
            org.openapis.openapi.models.operations.ToggleFeatureFlagResponse;


            public class Application {

                public static void main(String[] args) throws ErrorResponse, Exception {

                    AriesJava sdk = AriesJava.builder()
                            .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
                        .build();

                    ToggleFeatureFlagResponse res = sdk.settings().toggleFeatureFlag()
                            .key("new_ui_enabled")
                            .call();

                    if (res.object().isPresent()) {
                        // handle response
                    }
                }
            }
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        codes:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Error code
              description:
                type: string
                description: Error description

````