# Add knowledge source

Source: <https://everruns.com/docs/api/operations/add_knowledge_source/>

[Docs](https://everruns.com/docs/)/[API reference](https://everruns.com/docs/api/)/[Knowledge & memory](https://everruns.com/docs/api/groups/knowledge-memory/)/Add knowledge source

# Add knowledge source

Preview

Give agents persistent memory and versioned file collections. Manage sources, files and optional search indexes.

Public APIEverruns Cloud and self-hosted Platform

POST`/v1/knowledge/{collection_id}/sources`

See [authentication](https://everruns.com/docs/sre/runbooks/authentication/) for credentials and permissions.

## Parameters

### Path Parameters

**collection_id**

required

string

Knowledge collection

## Request Bodyrequired

Media typeapplication/json

A connected repository mounted beneath a non-overlapping collection path.

object

**config**

Adapter-specific repository, revision and root-folder configuration, without credentials.

**connection_owner**

Optional GitHub connection owner; existing connection authorization still applies.

string | null format: uuid

**kind**

required

Source adapter: `github` reuses a connection; `git` reads a public HTTPS repository.

string

**root_path**

Collection-relative root under which the source hierarchy is preserved.

string

### Example generated

```json
{
  "config": "example",
  "connection_owner": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
  "kind": "example",
  "root_path": "example"
}
```

## Responses

200Connected source

### 200

Connected source

Media typeapplication/json

### Example generated

```json
example
```

FetchcURL

Request

```js
const url = 'https://app.everruns.com/api/v1/knowledge/example/sources';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"config":"example","connection_owner":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","kind":"example","root_path":"example"}'
};


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

Request

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/knowledge/example/sources \
  --header 'Content-Type: application/json' \
  --data '{ "config": "example", "connection_owner": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "kind": "example", "root_path": "example" }'
```

Additional language examples require JavaScript. The default request example is available above.

200

200 · Connected source

No response body example is declared for this status.

## Matching endpoints