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

# パイプラインファイルをアップロード

> ナレッジパイプラインで使用するファイルをアップロードします。`multipart/form-data` で単一ファイルを受け付けます。



## OpenAPI

````yaml /ja/api-reference/openapi_knowledge.json post /datasets/pipeline/file-upload
openapi: 3.0.1
info:
  title: ナレッジAPI
  description: >-
    ナレッジベース、ドキュメント、チャンク、メタデータ、タグの管理（作成、取得、設定を含む）のための API です。**注意：**単一のナレッジベース
    API キーは、同じアカウント配下のすべての可視ナレッジベースを操作する権限を持ちます。データセキュリティにご注意ください。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: Knowledge 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: 利用可能なモデルを取得するための操作です。
  - name: ナレッジパイプライン
    description: データソースプラグインとパイプライン実行を含むナレッジパイプラインの管理と実行のための操作です。
paths:
  /datasets/pipeline/file-upload:
    post:
      tags:
        - ナレッジパイプライン
      summary: パイプラインファイルをアップロード
      description: ナレッジパイプラインで使用するファイルをアップロードします。`multipart/form-data` で単一ファイルを受け付けます。
      operationId: uploadPipelineFileJa
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: アップロードするファイルです。
      responses:
        '201':
          description: ファイルが正常にアップロードされました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: アップロードされたファイルの一意識別子です。
                  name:
                    type: string
                    description: 元のファイル名です。
                  size:
                    type: integer
                    description: ファイルサイズ（バイト）。
                  extension:
                    type: string
                    description: ファイル拡張子。
                  mime_type:
                    type: string
                    nullable: true
                    description: >-
                      ファイルの MIME タイプです。アップロードに MIME タイプが含まれない場合、`null`
                      となることがあります。
                  created_by:
                    type: string
                    description: ファイルをアップロードしたユーザーの ID。
                  created_at:
                    type: string
                    nullable: true
                    description: アップロードのタイムスタンプ（ISO 8601 形式）です。レコード作成中は `null` となることがあります。
              examples:
                success:
                  summary: レスポンス例
                  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` : ファイルをアップロードしてください。
            - `filename_not_exists_error` : 指定されたファイル名が存在しません。
            - `too_many_files` : ファイルは 1 つのみ許可されています。
          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` : ファイルサイズの上限を超えています。'
          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` : 許可されていないファイルタイプです。'
          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 認証です。すべての API リクエストにおいて、`Authorization` HTTP ヘッダーに `Bearer `
        プレフィックスを付けた API Key を含めてください。例：`Authorization: Bearer {API_KEY}`。**API
        Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key
        の漏洩は深刻な結果につながる可能性があります。**

````