ソースの接続一覧を取得
このナレッジベースの接続を古い順に一覧表示します。接続の id を ソースを作成 の connectionId に渡すと、その接続を通じて読み取るソースを追加できます。
接続がこの一覧に含まれるのは、そのプロバイダーのソースを Dify でナレッジベースに追加した後です。新しいプロバイダーを使うには、最初のソースを Dify で追加してください。接続はナレッジベースごとに独立しています。status が active で、provider_id と configuration が目的のプロバイダーと認証情報に一致する接続を選んでください。
ソースを追加する手順については、ソースの追加 を参照してください。
1 min read
get/knowledge-fs/spaces/{knowledge_base_id}/source-connections
Request example
curl --request GET \
--url https://api.dify.ai/v1/knowledge-fs/spaces/{knowledge_base_id}/source-connections \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dify.ai/v1/knowledge-fs/spaces/{knowledge_base_id}/source-connections"
headers = {
"Authorization": "Bearer <token>",
}
response = requests.request("GET", url, headers=headers)
print(response.text)const response = await fetch('https://api.dify.ai/v1/knowledge-fs/spaces/{knowledge_base_id}/source-connections', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.dify.ai/v1/knowledge-fs/spaces/{knowledge_base_id}/source-connections',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.dify.ai/v1/knowledge-fs/spaces/{knowledge_base_id}/source-connections"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dify.ai/v1/knowledge-fs/spaces/{knowledge_base_id}/source-connections"))
.header("Authorization", "Bearer <token>")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());require 'uri'
require 'net/http'
url = URI('https://api.dify.ai/v1/knowledge-fs/spaces/{knowledge_base_id}/source-connections')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = url.scheme == 'https'
request = Net::HTTP::Get.new(url)
request['Authorization'] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyResponse
{
"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
}{
"code": "knowledge_fs_invalid_request",
"message": "Agent Knowledge Base request is invalid.",
"status": 400,
"violations": [
{
"field": [
"limit"
],
"type": "less_than_equal"
}
]
}{
"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
}{
"code": "knowledge_fs_invalid_credential",
"message": "Invalid Agent Knowledge Base service credential.",
"status": 401
}{
"code": "unauthorized",
"message": "Access token is invalid",
"status": 401
}{
"code": "forbidden",
"message": "Sorry, you have reached the knowledge base request rate limit of your subscription.",
"status": 403
}{
"code": "knowledge_fs_access_denied",
"message": "Agent Knowledge Base operation is not allowed.",
"status": 403
}{
"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
}{
"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
}{
"code": "knowledge_fs_upstream_unavailable",
"message": "Agent Knowledge Base is unavailable.",
"status": 502
}{
"code": "knowledge_fs_operation_unavailable",
"message": "Agent Knowledge Base operation is not available.",
"status": 503
}{
"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
}get/knowledge-fs/spaces/{knowledge_base_id}/source-connections
Authorization
すべてのリクエストは API キーで認証します:Authorization: Bearer {API_KEY}。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します(Dify API クイックスタート)。
キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP 401(unauthorized)で失敗します。
Path parameters
ナレッジベース ID です。ナレッジベースの API アクセス ダイアログに表示されるサービス API エンドポイントの最後のセグメント(
…/knowledge-fs/spaces/<knowledge base ID>)です。アドレスバーでは /datasets/new/ の後のセグメントです。Query parameters
Responses
application/json
1 ページ分の接続です。
1 ページ分の接続です。古い順に並びます。
Show child attributesHide child attributes
接続の認証方式です。Dify が管理する接続では
endpoint です。秘密情報を含まない設定で、
credentialId(接続が読み取りに使用する Dify の認証情報)、pluginId、provider、datasource、providerKind(website、online-document、online-drive のいずれか)があります。これらを照合して、プロバイダーと認証情報に対応する接続を選びます。作成日時(ISO 8601)です。
status が error の場合のエラーコードです。接続の有効期限(ISO 8601)です。Dify が管理する接続では
null です。ナレッジベースの内部 ID です。パスのナレッジベース ID とは異なります。
Dify での認証情報の名前、またはプロバイダーの名前です。
プロバイダーで、
plugin-daemon-website、plugin-daemon-online-document、plugin-daemon-online-drive のいずれかです。Dify が管理する接続では空です。
最終更新日時(ISO 8601)です。
接続のバージョンです。
次のページのカーソルです。最後のページでは
null です。cursor として送り返してください。