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

# Kill trading for a scope within the caller's hierarchy

> Cancels the active orders of one scope within your own hierarchy and locks it against new orders. Requires an FCM- or FIRM-level API key with the RISK_MANAGEMENT permission.



## OpenAPI

````yaml /api-reference/derivatives-predictions-api/rest-api/cpm-spec.json post /api/trading/kill-switch
openapi: 3.0.3
info:
  title: CPM Public REST API
  version: 0.1.0
servers:
  - url: https://api.example.com
    variables: {}
security:
  - auth_api_key: []
  - auth_timestamp: []
  - auth_passphrase: []
  - auth_signature: []
paths:
  /api/trading/kill-switch:
    post:
      tags:
        - Trading Controls
      summary: Kill trading for a scope within the caller's hierarchy
      description: >-
        Cancels the active orders of one scope within your own hierarchy and
        locks it against new orders. Requires an FCM- or FIRM-level API key with
        the RISK_MANAGEMENT permission.
      operationId: tradingKillSwitch
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KillSwitchRequest'
        required: false
      responses:
        '200':
          description: Kill switch applied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KillSwitchResponse'
        '400':
          description: Invalid scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderErrorResponse'
        '403':
          description: The target is outside your own firm or FCM.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderErrorResponse'
        '404':
          description: Unknown target
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderErrorResponse'
        '422':
          description: Rejected by the exchange
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderErrorResponse'
      deprecated: false
      security: []
components:
  schemas:
    KillSwitchRequest:
      type: object
      additionalProperties: false
      properties:
        api_key:
          type: string
          nullable: true
          description: >-
            API key whose trading to stop. Send exactly one of api_key, firm_id,
            or fcm_id. The key must be within your own firm or FCM.
        firm_id:
          type: string
          nullable: true
          description: >-
            Id of the firm whose trading to stop, as a canonical decimal string.
            Must be your own firm, or a firm under your FCM.
          example: '298471892342'
        fcm_id:
          type: string
          nullable: true
          description: >-
            Id of your own FCM, as a canonical decimal string. Only FCM-level
            API keys may use this scope.
        cancel_only:
          type: boolean
          nullable: true
          description: >-
            If true, cancel the scope's active orders without locking it, so new
            orders are still accepted. If false or omitted, the scope is also
            locked against new orders.
          example: false
    KillSwitchResponse:
      type: object
      additionalProperties: false
      properties:
        scope:
          type: string
          description: 'Scope the request applied to: API_KEY, FIRM, or FCM.'
          example: FIRM
        scope_id:
          type: string
          description: >-
            Id of the target, as a canonical decimal string: the API key's user
            id for API_KEY scope, otherwise the firm or FCM id.
          example: '298471892342'
        cancel_only:
          type: boolean
          description: Echo of cancel_only from the request. Always false for an unlock.
          example: false
        locked:
          type: boolean
          description: >-
            True when this request locked the scope against new orders. False
            for a cancel-only request and for an unlock. While a scope is
            locked, cancels and reads still work.
          example: true
        num_orders_canceled:
          type: integer
          format: int32
          description: Number of active orders canceled. Always 0 for an unlock.
          example: 1
      required:
        - cancel_only
        - locked
        - num_orders_canceled
    OrderErrorResponse:
      type: object
      additionalProperties: false
      properties:
        error:
          type: string
          description: >-
            Machine-readable error code, for example INVALID_FIELD,
            INSUFFICIENT_BALANCE, or UNAUTHORIZED.
          example: INVALID_FIELD
        message:
          type: string
          description: Human-readable description of the error.
          example: 'side must be one of: BUY, SELL, BUY_NO, SELL_NO'
  securitySchemes:
    auth_api_key:
      name: CB-ACCESS-KEY
      description: The API key string for the request
      in: header
      type: apiKey
    auth_timestamp:
      name: CB-ACCESS-TIMESTAMP
      description: The request timestamp (epoch seconds)
      in: header
      type: apiKey
    auth_passphrase:
      name: CB-ACCESS-PASSPHRASE
      description: The passphrase for the API key
      in: header
      type: apiKey
    auth_signature:
      name: CB-ACCESS-SIGN
      description: HMAC SHA-256 signature over TIMESTAMP + METHOD + REQUEST_PATH + BODY
      in: header
      type: apiKey

````