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

# Delete a trading rule

> Delete a trading rule. **Admin only**.

**Cannot delete if:**
- The rule is used by any trading plans

You must first reassign or delete the trading plans that use this rule before deleting it.

**Example:**
```bash
curl -X DELETE "https://api.hyperprop.com/platform/v1/organization/trading-rules/{ruleId}" \
  -H "X-API-Key: hp_live_your_key_here"
```

**Error Codes:**
| Code | Description |
|------|-------------|
| `RULE_NOT_FOUND` | No rule exists with this ID |
| `RULE_NOT_IN_ORG` | Rule belongs to a different organization |
| `RULE_IN_USE` | Rule is used by trading plans or accounts — see `hint` in the response for how to resolve |
| `ADMIN_REQUIRED` | Only admins can delete rules |



## OpenAPI

````yaml /api-reference/openapi.json delete /v1/organization/trading-rules/{ruleId}
openapi: 3.0.0
info:
  title: Hyperprop Platform API
  version: 1.0.0
  description: >-
    REST API for the Hyperprop Trading Platform — provision evaluation and
    funded trading accounts, manage traders and plans, react to account
    lifecycle events via signed webhooks, and reconcile billing. Built for prop
    firms integrating from their own backend.


    Authentication, quick start, error handling, idempotency, pagination, custom
    metadata, webhooks, and the MCP connector are documented at
    https://docs.hyperprop.com.
  x-logo:
    url: https://app.hyperprop.com/logo-icon.svg
    altText: Hyperprop
    href: https://hyperprop.com
servers:
  - url: https://api.hyperprop.com/platform
    description: Production
security: []
tags:
  - name: Trading accounts
    description: Create, update, and inspect trading accounts.
  - name: Traders
    description: Look up and update the traders in your organization.
  - name: Trading plans
    description: Define the plans you sell.
  - name: Trading rules
    description: Define how accounts are evaluated.
  - name: Lockouts
    description: Pause and resume trading on an account.
  - name: Payouts
    description: Check payout eligibility and record payouts.
  - name: Purchases
    description: Purchases recorded for your organization.
  - name: Time Machine
    description: Restore accounts to an earlier trading day or instant.
  - name: Webhooks
    description: Register webhook endpoints and inspect deliveries.
  - name: Events
    description: Your organization's event history and real-time event stream.
  - name: Reconciliation
    description: Balances, end-of-day snapshots, and fills for reconciliation.
  - name: Analytics
    description: Organization performance and plan economics.
  - name: Billing
    description: 'Your Hyperprop bill: activity, billing cycles, and forecasts.'
  - name: Team and roles
    description: Manage dashboard access for your staff.
  - name: API keys
    description: Manage your organization's API key.
  - name: Logs and health
    description: API request logs, the audit log, and integration health.
  - name: Organization profile
    description: Your organization's profile and logo.
  - name: Support
    description: Open and follow up on support tickets.
  - name: Partner access
    description: >-
      Read a trader's journal as an approved partner app, with the trader's own
      key.
paths:
  /v1/organization/trading-rules/{ruleId}:
    delete:
      tags:
        - Trading rules
      summary: Delete a trading rule
      description: >-
        Delete a trading rule. **Admin only**.


        **Cannot delete if:**

        - The rule is used by any trading plans


        You must first reassign or delete the trading plans that use this rule
        before deleting it.


        **Example:**

        ```bash

        curl -X DELETE
        "https://api.hyperprop.com/platform/v1/organization/trading-rules/{ruleId}"
        \
          -H "X-API-Key: hp_live_your_key_here"
        ```


        **Error Codes:**

        | Code | Description |

        |------|-------------|

        | `RULE_NOT_FOUND` | No rule exists with this ID |

        | `RULE_NOT_IN_ORG` | Rule belongs to a different organization |

        | `RULE_IN_USE` | Rule is used by trading plans or accounts — see `hint`
        in the response for how to resolve |

        | `ADMIN_REQUIRED` | Only admins can delete rules |
      operationId: deleteV1OrganizationTradingrulesRuleid
      parameters:
        - description: The rule ID to delete
          x-format:
            guid: true
          name: ruleId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Rule deleted successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model815'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model9'
        '403':
          description: Forbidden - Admin required or rule not in org
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model816'
        '404':
          description: Not Found - Rule not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model817'
        '409':
          description: Conflict - Rule is in use (see hint for how to resolve)
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model818'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model5'
      security:
        - X-API-Key: []
components:
  schemas:
    Model815:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Trading rule deleted successfully
        data:
          $ref: '#/components/schemas/Model814'
    Model9:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 401
        error:
          type: string
          example: Unauthorized
        message:
          type: string
          example: Authentication required
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: UNAUTHORIZED
    Model816:
      type: object
      properties:
        statusCode:
          type: number
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: This rule does not belong to your organization
        code:
          type: string
          example: RULE_NOT_IN_ORG
    Model817:
      type: object
      properties:
        statusCode:
          type: number
          example: 404
        error:
          type: string
          example: Not Found
        message:
          type: string
          example: Trading rule not found
        code:
          type: string
          example: RULE_NOT_FOUND
    Model818:
      type: object
      properties:
        statusCode:
          type: number
          example: 409
        error:
          type: string
          example: Conflict
        message:
          type: string
          example: >-
            Cannot delete rule: it is used by 2 trading plan(s): 50K Challenge,
            100K Challenge
        code:
          type: string
          example: RULE_IN_USE
        hint:
          type: string
          example: >-
            Point those plans at another rule first (PATCH
            /platform/v1/organization/trading-plans/{planId} with
            {"tradingRuleId": "..."}), then retry the delete.
    Model5:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 500
        error:
          type: string
          example: Internal Server Error
        message:
          type: string
          example: An unexpected error occurred
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: INTERNAL_ERROR
    Model814:
      type: object
      properties:
        id:
          type: string
          example: 660e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          example: Deleted Rule Name
        deleted:
          type: boolean
          example: true
  securitySchemes:
    X-API-Key:
      type: apiKey
      name: X-API-Key
      in: header
      description: >-
        Organization API key. Format: "hp_live_{key}". Organization admins
        manage the key in the dashboard.

````

## Related topics

- [Delete a copy trading config](/trade-api/copy-trading/delete-a-copy-trading-config.md)
- [Delete a trading plan](/platform-api/trading-plans/delete-a-trading-plan.md)
- [Delete all copy trading configs](/trade-api/copy-trading/delete-all-copy-trading-configs.md)
- [Update a trading rule](/platform-api/trading-rules/update-a-trading-rule.md)
- [Get a specific trading rule](/platform-api/trading-rules/get-a-specific-trading-rule.md)


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