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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 删除账户组

> 删除空的账户组

删除账户组。该组必须为空：仍有账户（`GROUP_HAS_ACCOUNTS`）或子组（`GROUP_HAS_SUBGROUPS`）的组会以 `400` 被驳回。请先移动或[移除其账户](https://docs.y.uno/zh-hans/reference/organizations/remove-account-from-group.md)，并移动或删除其子组。账户永远不会被自动重新分配。


## OpenAPI

````yaml openapi/zh-hans/organizations/delete-account-group.json DELETE /organizations/account-groups/{account_group_id}
openapi: 3.1.0
info:
  title: Account Groups API - Delete
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /organizations/account-groups/{account_group_id}:
    delete:
      summary: 删除账户组
      description: 删除账户组。只有当组为空时才能删除：请先移除、移动或删除其中的账户（参见从组中移除账户），并移动或删除其子组。账户不会被自动重新分配。
      operationId: delete-account-group
      parameters:
        - name: account_group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 账户组 UUID。
      responses:
        '204':
          description: 无内容：该组已删除。
        '400':
          description: |-
            请求错误。`code` 字段说明原因：

            - `GROUP_HAS_ACCOUNTS`：该组仍有账户。请先将它们从组中移除。
            - `GROUP_HAS_SUBGROUPS`：该组仍有子组。请先将它们移到其他父组（或通过更新账户组将其分离），或先删除它们。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: 机器可读的错误代码。
                  messages:
                    type: array
                    items:
                      type: string
                    description: 人类可读的详细信息。
              example:
                code: GROUP_HAS_SUBGROUPS
                messages:
                  - Cannot delete account group that still has sub-groups
        '404':
          description: 未找到：此组织中不存在具有该 `account_group_id` 的账户组。
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
      x-default: <Your PUBLIC-API-KEY>
    sec1:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY
      x-default: <Your PRIVATE-SECRET-KEY>

````

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