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

# 调整账号排序

> 接口说明：更新指定分组内的账号排序。

`groupId` 必须是现有分组 ID，`list[n].id` 必须是该分组下的账号 ID；`list` 为必填且至少包含一个账号。分组与账号不匹配时会返回 `12600`。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json patch /api/v2/channels/account-groups/{groupId}/accounts/rank
openapi: 3.0.1
info:
  title: AiToEarn 开放平台 API
  description: AiToEarn 开放平台 API，支持在中国站与国际站之间切换调试。业务是否成功以响应体 code === 0 为准。
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: 中国站
  - url: https://aitoearn.ai
    description: 国际站
security: []
tags:
  - name: AI 服务
  - name: AI 服务/视频生成
  - name: AI 服务/图像生成
  - name: 渠道管理
  - name: 渠道管理/账号
  - name: 渠道管理/内容发布
  - name: 渠道管理/平台
  - name: 渠道管理/作品
  - name: 渠道管理/账号分组
  - name: 渠道管理/授权
  - name: 资源管理
  - name: AI 服务/大语言模型
  - name: AI 服务/真人素材
  - name: AI 服务/Agent
paths:
  /api/v2/channels/account-groups/{groupId}/accounts/rank:
    patch:
      tags:
        - 渠道管理/账号分组
      summary: 调整账号排序
      description: >-
        接口说明：更新指定分组内的账号排序。


        `groupId` 必须是现有分组 ID，`list[n].id` 必须是该分组下的账号 ID；`list`
        为必填且至少包含一个账号。分组与账号不匹配时会返回 `12600`。
      operationId: AccountGroupsController_sortAccounts_v2
      parameters:
        - name: groupId
          in: path
          description: 分组 ID
          required: true
          example: group-id-from-create-response
          schema:
            type: string
            example: group-id-from-create-response
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                list:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        description: 账号 ID
                        type: string
                        minLength: 1
                      rank:
                        description: 排序值
                        type: number
                    required:
                      - id
                      - rank
                  description: 排序列表，至少包含一个属于该分组的账号
                  minItems: 1
              required:
                - list
            examples:
              success:
                summary: 成功
                value:
                  list:
                    - id: account-id-in-group
                      rank: 1
        required: true
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: boolean
                  code:
                    type: integer
                    description: 业务状态码。0 表示成功，非 0 表示业务错误。
                  message:
                    type: string
                    description: 响应消息。
                  requestId:
                    type: string
                    description: 请求 ID。
                  timestamp:
                    type: integer
                    description: 错误响应时间戳，Unix 毫秒。
                required:
                  - code
                  - message
              examples:
                success:
                  summary: 成功
                  value:
                    data: boolean
                    code: 0
                    message: 请求成功
                    requestId: string
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 需要从 AiToEarn 获取 API Key。点击前往[「API Key 获取教程」](/zh/use/api-key)。

````

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