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

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

**Two outcomes, by design:**
| Plan state | Result |
|------------|--------|
| Never used in a purchase | **Permanently deleted** (hard delete) |
| Used in ≥1 purchase | **Delete refused** with `409 PLAN_IN_USE` — archive it instead |

Plans with purchase history can never be hard-deleted: your billing records, accounts, and audit trail reference them (same model as Stripe products). The 409 response includes a `hint` field with the exact archive call.

**Archiving instead of deleting:**
```bash
curl -X PATCH ".../trading-plans/{planId}" -d '{"isActive": false}'
```
Archived plans can't be purchased and can be excluded from listings with `GET /trading-plans?isActive=true`.

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

**Error Codes:**
| Code | Description |
|------|-------------|
| `PLAN_NOT_FOUND` | No plan exists with this ID |
| `PLAN_NOT_IN_ORG` | Plan belongs to different organization |
| `PLAN_IN_USE` | Plan has purchase history — archive it instead (see `hint` in response) |
| `ADMIN_REQUIRED` | Only admins can delete plans |



## OpenAPI

````yaml /api-reference/openapi.json delete /v1/organization/trading-plans/{planId}
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-plans/{planId}:
    delete:
      tags:
        - Trading plans
      summary: Delete a trading plan
      description: >-
        Delete a trading plan. **Admin only**.


        **Two outcomes, by design:**

        | Plan state | Result |

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

        | Never used in a purchase | **Permanently deleted** (hard delete) |

        | Used in ≥1 purchase | **Delete refused** with `409 PLAN_IN_USE` —
        archive it instead |


        Plans with purchase history can never be hard-deleted: your billing
        records, accounts, and audit trail reference them (same model as Stripe
        products). The 409 response includes a `hint` field with the exact
        archive call.


        **Archiving instead of deleting:**

        ```bash

        curl -X PATCH ".../trading-plans/{planId}" -d '{"isActive": false}'

        ```

        Archived plans can't be purchased and can be excluded from listings with
        `GET /trading-plans?isActive=true`.


        **Example:**

        ```bash

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


        **Error Codes:**

        | Code | Description |

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

        | `PLAN_NOT_FOUND` | No plan exists with this ID |

        | `PLAN_NOT_IN_ORG` | Plan belongs to different organization |

        | `PLAN_IN_USE` | Plan has purchase history — archive it instead (see
        `hint` in response) |

        | `ADMIN_REQUIRED` | Only admins can delete plans |
      operationId: deleteV1OrganizationTradingplansPlanid
      parameters:
        - description: The plan ID to delete
          x-format:
            guid: true
          name: planId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Plan deleted successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model810'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model9'
        '403':
          description: Forbidden - Admin required or plan not in org
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model811'
        '404':
          description: Not Found - Plan not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model812'
        '409':
          description: Conflict - Plan is in use (archive it instead, see hint)
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model813'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model5'
      security:
        - X-API-Key: []
components:
  schemas:
    Model810:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Trading plan deleted successfully
        data:
          $ref: '#/components/schemas/Model809'
    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
    Model811:
      type: object
      properties:
        statusCode:
          type: number
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: This plan does not belong to your organization
        code:
          type: string
          example: PLAN_NOT_IN_ORG
    Model812:
      type: object
      properties:
        statusCode:
          type: number
          example: 404
        error:
          type: string
          example: Not Found
        message:
          type: string
          example: Trading plan not found
        code:
          type: string
          example: PLAN_NOT_FOUND
    Model813:
      type: object
      properties:
        statusCode:
          type: number
          example: 409
        error:
          type: string
          example: Conflict
        message:
          type: string
          example: 'Cannot delete plan: it has been used in 10+ account purchase(s)'
        code:
          type: string
          example: PLAN_IN_USE
        hint:
          type: string
          example: >-
            Plans with purchase history cannot be deleted (it would orphan your
            billing and account records). Archive it instead: PATCH
            /platform/v1/organization/trading-plans/{planId} with {"isActive":
            false}. Archived plans are hidden from new purchases; exclude them
            from listings with GET /trading-plans?isActive=true.
    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
    Model809:
      type: object
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          example: Deleted Plan 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 trading rule](/platform-api/trading-rules/delete-a-trading-rule.md)
- [Delete a copy trading config](/trade-api/copy-trading/delete-a-copy-trading-config.md)
- [Delete all copy trading configs](/trade-api/copy-trading/delete-all-copy-trading-configs.md)
- [Update a trading plan](/platform-api/trading-plans/update-a-trading-plan.md)
- [Get a specific trading plan](/platform-api/trading-plans/get-a-specific-trading-plan.md)


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