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

# Upload Pipeline File

> Upload a file for use in a knowledge pipeline. Accepts a single file via `multipart/form-data`.



## OpenAPI

````yaml /en/api-reference/openapi_knowledge.json post /datasets/pipeline/file-upload
openapi: 3.0.1
info:
  title: Knowledge API
  description: >-
    API for managing knowledge bases, documents, chunks, metadata, and tags,
    including creation, retrieval, and configuration. **Note:** A single
    Knowledge Base API key has permission to operate on all visible knowledge
    bases under the same account. Please pay attention to data security.
  version: 1.0.0
servers:
  - url: '{apiBaseUrl}'
    description: The base URL for the Knowledge API.
    variables:
      apiBaseUrl:
        default: https://api.dify.ai/v1
        description: Actual base URL of the API
security:
  - ApiKeyAuth: []
tags:
  - name: Knowledge Bases
    description: >-
      Operations for managing knowledge bases, including creation,
      configuration, and retrieval.
  - name: Documents
    description: >-
      Operations for creating, updating, and managing documents within a
      knowledge base.
  - name: Chunks
    description: Operations for managing document chunks and child chunks.
  - name: Metadata
    description: >-
      Operations for managing knowledge base metadata fields and document
      metadata values.
  - name: Tags
    description: Operations for managing knowledge base tags and tag bindings.
  - name: Models
    description: Operations for retrieving available models.
  - name: Knowledge Pipeline
    description: >-
      Operations for managing and running knowledge pipelines, including
      datasource plugins and pipeline execution.
paths:
  /datasets/pipeline/file-upload:
    post:
      tags:
        - Knowledge Pipeline
      summary: Upload Pipeline File
      description: >-
        Upload a file for use in a knowledge pipeline. Accepts a single file via
        `multipart/form-data`.
      operationId: uploadPipelineFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to upload.
      responses:
        '201':
          description: File uploaded successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier of the uploaded file.
                  name:
                    type: string
                    description: Original file name.
                  size:
                    type: integer
                    description: File size in bytes.
                  extension:
                    type: string
                    description: File extension.
                  mime_type:
                    type: string
                    nullable: true
                    description: >-
                      MIME type of the file. May be `null` if the upload did not
                      include one.
                  created_by:
                    type: string
                    description: ID of the user who uploaded the file.
                  created_at:
                    type: string
                    nullable: true
                    description: >-
                      Upload timestamp in ISO 8601 format. May be `null` while
                      the record is being created.
              examples:
                success:
                  summary: Response Example
                  value:
                    id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    name: report.pdf
                    size: 524288
                    extension: pdf
                    mime_type: application/pdf
                    created_by: ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4
                    created_at: '2025-03-06T12:00:00'
        '400':
          description: >-
            - `no_file_uploaded` : Please upload your file.

            - `filename_not_exists_error` : The specified filename does not
            exist.

            - `too_many_files` : Only one file is allowed.
          content:
            application/json:
              examples:
                no_file_uploaded:
                  summary: no_file_uploaded
                  value:
                    status: 400
                    code: no_file_uploaded
                    message: Please upload your file.
                filename_not_exists_error:
                  summary: filename_not_exists_error
                  value:
                    status: 400
                    code: filename_not_exists_error
                    message: The specified filename does not exist.
                too_many_files:
                  summary: too_many_files
                  value:
                    status: 400
                    code: too_many_files
                    message: Only one file is allowed.
        '413':
          description: '`file_too_large` : File size exceeded.'
          content:
            application/json:
              examples:
                file_too_large:
                  summary: file_too_large
                  value:
                    status: 413
                    code: file_too_large
                    message: File size exceeded.
        '415':
          description: '`unsupported_file_type` : File type not allowed.'
          content:
            application/json:
              examples:
                unsupported_file_type:
                  summary: unsupported_file_type
                  value:
                    status: 415
                    code: unsupported_file_type
                    message: File type not allowed.
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key authentication. For all API requests, include your API Key in
        the `Authorization` HTTP Header, prefixed with `Bearer `. Example:
        `Authorization: Bearer {API_KEY}`. **Strongly recommend storing your API
        Key on the server-side, not shared or stored on the client-side, to
        avoid possible API-Key leakage that can lead to serious consequences.**

````