> ## 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}/mailboxes/bulk
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}/mailboxes/bulk:
    post:
      tags:
        - public-accounts
        - public-mailboxes
      summary: 批量创建邮箱
      description: 批量创建邮箱但不返回密码。
      operationId: >-
        bulk_create_public_mailboxes_v1_public_accounts__account_id__mailboxes_bulk_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/MailboxBulkCreateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxBulkCreateResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
      security:
        - PublicBearerAuth: []
components:
  schemas:
    MailboxBulkCreateRequest:
      additionalProperties: false
      description: 批量创建邮箱的请求正文。
      properties:
        domain:
          description: 邮箱使用的域 UUID 或域名
          title: 域
          type: string
        items:
          items:
            $ref: '#/components/schemas/MailboxBulkCreateItem'
          minItems: 1
          title: 项目
          type: array
      required:
        - domain
        - items
      title: MailboxBulkCreateRequest
      type: object
    MailboxBulkCreateResponse:
      properties:
        created:
          items:
            $ref: '#/components/schemas/MailboxBulkCreatedItem'
          title: 已创建
          type: array
        failed:
          items:
            $ref: '#/components/schemas/MailboxBulkFailedItem'
          title: 失败
          type: array
      required:
        - created
        - failed
      title: MailboxBulkCreateResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: 详情
          type: array
      title: HTTPValidationError
      type: object
    MailboxBulkCreateItem:
      additionalProperties: false
      description: 批量创建邮箱的请求正文项。
      properties:
        first_name:
          title: 名字
          type: string
        last_name:
          title: 姓氏
          type: string
        local_part:
          title: 本地部分
          type: string
      required:
        - local_part
        - first_name
        - last_name
      title: MailboxBulkCreateItem
      type: object
    MailboxBulkCreatedItem:
      description: 成功批量创建邮箱的结果。
      properties:
        index:
          title: 索引
          type: integer
        mailbox:
          $ref: '#/components/schemas/MailboxDTO'
      required:
        - index
        - mailbox
      title: MailboxBulkCreatedItem
      type: object
    MailboxBulkFailedItem:
      description: 失败的批量创建邮箱结果。
      properties:
        code:
          title: 代码
          type: string
        index:
          title: 索引
          type: integer
        message:
          title: 消息
          type: string
      required:
        - index
        - code
        - message
      title: MailboxBulkFailedItem
      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
    MailboxDTO:
      properties:
        aliases:
          description: 邮箱的别名
          items:
            $ref: '#/components/schemas/MailboxAliasDTO'
          title: 别名
          type: array
        created_at:
          description: 邮箱创建时间戳
          title: 创建时间
          type: string
        domain_id:
          description: 邮箱域名 UUID
          format: uuid
          title: 域名 Id
          type: string
        domain_name:
          description: 邮箱的域名
          title: 域名
          type: string
        first_name:
          description: 邮箱用户名
          title: 名字
          type: string
        id:
          description: 邮箱UUID
          format: uuid
          title: ID
          type: string
        last_name:
          description: 邮箱用户姓氏
          title: 姓氏
          type: string
        local_part:
          description: at 符号之前的邮箱本地部分
          title: 本地部分
          type: string
        primary_email:
          description: 主邮箱电子邮件地址
          title: 主要电子邮件
          type: string
        quota:
          $ref: '#/components/schemas/MailboxQuotaDTO'
          description: 邮箱配额使用情况
        status:
          description: 邮箱生命周期状态
          title: 状态
          type: string
        updated_at:
          description: 邮箱上次更新时间戳
          title: 更新时间
          type: string
        workspace_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: 邮箱的工作区 UUID
          title: 工作区 Id
        workspace_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 工作区显示名称
          title: 工作区名称
      required:
        - id
        - domain_id
        - primary_email
        - domain_name
        - local_part
        - first_name
        - last_name
        - status
        - quota
        - created_at
        - updated_at
      title: MailboxDTO
      type: object
    MailboxAliasDTO:
      properties:
        alias:
          description: 邮箱别名电子邮件地址
          title: 别名
          type: string
        is_catch_all:
          default: false
          description: 该别名是否捕获所有不匹配的本地部分
          title: 是否为 catch-all
          type: boolean
      required:
        - alias
      title: MailboxAliasDTO
      type: object
    MailboxQuotaDTO:
      description: 面向客户的邮箱配额 DTO。
      properties:
        allowed:
          description: 邮箱存储限额
          title: 允许
          type: integer
        used:
          description: 使用的邮箱存储空间
          title: 已使用
          type: integer
      required:
        - used
        - allowed
      title: MailboxQuotaDTO
      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

````