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

# 上传类别样本

> 为指定文件类别上传多个样本文件，最多20个



## OpenAPI

````yaml /docflow/cn/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/category/sample/batch_upload
openapi: 3.0.0
info:
  title: DocFlow API
  description: DocFlow REST API，提供文件上传和获取文件处理结果能力
  version: 2.8.4
servers:
  - url: https://docflow.textin.com
security:
  - ApiId: []
    SecretCode: []
paths:
  /api/app-api/sip/platform/v2/category/sample/batch_upload:
    post:
      tags:
        - 文件类别样本
      summary: 上传类别样本
      description: 为指定文件类别上传多个样本文件，最多20个
      operationId: batchUploadCategorySample
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: 空间ID
                  example: '1234567890'
                category_id:
                  type: string
                  description: 文件类别ID
                  example: '1234567890'
                files:
                  type: array
                  description: 样本文件列表，最多20个
                  items:
                    type: string
                    format: binary
                  minItems: 1
                  maxItems: 10
                with_detail:
                  type: boolean
                  description: 传 true 时响应返回该分类的全部样本列表
              required:
                - workspace_id
                - category_id
                - files
      responses:
        '200':
          description: 批量上传成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CodeMessage'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          samples:
                            type: array
                            description: 该分类的全部样本列表（with_detail=true 时返回）
                            items:
                              $ref: '#/components/schemas/CategorySample'
components:
  schemas:
    CodeMessage:
      type: object
      properties:
        code:
          type: integer
          description: 状态码
          example: 200
        msg:
          type: string
          description: 状态描述
      required:
        - code
        - msg
    CategorySample:
      type: object
      description: 文件类别样本
      properties:
        sample_id:
          type: string
          description: 样本ID
          example: '1234567890'
        file_name:
          type: string
          description: 文件名
          example: invoice_sample.pdf
      required:
        - sample_id
        - file_name
  securitySchemes:
    ApiId:
      type: apiKey
      in: header
      name: x-ti-app-id
    SecretCode:
      type: apiKey
      in: header
      name: x-ti-secret-code

````