> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# Get a knowledge base source

GET https://api.synthflow.ai/v2/knowledge_base/{knowledge_base_id}/sources/{source_id}

Returns one source of a knowledge base. For a `text` source, `content` holds the full text and `url` is a download link for the same text that expires after 7 days. The list endpoint returns only a 200-character preview.

For every other source type `content` is `null`. Read `url` and `name` instead:

- `link`: `url` is the web address.
- `file`: `url` is a download link for the file. The link expires after 7 days.
- `crawl`: `url` is the address the crawl starts from.
- `integration`: `url` is the address of the connected account, for example `https://acme.zendesk.com`.


Reference: https://docs.synthflow.ai/api-reference/platform-api/knowledge-bases/get-knowledge-base-source

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.synthflow.ai/v2` (Global, default)
- `https://api.us.synthflow.ai/v2` (United States)
- `https://api.eu.synthflow.ai/v2` (European Union)

## Request

### Path parameters

- `knowledge_base_id` (string, required) — Knowledge base ID.
- `source_id` (string, required) — Source ID.

## Response

### 200

200

- `status` (string, optional) — Whether the request was successful.
- `response` (KnowledgeBaseKnowledgeBaseIdSourcesSourceIdGetResponsesContentApplicationJsonSchemaResponse, optional)

## Errors

### 404 Not Found Error

The knowledge base or the source does not exist in this workspace.

## Types

### KnowledgeBaseKnowledgeBaseIdSourcesSourceIdGetResponsesContentApplicationJsonSchemaResponse

- `id` (string, optional) — Unique identifier of the source.
- `type` (enum, optional) — Source type.
  - Allowed values: `crawl`, `file`, `integration`, `link`, `text`
- `name` (string, optional) — Display name of the source.
- `content` (string, optional, nullable) — Full text of a `text` source. `null` for every other source type.
- `url` (string, optional) — Address of the source. For `text` and `file` sources, a download link that expires after 7 days.
- `created_at` (datetime, optional) — Timestamp when the source was created (ISO 8601).
- `updated_at` (datetime, optional, nullable) — Timestamp when the source was last updated (ISO 8601). `null` if it was never updated.

## Examples

**Response**

```json
{
  "status": "ok",
  "response": {
    "id": "1739253053024x397207388602947462",
    "type": "text",
    "name": "Return policy",
    "content": "Our return policy allows customers to return any item within 30 days of delivery. Refunds go back to the original payment method within 5 business days.",
    "url": "https://storage.googleapis.com/example-bucket/return-policy.txt",
    "created_at": {},
    "updated_at": {}
  }
}
```

**SDK Code**

```python get-knowledge-base-source_example
import requests

url = "https://api.synthflow.ai/v2/knowledge_base/knowledge_base_id/sources/source_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```go get-knowledge-base-source_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthflow.ai/v2/knowledge_base/knowledge_base_id/sources/source_id"

	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(res)
	fmt.Println(string(body))

}
```

```ruby get-knowledge-base-source_example
require 'uri'
require 'net/http'

url = URI("https://api.synthflow.ai/v2/knowledge_base/knowledge_base_id/sources/source_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java get-knowledge-base-source_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.synthflow.ai/v2/knowledge_base/knowledge_base_id/sources/source_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```csharp get-knowledge-base-source_example
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/knowledge_base/knowledge_base_id/sources/source_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift get-knowledge-base-source_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/knowledge_base/knowledge_base_id/sources/source_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```