> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.logicdialog.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.logicdialog.ai/_mcp/server.

# Update a connected knowledge source

PUT https://app.logicdialog.ai/api/workspaces/{workspaceId}/knowledge/sources/{sourceKey}
Content-Type: application/json

Update a connected knowledge source. Requires workspace membership and workspace.edit. Writes require a selected workspace workstream.

Reference: https://api.logicdialog.ai/api-reference/knowledge/put-knowledge-source

## Authentication

- `Authorization` header (bearer token, required) — Kinde access token with the configured LogicDialog audience and workspace membership/permissions. Channel API keys cannot authenticate management operations.

## Request

### Path parameters

- `workspaceId` (string, required)
- `sourceKey` (string, required)

### Query parameters

- `branch` (string, required)

### Body (application/json)

This endpoint expects a KnowledgeConnectorInput.

- `title` (string, required)
- `type` (enum, required)
  - Allowed values: `wordpress`, `umbraco`, `power_automate`, `logicdialog`, `url`, `sitemap`, `api`, `manual`, `webpages`
- `connector` (KnowledgeConnectorInputConnector, required)
- `branch` (string, optional)
- `key` (string, optional)
- `url` (string, optional)
- `credentials` (KnowledgeConnectorInputCredentials, optional)

## Response

### 200

Operation completed

## Errors

### 400 Bad Request Error

Invalid configuration or missing workstream

- `any`

### 403 Forbidden Error

Permission denied

- `any`

### 409 Conflict Error

Resolve the source mapping or workstream conflict before retrying

- `any`

## Types

### KnowledgeConnectorInputConnector

- `enabled` (boolean, optional, default: true)
- `environment` (string, optional)
- `publish` (KnowledgeConnectorInputConnectorPublish, optional)
- `contentTypes` (list of string, optional)
- `excludeUrls` (list of string, optional)
- `faqIds` (list of string, optional)
- `language` (string, optional)
- `profile` (enum, optional)
  - Allowed values: `whole-document`, `numbered-headings`, `bold-headings`, `headings`
- `files` (map from string to string, optional)
- `import` (KnowledgeConnectorInputConnectorImport, optional) — Import trigger. WordPress supports manual, webhook (default) and daily. Web pages and websites support manual (default) and daily. Daily refreshes the entire configured source in its assigned workstream. Publishing is independent. Schedules take effect after Apply.
- `translateToEnglish` (boolean, optional, default: false) — Translate imported text to English using the deployed workspace translation settings. Originals are retained. Umbraco language filtering is bypassed when enabled.

### KnowledgeConnectorInputCredentials

- `username` (string, optional)
- `password` (string, optional)

### KnowledgeConnectorInputConnectorPublish

- `mode` (enum, required)
  - Allowed values: `manual`, `immediate`, `daily`
- `time` (string, optional)
- `timeZone` (string, optional)

### KnowledgeConnectorInputConnectorImport

Import trigger. WordPress supports manual, webhook (default) and daily. Web pages and websites support manual (default) and daily. Daily refreshes the entire configured source in its assigned workstream. Publishing is independent. Schedules take effect after Apply.

- `mode` (enum, required, default: webhook)
  - Allowed values: `manual`, `webhook`, `daily`
- `time` (string, optional) — Required for daily imports, HH:mm.
- `timeZone` (string, optional) — Required for daily imports, IANA timezone.

## Examples

**Request**

```json
{
  "title": "string",
  "type": "wordpress"
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey"

querystring = {"branch":"branch"}

payload = {
    "title": "string",
    "type": "wordpress"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey?branch=branch';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"title":"string","type":"wordpress"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey?branch=branch"

	payload := strings.NewReader("{\n  \"title\": \"string\",\n  \"type\": \"wordpress\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey?branch=branch")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"title\": \"string\",\n  \"type\": \"wordpress\"\n}"

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.put("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey?branch=branch")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"title\": \"string\",\n  \"type\": \"wordpress\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey?branch=branch', [
  'body' => '{
  "title": "string",
  "type": "wordpress"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey?branch=branch");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"title\": \"string\",\n  \"type\": \"wordpress\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "title": "string",
  "type": "wordpress"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources/sourceKey?branch=branch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```