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

# Base64ファイルアップロード

> - Base64エンコーディングとData URL形式に対応
- ファイルタイプを自動識別し分類保存
- アクセス可能なファイルURLとダウンロードリンクを返却
- ファイルは72時間後に期限切れになります
- 現在のユーザークォータには制限があります。クォータを使い切るとアップロードに失敗します。永続的な保存が必要な場合はローカルに保存してください

**注意：**
ファイルアップロードAPIのベースURLは`https://files-api.evolink.ai`です



## OpenAPI

````yaml ja/api-manual/file-series/upload-base64.json POST /api/v1/files/upload/base64
openapi: 3.1.0
info:
  title: Base64ファイルアップロードAPI
  description: Base64 エンコーディングでファイルサーバーにファイルをアップロード
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://files-api.evolink.ai
    description: ファイルサービス環境
security:
  - bearerAuth: []
tags:
  - name: ファイルアップロード
    description: ファイルアップロード関連API
paths:
  /api/v1/files/upload/base64:
    post:
      tags:
        - ファイルアップロード
      summary: Base64ファイルアップロード
      description: |-
        - Base64エンコーディングとData URL形式に対応
        - ファイルタイプを自動識別し分類保存
        - アクセス可能なファイルURLとダウンロードリンクを返却
        - ファイルは72時間後に期限切れになります
        - 現在のユーザークォータには制限があります。クォータを使い切るとアップロードに失敗します。永続的な保存が必要な場合はローカルに保存してください

        **注意：**
        ファイルアップロードAPIのベースURLは`https://files-api.evolink.ai`です
      operationId: uploadFileBase64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Base64UploadRequest'
            examples:
              base64_upload:
                summary: Base64ファイルアップロード
                value:
                  base64_data: data:image/png;base64,iVBORw0KGgo...
      responses:
        '200':
          description: ファイルのアップロードに成功しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
components:
  schemas:
    Base64UploadRequest:
      type: object
      required:
        - base64_data
      properties:
        base64_data:
          type: string
          description: >-
            Base64エンコードされたファイルデータ


            **対応形式：**

            - Data URL形式：`data:image/png;base64,iVBORw0KGgo...`

            - 純粋なBase64エンコーディング：`iVBORw0KGgo...`


            **注意：**

            - リクエストあたり最大`1`枚の画像

            -
            現在アップロード可能なファイル形式：`image/jpeg`、`image/png`、`image/gif`、`image/webp`のみ
          example: data:image/png;base64,iVBORw0KGgo...
        upload_path:
          type: string
          description: |-
            カスタムアップロードパス

            **注意：**
            - 指定しない場合、システムがファイルタイプに基づいて自動的に分類します
          example: avatars
        file_name:
          type: string
          description: |-
            カスタムファイル名

            **注意：**
            - 指定しない場合、システムが自動的に一意のファイル名を生成します
          example: avatar.png
    FileUploadResponse:
      type: object
      properties:
        success:
          type: boolean
          description: リクエストが成功したかどうか
          example: true
        code:
          type: integer
          description: レスポンスステータスコード
          example: 200
        msg:
          type: string
          description: レスポンスメッセージ
          example: ファイルのアップロードに成功しました
        data:
          $ref: '#/components/schemas/FileData'
    FileData:
      type: object
      properties:
        file_id:
          type: string
          description: 一意のファイル識別子
          example: file_abc123
        file_name:
          type: string
          description: 保存されたファイル名
          example: avatar.png
        original_name:
          type: string
          description: 元のファイル名
          example: avatar.png
        file_size:
          type: integer
          description: ファイルサイズ（バイト）
          example: 2048
        mime_type:
          type: string
          description: ファイルMIMEタイプ
          example: image/png
        upload_path:
          type: string
          description: ファイル保存パス
          example: avatars
        file_url:
          type: string
          format: uri
          description: ファイルアクセスURL
          example: https://files.evolink.ai/avatars/avatar.png
        download_url:
          type: string
          format: uri
          description: ファイルダウンロードURL
          example: https://files.evolink.ai/api/v1/files/download/file_abc123
        upload_time:
          type: string
          format: date-time
          description: アップロード時間（ISO 8601 フォーマット）
          example: '2025-10-09T00:00:00+08:00'
        expires_at:
          type: string
          format: date-time
          description: ファイル有効期限（ISO 8601形式）
          example: '2025-10-12T00:00:00+08:00'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべてのAPIにBearer Token認証が必要です##

        **APIキーの取得：**

        [APIキー管理ページ](https://evolink.ai/dashboard/keys)にアクセスしてAPIキーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````