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

# Delete a Counterparty

> Delete a Counterparty (soft delete). Returns 409 when the counterparty
still owns active or pending External Accounts.



## OpenAPI

````yaml /api-reference/openapi.yaml delete /counterparties/{counterpartyId}
openapi: 3.0.3
info:
  title: Polygon OMS Public API
  version: v26.05.28-0001
  description: >-
    Unified API for moving money between crypto and fiat. Three ways to move
    money: Transactions (instant, wallet or card funded, including Cash-In for
    in-person cash deposits), Deposit Addresses (reusable crypto deposit
    configurations), and Virtual Accounts (dedicated bank accounts that
    auto-convert fiat to crypto). Standard transactions follow a two-step flow:
    create a Quote (pricing), then create a Transaction (execution). Cash-in
    codes generate a one-time deposit code for in-person cash deposits at retail
    locations.
  contact:
    name: Polygon OMS
    url: https://oms.polygon.technology
servers:
  - url: https://sandbox-api.polygon.technology/v0.10
    description: Sandbox
  - url: https://api.polygon.technology/v0.10
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Auth
    description: Authentication via FrontEgg
  - name: Customers
    description: Customer management and KYC
  - name: Customer
  - name: Wallet
  - name: Quote
  - name: Transaction
  - name: Webhook
  - name: CashIns
  - name: CashLocation
  - name: Sandbox
  - name: VirtualAccount
  - name: Counterparty
  - name: ExternalAccount
  - name: DepositAddress
  - name: Simulation
paths:
  /counterparties/{counterpartyId}:
    delete:
      tags:
        - Counterparty
      summary: Delete a Counterparty
      description: |-
        Delete a Counterparty (soft delete). Returns 409 when the counterparty
        still owns active or pending External Accounts.
      operationId: deleteCounterparty
      parameters:
        - in: path
          name: counterpartyId
          required: true
          schema:
            type: string
      responses:
        '204':
          description: >-
            There is no content to send for this request, but the headers may be
            useful. 
        '409':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CounterpartyHasActiveExternalAccountsErrorBody
          description: The request conflicts with the current state of the server.
components:
  schemas:
    CounterpartyHasActiveExternalAccountsErrorBody:
      description: >-
        409 body returned by DELETE /counterparties/{id} when the counterparty
        still

        owns active or pending External Accounts.
        `details.activeExternalAccountIds`

        lists the blocking accounts (which must be deleted before the
        counterparty can

        be removed) and `details.counterpartyId` echoes the affected
        counterparty.
      properties:
        code:
          enum:
            - counterparty_has_active_external_accounts
          type: string
        details:
          properties:
            activeExternalAccountIds:
              description: Public ids (ext_…) of the External Accounts blocking the delete.
              items:
                type: string
              type: array
            counterpartyId:
              description: >-
                The counterparty (ctp_…) that still owns active/pending External
                Accounts.
              type: string
          required:
            - counterpartyId
            - activeExternalAccountIds
          type: object
        error:
          enum:
            - counterparty still owns active or pending external accounts
          type: string
      required:
        - error
        - code
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token from POST /auth/token

````