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

# ソースの接続一覧を取得

> このナレッジベースの接続を古い順に一覧表示します。接続の `id` を [ソースを作成](/ja/api-reference/sources/create-source) の `connectionId` に渡すと、その接続を通じて読み取るソースを追加できます。

接続がこの一覧に含まれるのは、そのプロバイダーのソースを Dify でナレッジベースに追加した後です。新しいプロバイダーを使うには、最初のソースを Dify で追加してください。接続はナレッジベースごとに独立しています。`status` が `active` で、`provider_id` と `configuration` が目的のプロバイダーと認証情報に一致する接続を選んでください。

ソースを追加する手順については、[ソースの追加](/ja/api-reference/guides/knowledge-base#add-a-source) を参照してください。



## OpenAPI

````yaml /ja/api-reference/openapi_service.json get /knowledge-fs/spaces/{knowledge_base_id}/source-connections
openapi: 3.0.1
info:
  description: >-
    Dify アプリケーションとナレッジベースのための REST API です。アプリケーション系エンドポイントはアプリの API
    キーで、ナレッジ系エンドポイントはナレッジベースの API キーで認証します。
  title: Dify サービス API
  version: 1.0.0
servers:
  - description: Dify サービス API のベース URL です。セルフホスト環境では、独自の API ベース URL に置き換えてください。
    url: https://{api_base_url}
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API ベース URL のホストとパス（`https://` を除く）。
security:
  - ApiKeyAuth: []
tags:
  - description: チャットメッセージとインタラクションに関連する操作です。
    name: チャットメッセージ
  - description: ファイルのアップロードとプレビューの操作です。
    name: ファイル操作
  - description: エンドユーザー情報に関連する操作です。
    name: エンドユーザー
  - description: ユーザーフィードバックの操作です。
    name: メッセージフィードバック
  - description: 会話管理に関連する操作です。
    name: 会話管理
  - description: テキスト読み上げと音声認識の操作です。
    name: 音声・テキスト変換
  - description: アプリケーション設定と情報を取得する操作です。
    name: アプリケーション設定
  - description: ダイレクト返信用のアノテーション管理に関連する操作です。
    name: アノテーション管理
  - description: 人間の入力を要する一時停止中のワークフローの再開操作です。
    name: 人間の入力
  - description: ワークフローの実行と管理のための操作です。
    name: ワークフロー実行
  - description: テキスト生成に関連する操作です。
    name: 完了メッセージ
  - description: ナレッジベースの作成、設定、取得を含むナレッジベース管理の操作です。
    name: ナレッジベース
  - description: ナレッジベース内のドキュメントの作成、更新、管理のための操作です。
    name: ドキュメント
  - description: ドキュメントチャンクと子チャンクの管理のための操作です。
    name: チャンク
  - description: ナレッジベースのメタデータフィールドとドキュメントメタデータ値の管理のための操作です。
    name: メタデータ
  - description: ナレッジベースタグとタグバインディングの管理のための操作です。
    name: タグ管理
  - description: 利用可能なモデルを取得するための操作です。
    name: モデル
  - description: データソースプラグインとパイプライン実行を含むナレッジパイプラインの管理と実行のための操作です。
    name: ナレッジパイプライン
  - description: ナレッジベースに質問し、回答をストリーミングで受け取ります。
    name: クエリ
  - description: クエリが何を検索したか、またその理由を確認します。
    name: クエリ記録
  - description: リサーチの質問をバックグラウンドで実行し、その結果を取得します。
    name: リサーチタスク
  - description: ナレッジベースのドキュメントと、そのファイル、リビジョン、チャンクを読み取り、ドキュメントにメタデータのラベルを付けます。
    name: ドキュメントとチャンク
  - description: インデックス処理の追跡、キャンセル、再試行と、ナレッジベースのバックグラウンドタスクの一覧表示を行います。
    name: インデックスタスク
  - description: ドキュメントファイル、ファイルのバッチ、またはソースの削除を、完了するまで追跡します。
    name: 削除ジョブ
  - description: ナレッジベースにデータを供給するソース、その同期スケジュール、接続を管理します。
    name: ソース
  - description: ソースの即時同期、ウェブサイトのページまたはプロバイダーのアイテムのインポート、実行の追跡、キャンセル、再試行を行います。
    name: ソースの同期とインポート
  - description: ナレッジベースのモデルと検索設定の読み取りと変更、および変更によって始まる移行の追跡を行います。
    name: 設定
paths:
  /knowledge-fs/spaces/{knowledge_base_id}/source-connections:
    get:
      tags:
        - Sources
      summary: ソースの接続一覧を取得
      description: >-
        このナレッジベースの接続を古い順に一覧表示します。接続の `id` を
        [ソースを作成](/ja/api-reference/sources/create-source) の `connectionId`
        に渡すと、その接続を通じて読み取るソースを追加できます。


        接続がこの一覧に含まれるのは、そのプロバイダーのソースを Dify
        でナレッジベースに追加した後です。新しいプロバイダーを使うには、最初のソースを Dify
        で追加してください。接続はナレッジベースごとに独立しています。`status` が `active` で、`provider_id` と
        `configuration` が目的のプロバイダーと認証情報に一致する接続を選んでください。


        ソースを追加する手順については、[ソースの追加](/ja/api-reference/guides/knowledge-base#add-a-source)
        を参照してください。
      operationId: listSourceConnections
      parameters:
        - description: >-
            ナレッジベース ID です。ナレッジベースの **API アクセス** ダイアログに表示されるサービス API
            エンドポイントの最後のセグメント（`…/knowledge-fs/spaces/<knowledge base
            ID>`）です。アドレスバーでは `/datasets/new/` の後のセグメントです。
          in: path
          name: knowledge_base_id
          required: true
          schema:
            format: uuid
            type: string
        - description: 前のページの `next_cursor` から取得したカーソルです。
          in: query
          name: cursor
          required: false
          schema:
            maxLength: 4096
            minLength: 1
            type: string
        - description: 1 ページあたりの接続数です。
          in: query
          name: limit
          required: false
          schema:
            default: 50
            maximum: 200
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  summary: レスポンス例
                  value:
                    data:
                      - auth_kind: endpoint
                        configuration:
                          credentialId: 4b1f2e3d-5c6a-4b7e-9f80-1a2b3c4d5e6f
                          datasource: notion_datasource
                          pluginId: langgenius/notion_datasource
                          provider: notion_datasource
                          providerKind: online-document
                        created_at: '2026-09-01T07:58:00Z'
                        error_code: null
                        expires_at: null
                        id: c3d4e5f6-7a8b-4c9d-8e0f-1a2b3c4d5e6f
                        knowledge_space_id: 0a9d3c2e-5b6f-4e1a-8c7d-2f3e4a5b6c7d
                        name: Acme Notion
                        provider_id: plugin-daemon-online-document
                        scopes: []
                        status: active
                        updated_at: '2026-09-01T07:58:00Z'
                        version: 1
                    next_cursor: null
              schema:
                properties:
                  data:
                    description: 1 ページ分の接続です。古い順に並びます。
                    items:
                      $ref: '#/components/schemas/KnowledgeBaseSourceConnection'
                    type: array
                  next_cursor:
                    description: 次のページのカーソルです。最後のページでは `null` です。`cursor` として送り返してください。
                    nullable: true
                    type: string
                type: object
          description: 1 ページ分の接続です。
        '400':
          content:
            application/json:
              examples:
                knowledge_fs_invalid_request_local:
                  summary: knowledge_fs_invalid_request (request validation)
                  value:
                    code: knowledge_fs_invalid_request
                    message: Agent Knowledge Base request is invalid.
                    status: 400
                    violations:
                      - field:
                          - limit
                        type: less_than_equal
                knowledge_fs_invalid_request_upstream:
                  summary: knowledge_fs_invalid_request (rejected)
                  value:
                    code: knowledge_fs_invalid_request
                    failure:
                      category: validation
                      code: KNOWLEDGE_FS_INVALID_REQUEST
                      message: The Agent Knowledge Base request is invalid.
                      retryPolicy: never
                      traceId: 7f3c1a90-2e64-4b7d-8a51-6c0d9e2f4b83
                    message: The Agent Knowledge Base request is invalid.
                    status: 400
          description: >-
            - `knowledge_fs_invalid_request`：リクエストが検証に失敗しました。`violations`
            には、問題のあるフィールドがそれぞれ示されます。

            - `knowledge_fs_invalid_request`：`cursor` が `next_cursor`
            から得た値ではありません。
        '401':
          content:
            application/json:
              examples:
                knowledge_fs_invalid_credential:
                  summary: knowledge_fs_invalid_credential
                  value:
                    code: knowledge_fs_invalid_credential
                    message: Invalid Agent Knowledge Base service credential.
                    status: 401
                unauthorized:
                  summary: unauthorized
                  value:
                    code: unauthorized
                    message: Access token is invalid
                    status: 401
          description: >-
            - `unauthorized`：`Authorization` ヘッダーがないか、キーが不明であるか、ナレッジベースの API
            キーではありません。

            - `knowledge_fs_invalid_credential`：キーは有効ですが、キーのワークスペースにこの ID
            のナレッジベースが存在しないか、キーがワークスペースに紐付いていません。
        '403':
          content:
            application/json:
              examples:
                forbidden:
                  summary: forbidden (rate limit)
                  value:
                    code: forbidden
                    message: >-
                      Sorry, you have reached the knowledge base request rate
                      limit of your subscription.
                    status: 403
                knowledge_fs_access_denied_scope:
                  summary: knowledge_fs_access_denied (key scope)
                  value:
                    code: knowledge_fs_access_denied
                    message: Agent Knowledge Base operation is not allowed.
                    status: 403
          description: >-
            -
            `knowledge_fs_access_denied`：キーのアクセス範囲がほかのナレッジベースに限定されているか、このナレッジベースで
            **API アクセス** がオフになっています。または、ナレッジベースがアクティブではありません。

            - `forbidden`：Dify Cloud
            で、ワークスペースがサブスクリプションで定められたナレッジベースのリクエストレート制限に達しました。読み取りを含め、すべての呼び出しがカウントされます。
        '404':
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found (feature off)
                  value:
                    code: not_found
                    message: >-
                      The requested URL was not found on the server. If you
                      entered the URL manually please check your spelling and
                      try again.
                    status: 404
          description: '- `not_found`：このデプロイ環境では Agent ナレッジベース機能が無効になっています。'
        '502':
          content:
            application/json:
              examples:
                knowledge_fs_upstream_unavailable:
                  summary: knowledge_fs_upstream_unavailable (service error)
                  value:
                    code: knowledge_fs_upstream_unavailable
                    failure:
                      action: contact_admin
                      category: internal
                      code: KNOWLEDGE_FS_INTERNAL_ERROR
                      message: >-
                        Agent Knowledge Base could not complete the operation.
                        Try again, or contact an administrator with the error
                        reference.
                      retryPolicy: manual
                      traceId: 5e2a9c17-3b4d-4f60-8a1b-2c3d4e5f6a7b
                    message: >-
                      Agent Knowledge Base could not complete the operation. Try
                      again, or contact an administrator with the error
                      reference.
                    status: 502
                knowledge_fs_upstream_unavailable_transport:
                  summary: knowledge_fs_upstream_unavailable (no response)
                  value:
                    code: knowledge_fs_upstream_unavailable
                    message: Agent Knowledge Base is unavailable.
                    status: 502
          description: >-
            -
            `knowledge_fs_upstream_unavailable`：時間内に応答が返らなかったか、応答を読み取れませんでした。しばらく待ってから再試行してください。
        '503':
          content:
            application/json:
              examples:
                knowledge_fs_operation_unavailable:
                  summary: knowledge_fs_operation_unavailable
                  value:
                    code: knowledge_fs_operation_unavailable
                    message: Agent Knowledge Base operation is not available.
                    status: 503
                knowledge_fs_operation_unavailable_upstream:
                  summary: knowledge_fs_operation_unavailable (temporary)
                  value:
                    code: knowledge_fs_operation_unavailable
                    failure:
                      action: retry
                      category: dependency
                      code: KNOWLEDGE_FS_UNAVAILABLE
                      message: >-
                        A service required by Agent Knowledge Base is
                        temporarily unavailable.
                      retryPolicy: manual
                      traceId: 5e2a9c17-3b4d-4f60-8a1b-2c3d4e5f6a7b
                    message: >-
                      A service required by Agent Knowledge Base is temporarily
                      unavailable.
                    status: 503
          description: >-
            - `knowledge_fs_operation_unavailable`：このワークスペースで Agent
            ナレッジベース機能が設定されていないか、このデプロイ環境ではこの操作を利用できません。または、リクエストの認可中に、このナレッジベースに対するキーのアクセス権が変更されました。

            -
            `knowledge_fs_operation_unavailable`：現在このリクエストを処理できません。`failure.retryPolicy`
            に従ってください。
components:
  schemas:
    KnowledgeBaseSourceConnection:
      properties:
        auth_kind:
          description: 接続の認証方式です。Dify が管理する接続では `endpoint` です。
          type: string
        configuration:
          additionalProperties: true
          description: >-
            秘密情報を含まない設定で、`credentialId`（接続が読み取りに使用する Dify
            の認証情報）、`pluginId`、`provider`、`datasource`、`providerKind`（`website`、`online-document`、`online-drive`
            のいずれか）があります。これらを照合して、プロバイダーと認証情報に対応する接続を選びます。
          type: object
        created_at:
          description: 作成日時（ISO 8601）です。
          type: string
        error_code:
          description: '`status` が `error` の場合のエラーコードです。'
          nullable: true
          type: string
        expires_at:
          description: 接続の有効期限（ISO 8601）です。Dify が管理する接続では `null` です。
          nullable: true
          type: string
        id:
          description: >-
            接続 ID です。[ソースを作成](/ja/api-reference/sources/create-source) に
            `connectionId` として渡します。
          type: string
        knowledge_space_id:
          description: ナレッジベースの内部 ID です。パスのナレッジベース ID とは異なります。
          type: string
        name:
          description: Dify での認証情報の名前、またはプロバイダーの名前です。
          type: string
        provider_id:
          description: >-
            プロバイダーで、`plugin-daemon-website`、`plugin-daemon-online-document`、`plugin-daemon-online-drive`
            のいずれかです。
          type: string
        scopes:
          description: Dify が管理する接続では空です。
          items:
            type: string
          type: array
        status:
          description: >-
            `provisioning`、`active`、`expired`、`error`、`revoked`
            のいずれかです。[ソースを作成](/ja/api-reference/sources/create-source) には
            `active` の接続が必要です。
          type: string
        updated_at:
          description: 最終更新日時（ISO 8601）です。
          type: string
        version:
          description: 接続のバージョンです。
          type: integer
      type: object
  securitySchemes:
    ApiKeyAuth:
      bearerFormat: API_KEY
      description: >-
        すべてのリクエストは API キーで認証します：`Authorization: Bearer
        {API_KEY}`。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API
        キーを使用します（[Dify API クイックスタート](/ja/api-reference/guides/get-started)）。


        キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP
        `401`（`unauthorized`）で失敗します。
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.