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

# Delete a firm

> Offboard a client firm from your ScripX desk: the registration is removed and its connection released, while settled trades and the audit trail remain immutable.

Offboards a firm from your desk. The registration row is removed and any connection is released. Already-settled trades are unaffected: the [audit trail](/api-reference/account/audit-export) is immutable and your [statements](/api-reference/account/statements) still reconcile.

Deletion is idempotent-by-outcome: once gone, the IEC can be [registered again](/api-reference/firms/create) fresh.

### Request example

```bash theme={"dark"}
curl -X DELETE "https://api.scripxhq.com/v1/firms/0512345678" \
  -H "X-ScripX-Key: <YOUR_API_KEY>"
```

### Response example

```json theme={"dark"}
{
  "deleted": true,
  "iec": "0512345678"
}
```

### Errors

* `404 not_found`, no such firm on your desk.

**Terms used here:** [IEC](/annexure/terminology#iec), [statement](/annexure/terminology#statement), [API key](/annexure/terminology#api-key). Full list in the [terminology annexure](/annexure/terminology).

### Next steps

* [List firms](/api-reference/firms/list) to confirm the book.


## OpenAPI

````yaml DELETE /v1/firms/{iec}
openapi: 3.1.0
info:
  title: ScripX Partner API
  version: 1.2.0
  description: >-
    Automate duty-credit-scrip trading: quote, order, positions, market,
    webhooks. Auth: `X-ScripX-Key: scripx_live_…`. Money = integer paise; price
    = bps of face.
  contact:
    name: ScripX API Support
    email: amin@eximfiles.io
    url: https://scripxhq.com
servers:
  - url: https://api.scripxhq.com
    description: >-
      Production and sandbox share one host; a scripx_test_ key selects the
      sandbox.
security:
  - ApiKeyAuth: []
tags:
  - name: Firms
    description: >-
      client-firm lifecycle: register, verify, authorize, credits, update,
      offboard
  - name: Trading
    description: quote, orders, positions, market
  - name: Group
    description: intra-group netting + positions (enterprise/broker)
  - name: Cross
    description: 'broker cross-desk: block deals + intra-group transfers'
  - name: Webhooks
    description: event subscriptions + delivery
  - name: Account
    description: usage + metering
  - name: Keys
    description: self-serve scoped child keys (sub-accounts)
paths:
  /v1/firms/{iec}:
    delete:
      tags:
        - Firms
      summary: Offboard a firm from this desk
      parameters:
        - name: iec
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FirmDeleted'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FirmDeleted:
      type: object
      properties:
        deleted:
          type: boolean
        iec:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: stable machine code
          enum:
            - bad_request
            - unauthorized
            - forbidden
            - not_found
            - conflict
            - unprocessable
            - rate_limited
            - internal
        message:
          type: string
        detail:
          type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-ScripX-Key
      description: >-
        Your API key, e.g. `scripx_live_…`. Bound to one firm; tenant isolation
        is enforced.

````