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

# 上传单个类别样本

> 为指定文件类别上传样本文件

> ⚠️ 该接口目前仍在提供服务，但后续将停止维护。推荐使用 [上传类别样本](/api-reference/文件类别样本/上传类别样本) 接口替代。




## OpenAPI

````yaml /docflow/cn/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/category/sample/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/upload:
    post:
      tags:
        - 已废弃
      summary: 上传单个类别样本
      description: >
        为指定文件类别上传样本文件


        > ⚠️ 该接口目前仍在提供服务，但后续将停止维护。推荐使用 [上传类别样本](/api-reference/文件类别样本/上传类别样本)
        接口替代。
      operationId: uploadCategorySample
      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'
                file:
                  type: string
                  format: binary
                  description: 样本文件
                with_detail:
                  type: boolean
                  description: |
                    是否返回完整详情。传 true 时响应额外返回该分类的全部样本列表。
                    不传或为 false 时仅返回 sample_id。
              required:
                - workspace_id
                - category_id
                - file
      responses:
        '200':
          description: 成功上传类别样本
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CodeMessage'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          sample_id:
                            type: string
                            description: 样本ID
                            example: '1234567890'
                          samples:
                            type: array
                            description: 该分类的全部样本列表（with_detail=true 时返回）
                            items:
                              $ref: '#/components/schemas/CategorySample'
                        required:
                          - sample_id
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

````