> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# Get Knowledge Source

GET https://api.elevenlabs.io/v1/reception/knowledge-sources/{source_id}

Get a specific knowledge source by ID

Reference: https://elevenlabs.io/docs/api-reference/reception/knowledge-sources/get

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `source_id` (string, required) — ID of the knowledge source. Returned when you add one; list them with `GET /v1/reception/knowledge-sources`.

### Headers

- `xi-workspace-id` (string, required) — The customer workspace a reseller's API key acts on.

## Response

### 200

Successful Response

- `id` (string, required) — The knowledge source's ID.
- `source_type` (enum, optional, default: file) — Whether the source is an uploaded file or a web page or site.
  - Allowed values: `file`, `url`
- `source_url` (string, optional, nullable) — The page or site URL for 'url' sources.
- `last_scraped_at_unix` (integer, optional, nullable) — When the URL was last read, as a Unix timestamp in seconds.
- `original_filename` (string, optional, default: ) — The uploaded file's name for 'file' sources; empty for URLs.
- `content_type` (string, optional, default: ) — The uploaded file's MIME type; empty for URLs.
- `file_size_bytes` (integer, optional, default: 0) — The uploaded file's size in bytes; 0 for URLs.
- `status` (enum, optional, default: processing) — Where processing stands: 'processing', 'ready' or 'error'.
  - Allowed values: `processing`, `ready`, `error`
- `error_message` (string, optional, nullable) — Why processing failed, when status is 'error'.
- `failure_reason` (enum, optional, nullable) — Machine-readable cause of the failure, when status is 'error'.
  - Allowed values: `blocked_url`, `dns_failure`, `host_unreachable`, `access_refused`, `crawl_timeout`, `no_pages`, `no_content`, `upstream_timeout`, `upstream_error`, `unknown`
- `crawl_entire_site` (boolean, optional, default: false) — Whether the whole site was crawled rather than the single page at source_url.
- `scraped_pages_count` (integer, optional, default: 0) — How many pages were read for 'url' sources.
- `content_preview` (string, optional, nullable) — A short plain-text preview of the content.
- `processing_started_at_unix` (integer, optional, nullable) — When processing started, as a Unix timestamp in seconds.
- `created_at_unix` (integer, optional) — When this was created, as a Unix timestamp in seconds.
- `updated_at_unix` (integer, optional) — When this was last updated, as a Unix timestamp in seconds.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

- string
- integer

## Examples

**Response**

```json
{
  "id": "ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y",
  "source_type": "file",
  "source_url": "https://example.com",
  "last_scraped_at_unix": 1767225600,
  "original_filename": "price-list.pdf",
  "content_type": "application/pdf",
  "file_size_bytes": 204800,
  "status": "processing",
  "error_message": "We couldn't reach that website.",
  "failure_reason": "blocked_url",
  "crawl_entire_site": false,
  "scraped_pages_count": 12,
  "content_preview": "Welcome to Main Street Salon. We offer haircuts, color and styling.",
  "processing_started_at_unix": 1767225600,
  "created_at_unix": 1767225600,
  "updated_at_unix": 1767225600
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y"

headers = {"xi-workspace-id": "xi-workspace-id"}

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

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y';
const options = {method: 'GET', headers: {'xi-workspace-id': 'xi-workspace-id'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("xi-workspace-id", "xi-workspace-id")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y")

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

request = Net::HTTP::Get.new(url)
request["xi-workspace-id"] = 'xi-workspace-id'

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y")
  .header("xi-workspace-id", "xi-workspace-id")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y', [
  'headers' => [
    'xi-workspace-id' => 'xi-workspace-id',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y");
var request = new RestRequest(Method.GET);
request.AddHeader("xi-workspace-id", "xi-workspace-id");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["xi-workspace-id": "xi-workspace-id"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/reception/knowledge-sources/ksource_4801jx8k3m5n7p9q2r4s6t8v0w2y")! 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()
```