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

# 创建组

> 创建账户认证组

<script src="/locale-bridge.js" />


## OpenAPI

````yaml /openapi.zh-cn.json POST /v1/public/accounts/{account_id}/auth/groups
openapi: 3.1.0
info:
  title: Code API (Public)
  version: 1.0.0
servers:
  - url: https://api.hybridbox.io
security: []
paths:
  /v1/public/accounts/{account_id}/auth/groups:
    post:
      tags:
        - public-accounts
        - public-account-auth
      summary: 创建账户认证组
      description: 创建账户绑定组。
      operationId: >-
        create_public_account_auth_group_v1_public_accounts__account_id__auth_groups_post
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            format: uuid
            title: Account Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
      security:
        - PublicBearerAuth: []
components:
  schemas:
    GroupCreateRequest:
      description: 用于创建新身份验证组的请求架构。
      properties:
        account_id:
          description: 新账户范围组的所属账户
          format: uuid
          title: 账户 Id
          type: string
        attributes:
          anyOf:
            - additionalProperties:
                anyOf:
                  - items:
                      type: string
                    type: array
                  - type: string
              type: object
            - type: 'null'
          title: 属性
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: 本地组描述
          title: 描述
        name:
          maxLength: 255
          minLength: 1
          title: 名称
          type: string
      required:
        - name
        - account_id
      title: GroupCreateRequest
      type: object
    GroupResponse:
      properties:
        account_id:
          format: uuid
          title: 账户 Id
          type: string
        attributes:
          additionalProperties:
            items:
              type: string
            type: array
          title: 属性
          type: object
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: 描述
        id:
          title: ID
          type: string
        keycloak_account_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Keycloak 账户 ID
        keycloak_name:
          title: Keycloak 名称
          type: string
        linked_scopes:
          items:
            $ref: '#/components/schemas/GroupScopeLinkResponse'
          title: 已链接作用域
          type: array
        name:
          title: 名称
          type: string
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: 父 ID
        path:
          anyOf:
            - type: string
            - type: 'null'
          title: 路径
        permission_context:
          $ref: '#/components/schemas/PermissionInspectabilitySnapshot'
        subgroup_ids:
          items:
            type: string
          title: 子组 ID
          type: array
      required:
        - id
        - account_id
        - name
        - keycloak_name
      title: GroupResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: 详情
          type: array
      title: HTTPValidationError
      type: object
    GroupScopeLinkResponse:
      description: 链接到组的资源范围的架构。
      properties:
        resource_id:
          format: uuid
          title: 资源 ID
          type: string
        resource_type:
          title: 资源类型
          type: string
      required:
        - resource_type
        - resource_id
      title: GroupScopeLinkResponse
      type: object
    PermissionInspectabilitySnapshot:
      description: 用于用户、组和邀请管理的共享检查性快照。
      properties:
        assigned_bundle_keys:
          items:
            type: string
          title: 已分配捆绑包键
          type: array
        direct_capability_keys:
          items:
            type: string
          title: 直接能力键
          type: array
        owner_assignments:
          items:
            $ref: '#/components/schemas/OwnerAssignmentSnapshot'
          title: 所有者分配
          type: array
        resolved_capability_keys:
          items:
            type: string
          title: 已解析能力键
          type: array
        status:
          default: active
          title: 状态
          type: string
        subject_id:
          default: ''
          title: 主体 ID
          type: string
        subject_type:
          default: unknown
          title: 主体类型
          type: string
      title: PermissionInspectabilitySnapshot
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: 位置
          type: array
        msg:
          title: 消息
          type: string
        type:
          title: 错误类型
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    OwnerAssignmentSnapshot:
      description: 指示帐户所有者关系的架构。
      properties:
        account_id:
          format: uuid
          title: 账户 Id
          type: string
      required:
        - account_id
      title: OwnerAssignmentSnapshot
      type: object
  securitySchemes:
    PublicBearerAuth:
      bearerFormat: JWT or Hybridbox Service account token
      description: >-
        Public API bearer credential sent as `Authorization: Bearer <token>`.
        Use either an OAuth access token or a Hybridbox Service account token.
      scheme: bearer
      type: http

````