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

# Remove a test account

> Removes a registered simulated account. The account stops running on the scheduler's next sweep. Orders it already produced are untouched and keep the retention every other order has; what is removed is the registration that made the platform simulate it. Callable by a client credential holding the accounts:admin scope, which may remove any organization's account, and by an organization admin of a configured internal organization, which may remove only its own organization's accounts.



## OpenAPI

````yaml /api-reference/accounts.openapi.json delete /v1/accounts/test/{trading_account_id}
openapi: 3.1.0
info:
  title: accounts
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Accounts
    description: Create, inspect, update, and disable trading accounts
  - name: Broker Credentials
    description: Inspect and manage credentials linked to trading accounts
paths:
  /v1/accounts/test/{trading_account_id}:
    delete:
      tags:
        - Accounts
      summary: Remove a test account
      description: >-
        Removes a registered simulated account. The account stops running on the
        scheduler's next sweep. Orders it already produced are untouched and
        keep the retention every other order has; what is removed is the
        registration that made the platform simulate it. Callable by a client
        credential holding the accounts:admin scope, which may remove any
        organization's account, and by an organization admin of a configured
        internal organization, which may remove only its own organization's
        accounts.
      operationId: deleteTestAccount
      parameters:
        - name: trading_account_id
          in: path
          description: Simulated account id
          required: true
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440111
      responses:
        '200':
          description: >-
            Test account removed. Idempotent: a retry reports the moment of the
            first deletion.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletedResponse'
              example:
                deleted: true
                deleted_at: '2026-08-25T18:12:03Z'
                id: 550e8400-e29b-41d4-a716-446655440111
                resource: test_trading_account
        '401':
          description: Caller is an API key, or a user whose token carries no organization
          content:
            text/plain:
              schema:
                type: string
        '403':
          description: >-
            The client credential is missing the accounts:admin scope, the
            caller's organization is not configured as internal, or the caller
            is not an organization admin
          content:
            text/plain:
              schema:
                type: string
        '404':
          description: >-
            No test account with that id the caller can address. An account in
            another organization answers this rather than 403, so the endpoint
            cannot be used to probe which ids are registered elsewhere
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: Caller exceeded the request rate limit
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Unexpected server error while removing the account
          content:
            text/plain:
              schema:
                type: string
      security:
        - bearerAuth: []
components:
  schemas:
    DeletedResponse:
      type: object
      description: >-
        The body every successful delete returns.


        Deletes are idempotent, so a caller that retries one it is unsure landed

        gets the same 200 as the caller that deleted it. That leaves the caller

        unable to tell the two apart from the status alone, which is what

        `deleted_at` is for: it is the moment the resource was *first* deleted
        and

        does not move on a repeat call.
      required:
        - deleted
        - resource
        - deleted_at
      properties:
        deleted:
          type: boolean
          description: >-
            Always true. A caller checking one field to confirm the outcome does
            not

            have to special-case which endpoint it called.
        deleted_at:
          type: string
          format: date-time
          description: When the resource was first deleted, not when this call was made.
        id:
          type:
            - string
            - 'null'
          description: >-
            Absent for resources keyed by a natural composite key rather than a

            single identifier, which today is every control in the controls
            service.

            The path already identifies those, so nothing is lost by omitting
            it.
        resource:
          $ref: '#/components/schemas/DeletedResourceKind'
    DeletedResourceKind:
      type: string
      description: >-
        The resource a delete acted on.


        Named rather than free text so a caller can branch on it, and so the
        same

        vocabulary is available when these deletes start emitting events.
      enum:
        - trading_account
        - test_trading_account
        - broker_credential
        - oauth_client
        - organization
        - user
        - organization_control
        - account_control
        - account_risk_control
        - account_time_control
        - symbol_control
        - symbol_risk_control
        - symbol_time_control
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````