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

# Retune or disable a test account

> Updates a registered simulated account. Every field is optional and an omitted field keeps its stored value. Setting enabled to false takes the account out of service on the scheduler's next sweep while keeping the registration. Retuning an account that is running restarts it with the new timings. Callable by a client credential holding the accounts:admin scope, which may retune any organization's account, and by an organization admin of a configured internal organization, which may retune only its own organization's accounts.



## OpenAPI

````yaml /api-reference/accounts.openapi.json patch /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}:
    patch:
      tags:
        - Accounts
      summary: Retune or disable a test account
      description: >-
        Updates a registered simulated account. Every field is optional and an
        omitted field keeps its stored value. Setting enabled to false takes the
        account out of service on the scheduler's next sweep while keeping the
        registration. Retuning an account that is running restarts it with the
        new timings. Callable by a client credential holding the accounts:admin
        scope, which may retune any organization's account, and by an
        organization admin of a configured internal organization, which may
        retune only its own organization's accounts.
      operationId: updateTestAccount
      parameters:
        - name: trading_account_id
          in: path
          description: Simulated account id
          required: true
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440111
      requestBody:
        description: The fields to change. All values shown are placeholders.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTestAccountRequest'
            example:
              enabled: false
        required: true
      responses:
        '200':
          description: Test account updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTestAccountResponse'
              example:
                test_account:
                  ack_latency_ms: 0
                  created_at: '2026-08-25T17:04:57Z'
                  created_by: an_YcKlZQeuLOoB5BcqlOrnV6a0
                  enabled: false
                  environment: paper
                  fill_max_ms: 100
                  fill_min_ms: 5
                  name: load-test-01
                  organization_id: 550e8400-e29b-41d4-a716-446655440000
                  trading_account_id: 550e8400-e29b-41d4-a716-446655440111
                  updated_at: '2026-08-25T18:12:03Z'
        '400':
          description: >-
            Blank name, negative timing, or a fill range that would end up
            inverted
          content:
            text/plain:
              schema:
                type: string
        '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 updating the account
          content:
            text/plain:
              schema:
                type: string
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateTestAccountRequest:
      type: object
      description: >-
        A partial update to a registered test account.


        Every field optional: an omitted one keeps its stored value.
        `environment`

        is absent deliberately, not forgotten -- a test account is `paper` and
        the

        table refuses anything else, so a field for it would only ever be
        refused.


        Retuning an account that is currently running restarts it. The scheduler

        notices the account's `updated_at` moved, stops the client and starts a

        fresh one with the new timings, which is the same path a real account
        takes

        when its credential is rotated.
      properties:
        ack_latency_ms:
          type:
            - integer
            - 'null'
          format: int32
        enabled:
          type:
            - boolean
            - 'null'
          description: >-
            Set false to take the account out of service. The scheduler's next
            sweep

            stops its client; the registration stays so it can be re-enabled.
        fill_max_ms:
          type:
            - integer
            - 'null'
          format: int32
        fill_min_ms:
          type:
            - integer
            - 'null'
          format: int32
        name:
          type:
            - string
            - 'null'
    CreateTestAccountResponse:
      type: object
      description: >-
        The registered test account, echoed back in full.


        The whole row rather than just its id, because the request may have left
        the

        simulator's timings out and the operator needs to see which defaults
        they

        got without a second call.
      required:
        - test_account
      properties:
        test_account:
          $ref: '#/components/schemas/TestTradingAccount'
    TestTradingAccount:
      type: object
      description: >-
        A simulated trading account, registered by an operator for load testing.


        Not a [`TradingAccount`] with a flag on it, and deliberately so. A
        trading

        account is a customer's broker connection: it has a broker, a
        credential, an

        append-only event stream behind it and a six year retention obligation.
        This

        has none of those. It is a row an operator adds to make the platform
        trade

        against an in-process simulator, and removes again afterwards.


        Keeping the two types apart is what lets `GET /v1/accounts` answer one

        question at a time: without `test_accounts=true` it lists real accounts
        and

        cannot accidentally include one of these, and with it, it lists only
        these.

        A shared type carrying a boolean would have made every caller
        responsible

        for checking that boolean, and the cost of one forgetting is a
        customer's

        orders going to a simulator.
      required:
        - trading_account_id
        - organization_id
        - name
        - enabled
        - environment
        - ack_latency_ms
        - fill_min_ms
        - fill_max_ms
        - created_by
        - created_at
        - updated_at
      properties:
        ack_latency_ms:
          type: integer
          format: int32
          description: >-
            Acknowledgement delay the simulator charges every command, in

            milliseconds.


            Also a per-account rate ceiling of roughly `1000 / ack_latency_ms`

            commands a second: it is paid inside the simulator's `create_order`

            before it returns, and the submitter awaits that return before
            claiming

            the account's next command. Zero means no delay.
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
          description: '`service_id` of the credential that registered this account.'
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When this account was first deleted, if it has been.


            A tombstone rather than a removal, so a retried delete can be
            answered

            with the moment the first one happened. A deleted account is
            filtered

            out of every read path, which is what stops the scheduler running
            it.
        enabled:
          type: boolean
        environment:
          $ref: '#/components/schemas/BrokerEnvironment'
          description: >-
            Always [`BrokerEnvironment::Paper`], enforced by a check constraint
            on

            the table. Carried rather than assumed because the scheduler
            branches on

            it to decide whether an account needs the live-trading entitlement.
        fill_max_ms:
          type: integer
          format: int32
        fill_min_ms:
          type: integer
          format: int32
          description: >-
            Bounds on how long a resting order waits before the simulator fills
            it.
        name:
          type: string
          description: >-
            What the operator called it. Required, unlike a trading account's
            name:

            with no broker and no credential, it is the only thing identifying
            which

            test account this is.
        organization_id:
          type: string
          format: uuid
        trading_account_id:
          type: string
          format: uuid
          description: The account id the rest of the platform trades under.
        updated_at:
          type: string
          format: date-time
    BrokerEnvironment:
      type: string
      enum:
        - paper
        - live
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````