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

# 提交人工介入表单

> 向暂停中的人工介入表单提交接收人的响应。接受后工作流将继续；可通过订阅工作流事件接口跟踪后续事件。需要 WebApp 提交方式。



## OpenAPI

````yaml /zh/api-reference/openapi_workflow.json post /form/human_input/{form_token}
openapi: 3.0.1
info:
  title: 工作流应用 API
  description: 工作流应用提供无会话支持，适用于翻译、文章写作、摘要 AI 等场景。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: 工作流应用 API 的基础 URL。自部署时，替换为你的 API 基础 URL。
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API 基础 URL 的主机与路径，不含 `https://` 前缀。
security:
  - ApiKeyAuth: []
tags:
  - name: 工作流
    description: 用于执行和管理工作流的操作。
  - name: 文件操作
    description: 文件上传和下载操作。
  - name: 终端用户
    description: 终端用户信息相关操作。
  - name: 语音与文字转换
    description: 语音转文字和文字转语音转换。
  - name: 应用配置
    description: 应用设置、参数和元数据。
  - name: 人工介入
    description: 暂停等待人工输入的工作流恢复操作。
paths:
  /form/human_input/{form_token}:
    post:
      tags:
        - 人工介入
      summary: 提交人工介入表单
      description: 向暂停中的人工介入表单提交接收人的响应。接受后工作流将继续；可通过订阅工作流事件接口跟踪后续事件。需要 WebApp 提交方式。
      operationId: submitWorkflowHumanInputForm
      parameters:
        - name: form_token
          in: path
          required: true
          schema:
            type: string
          description: 暂停表单的访问令牌，由流式模式下执行工作流或发送对话消息接口返回的 `human_input_required` 事件提供。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - inputs
                - action
                - user
              properties:
                inputs:
                  type: object
                  additionalProperties: true
                  description: >-
                    按各输入的 `output_variable_name` 作为键提交的值。段落和下拉选项输入为字符串；`file`
                    输入为单个文件映射；`file-list` 输入为文件映射数组。文件映射为 `{transfer_method:
                    local_file, upload_file_id, type}` 或 `{transfer_method:
                    remote_url, url, type}`，其中 `type` 为该字段 `allowed_file_types`
                    中的一种（`image`、`document`、`audio`、`video`、`custom`）。对于
                    `local_file`，`upload_file_id` 为
                    [上传文件](/api-reference/文件操作/上传文件) 返回的
                    `id`。请在执行、上传和提交各次调用中使用一致的 `user`。
                action:
                  type: string
                  description: >-
                    接收人选择的操作按钮 ID。必须与表单的 `user_actions` 列表（由
                    [获取人工介入表单](/api-reference/人工介入/获取人工介入表单) 接口返回）中的某个 `id` 值匹配。
                user:
                  type: string
                  description: >-
                    用户标识符，由开发者定义的规则生成，必须在应用内唯一。Service API 与 WebApp 的用户 ID
                    相互独立，即使取值相同也不指向同一用户。
            examples:
              approve:
                summary: 请求示例
                value:
                  inputs:
                    feedback: 可以发布
                    priority: high
                    attachment:
                      transfer_method: local_file
                      upload_file_id: 3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7
                      type: image
                    attachments:
                      - transfer_method: local_file
                        upload_file_id: 1a77f0df-c0e6-461c-987c-e72526f341ee
                        type: document
                      - transfer_method: remote_url
                        url: https://example.com/report.pdf
                        type: document
                  action: approve
                  user: abc-123
      responses:
        '200':
          description: 表单提交成功。响应体为空对象。
          content:
            application/json:
              schema:
                type: object
              examples:
                success:
                  summary: 响应示例
                  value: {}
        '400':
          description: |-
            - `bad_request`：表单接收人类型无效。
            - `invalid_form_data`：提交内容未通过表单定义的校验。
          content:
            application/json:
              examples:
                bad_request:
                  summary: bad_request
                  value:
                    status: 400
                    code: bad_request
                    message: 表单接收人类型无效
                invalid_form_data:
                  summary: invalid_form_data
                  value:
                    status: 400
                    code: invalid_form_data
                    message: 缺少必填输入：feedback
        '404':
          description: '`not_found`：未找到表单。'
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: 未找到表单
        '412':
          description: |-
            - `human_input_form_submitted`：表单已被提交。表单为一次性使用；无论由哪位用户提交，首个响应即生效。
            - `human_input_form_expired`：在提交到达之前表单已过期。
          content:
            application/json:
              examples:
                human_input_form_submitted:
                  summary: human_input_form_submitted
                  value:
                    status: 412
                    code: human_input_form_submitted
                    message: 该表单已被其他用户提交，form_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890
                human_input_form_expired:
                  summary: human_input_form_expired
                  value:
                    status: 412
                    code: human_input_form_expired
                    message: 该表单已过期，form_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key 认证。对于所有 API 请求，请在 `Authorization` HTTP 头中包含您的 API Key，并加上
        `Bearer ` 前缀。示例：`Authorization: Bearer {API_KEY}`。**强烈建议将 API Key
        存储在服务端，不要在客户端共享或存储，以避免 API Key 泄漏导致严重后果。**

````