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

# 创建发布选项值

> 接口说明：为某个已授权渠道账号创建平台发布时需要的额外参数值，创建成功后返回可直接用于发布任务的选项 `item`。

所有平台侧“需要先创建再选择”的额外参数都通过本接口处理。例如 Pinterest 需要先创建 Board，再把返回的 Board 作为发布目标 `boardId` 使用。

调用流程：先调用[「平台发布选项」](/api-reference/get-api-v2-channels-platforms-platform-publish-options)接口（`GET /api/v2/channels/platforms/{platform}/publish-options`）查询该平台有哪些额外参数；只有返回项包含 `createSchema` 的字段才支持创建。将返回项中的 `field` 放到本接口路径参数 `field`，并按该 `createSchema` 组织 JSON 请求体。不需要创建的字段，请调用[「发布选项可选值」](/api-reference/get-api-v2-channels-accounts-account-id-publish-options-field-values)接口查询后选择。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json post /api/v2/channels/accounts/{accountId}/publish-options/{field}/values
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 服务/大语言模型
paths:
  /api/v2/channels/accounts/{accountId}/publish-options/{field}/values:
    post:
      tags:
        - 渠道管理/账号
      summary: 创建发布选项值
      description: >-
        接口说明：为某个已授权渠道账号创建平台发布时需要的额外参数值，创建成功后返回可直接用于发布任务的选项 `item`。


        所有平台侧“需要先创建再选择”的额外参数都通过本接口处理。例如 Pinterest 需要先创建 Board，再把返回的 Board 作为发布目标
        `boardId` 使用。


        调用流程：先调用[「平台发布选项」](/api-reference/get-api-v2-channels-platforms-platform-publish-options)接口（`GET
        /api/v2/channels/platforms/{platform}/publish-options`）查询该平台有哪些额外参数；只有返回项包含
        `createSchema` 的字段才支持创建。将返回项中的 `field` 放到本接口路径参数 `field`，并按该
        `createSchema` 组织 JSON
        请求体。不需要创建的字段，请调用[「发布选项可选值」](/api-reference/get-api-v2-channels-accounts-account-id-publish-options-field-values)接口查询后选择。
      operationId: AccountsController_createPublishOptionValue_v2
      parameters:
        - name: accountId
          in: path
          description: 渠道账号 ID。必须是当前用户已授权的账号，且账号所属平台应与「平台发布选项」接口中查询的平台一致。
          required: true
          example: ''
          schema:
            type: string
            description: 渠道账号 ID。必须是当前用户已授权的账号，且账号所属平台应与「平台发布选项」接口中查询的平台一致。
        - name: field
          in: path
          description: >-
            要创建取值的发布选项字段。取值来自[「平台发布选项」](/api-reference/get-api-v2-channels-platforms-platform-publish-options)接口返回的
            `data[n].field`，并且该返回项必须包含 `createSchema`。
          required: true
          example: ''
          schema:
            type: string
            description: >-
              要创建取值的发布选项字段。取值来自[「平台发布选项」](/api-reference/get-api-v2-channels-platforms-platform-publish-options)接口返回的
              `data[n].field`，并且该返回项必须包含 `createSchema`。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              description: >-
                创建发布选项值所需的 JSON
                参数。具体字段不是固定结构，必须以[「平台发布选项」](/api-reference/get-api-v2-channels-platforms-platform-publish-options)接口返回项中的
                `createSchema` 为准。
              properties: {}
            examples: {}
        required: true
        description: >-
          创建发布选项值所需的 JSON
          参数。具体字段不是固定结构，必须以[「平台发布选项」](/api-reference/get-api-v2-channels-platforms-platform-publish-options)接口返回项中的
          `createSchema` 为准；例如 Pinterest 的 `boardId` 字段会返回创建 Board 所需的 schema。
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PublishOptionCreatedValueVo'
                  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:
                    code: 0
                    message: 请求成功
                    data:
                      field: string
                      valueType: list
                      item: {}
                validationFailed10002:
                  summary: ValidationFailed (10002)
                  value:
                    code: 10002
                    message: 参数验证失败
                    data: {}
                    timestamp: 1772099056662
                unauthorized401:
                  summary: 未认证或 API Key 无效
                  value:
                    code: 401
                    message: Unauthorized
                    data: {}
                    timestamp: 1772099056662
                accountNotFound12600:
                  summary: AccountNotFound (12600)
                  value:
                    code: 12600
                    message: 账号未找到
                    data: {}
                    timestamp: 1772099056662
                channelPlatformOperationNotSupported15080:
                  summary: ChannelPlatformOperationNotSupported (15080)
                  value:
                    code: 15080
                    message: '{{platform}} 不支持该操作'
                    data: {}
                    timestamp: 1772099056662
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    PublishOptionCreatedValueVo:
      type: object
      properties:
        field:
          type: string
          description: 发布选项字段
        valueType:
          type: string
          enum:
            - list
            - tree
          description: 取值结构
        item:
          type: object
          properties: {}
          description: 选项
      required:
        - field
        - valueType
        - item
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: AiToEarn Open Platform API Key。

````