> 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.

# Add a knowledge source to a workstream

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

Add manual content, a UTF-8 text/Markdown file, a web page, a website or a WordPress website. LogicDialog imports and saves the source and documents together, preserving existing knowledge. Requires a workstream belonging to this workspace. Website import must be enabled by the administrator and may take up to a minute. Empty imports return 422 without saving a source. This operation does not publish: validate and apply the workstream, with knowledge enabled for the intended assistant.

Required permissions: workspace.edit. Connector sources are configured without immediately importing. Apply their settings to activate authenticated webhooks; use refresh or legacy migration to seed content. Enabling automatic publishing requires changes.approve and deploy.live or deploy.test.

Reference: https://api.logicdialog.ai/api-reference/knowledge/post-api-workspaces-workspace-id-knowledge-sources

## 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)

### Query parameters

- `branch` (string, optional) — Workstream or environment branch. Writes require a workstream; reads default to Live.

### Body (application/json)

This endpoint expects a Knowledge_post_api_workspaces_workspaceId_knowledge_sources_Request.

- `Knowledge_post_api_workspaces_workspaceId_knowledge_sources_Request`
  - CreateKnowledgeSource: CreateKnowledgeSource
  - KnowledgeConnectorInput: KnowledgeConnectorInput

## Response

### 201

Source saved in the workstream; not published

- `branch` (string, required)
- `source` (SavedKnowledgeSource, required)
- `published` (boolean, required)
- `warnings` (list of ApiWorkspacesWorkspaceIdKnowledgeSourcesPostResponsesContentApplicationJsonSchemaWarningsItems, required)

## Errors

### 400 Bad Request Error

Invalid source or branch

- `any`

### 401 Unauthorized Error

Missing or invalid platform authentication

- `any`

### 403 Forbidden Error

Missing workspace access or required permission

- `any`

### 409 Conflict Error

Source key exists or workstream is busy

- `any`

### 413 Content Too Large Error

JSON request exceeds the configured body limit (1 MiB by default)

- `any`

### 422 Unprocessable Entity Error

Import returned no readable content; nothing saved

- `any`

## Types

### CreateKnowledgeSource

Save one knowledge source in a workstream. Supply branch in the body, query, or X-LogicDialog-Branch header. This does not publish or change assistant attachment settings. HTTP request bodies default to a 1 MiB limit, including JSON overhead.

- Manual text: Manual text
- Text or Markdown file: Text or Markdown file
- Web page: Web page
- Website: Website
- WordPress website: WordPress website

### 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)

### SavedKnowledgeSource

- `key` (string, required)
- `title` (string, required)
- `type` (string, required) — Source type, including existing imported source types.
- `documents` (list of SavedKnowledgeSourceDocumentsItems, required)
- `url` (string, optional)
- `filename` (string, optional)

### ApiWorkspacesWorkspaceIdKnowledgeSourcesPostResponsesContentApplicationJsonSchemaWarningsItems

- `code` (string, optional)
- `message` (string, optional)

### Manual text

- `title` (string, required)
- `type` (enum, required)
  - Allowed values: `text`
- `text` (string, required) — Plain text or Markdown, at most 1 MiB of UTF-8 text.
- `branch` (string, optional) — Workstream branch returned when the workstream was created. Must belong to this workspace.
- `key` (string, optional) — Optional stable source identifier. Omit to generate one. An existing key returns 409; inspect the saved source before retrying.

### Text or Markdown file

- `title` (string, required)
- `type` (enum, required)
  - Allowed values: `file`
- `file` (CreateKnowledgeSourceOneOf1File, required)
- `branch` (string, optional) — Workstream branch returned when the workstream was created. Must belong to this workspace.
- `key` (string, optional) — Optional stable source identifier. Omit to generate one. An existing key returns 409; inspect the saved source before retrying.

### Web page

- `title` (string, required)
- `type` (enum, required)
  - Allowed values: `url`
- `url` (string, required)
- `branch` (string, optional) — Workstream branch returned when the workstream was created. Must belong to this workspace.
- `key` (string, optional) — Optional stable source identifier. Omit to generate one. An existing key returns 409; inspect the saved source before retrying.

### Website

- `title` (string, required)
- `type` (enum, required)
  - Allowed values: `sitemap`
- `url` (string, required)
- `branch` (string, optional) — Workstream branch returned when the workstream was created. Must belong to this workspace.
- `key` (string, optional) — Optional stable source identifier. Omit to generate one. An existing key returns 409; inspect the saved source before retrying.

### WordPress website

- `title` (string, required)
- `type` (enum, required)
  - Allowed values: `wordpress`
- `url` (string, required)
- `branch` (string, optional) — Workstream branch returned when the workstream was created. Must belong to this workspace.
- `key` (string, optional) — Optional stable source identifier. Omit to generate one. An existing key returns 409; inspect the saved source before retrying.

### 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)

### SavedKnowledgeSourceDocumentsItems

- `key` (string, required)
- `title` (string, required)
- `editable` (boolean, required)

### CreateKnowledgeSourceOneOf1File

- `name` (string, required) — Original filename ending .txt, .md or .markdown. Do not include a path.
- `content` (string, required) — Decoded UTF-8 file contents, not base64; at most 1 MiB. PDF and Office files are not supported.

### 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

### manual

**Request**

```json
{
  "branch": "change/WORKSPACE/knowledge-update",
  "key": "opening-hours",
  "text": "We open Monday to Friday, 09:00–17:00.",
  "title": "Opening hours",
  "type": "text"
}
```

**Response**

```json
{
  "branch": "string",
  "source": {
    "key": "string",
    "title": "string",
    "type": "string",
    "documents": [
      {
        "key": "string",
        "title": "string",
        "editable": true
      }
    ],
    "url": "string",
    "filename": "string"
  },
  "published": true,
  "warnings": [
    {
      "code": "string",
      "message": "string"
    }
  ]
}
```

**SDK Code**

```python manual
import requests

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

payload = {
    "branch": "change/WORKSPACE/knowledge-update",
    "key": "opening-hours",
    "text": "We open Monday to Friday, 09:00–17:00.",
    "title": "Opening hours",
    "type": "text"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript manual
const url = 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"branch":"change/WORKSPACE/knowledge-update","key":"opening-hours","text":"We open Monday to Friday, 09:00–17:00.","title":"Opening hours","type":"text"}'
};

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

```go manual
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"key\": \"opening-hours\",\n  \"text\": \"We open Monday to Friday, 09:00–17:00.\",\n  \"title\": \"Opening hours\",\n  \"type\": \"text\"\n}")

	req, _ := http.NewRequest("POST", 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 manual
require 'uri'
require 'net/http'

url = URI("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"key\": \"opening-hours\",\n  \"text\": \"We open Monday to Friday, 09:00–17:00.\",\n  \"title\": \"Opening hours\",\n  \"type\": \"text\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"key\": \"opening-hours\",\n  \"text\": \"We open Monday to Friday, 09:00–17:00.\",\n  \"title\": \"Opening hours\",\n  \"type\": \"text\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources', [
  'body' => '{
  "branch": "change/WORKSPACE/knowledge-update",
  "key": "opening-hours",
  "text": "We open Monday to Friday, 09:00–17:00.",
  "title": "Opening hours",
  "type": "text"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp manual
using RestSharp;

var client = new RestClient("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"key\": \"opening-hours\",\n  \"text\": \"We open Monday to Friday, 09:00–17:00.\",\n  \"title\": \"Opening hours\",\n  \"type\": \"text\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift manual
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "branch": "change/WORKSPACE/knowledge-update",
  "key": "opening-hours",
  "text": "We open Monday to Friday, 09:00–17:00.",
  "title": "Opening hours",
  "type": "text"
] 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")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### file

**Request**

```json
{
  "branch": "change/WORKSPACE/knowledge-update",
  "file": {
    "content": "# Terms\nOur terms and conditions.",
    "name": "terms.md"
  },
  "title": "Terms",
  "type": "file"
}
```

**Response**

```json
{
  "branch": "string",
  "source": {
    "key": "string",
    "title": "string",
    "type": "string",
    "documents": [
      {
        "key": "string",
        "title": "string",
        "editable": true
      }
    ],
    "url": "string",
    "filename": "string"
  },
  "published": true,
  "warnings": [
    {
      "code": "string",
      "message": "string"
    }
  ]
}
```

**SDK Code**

```python file
import requests

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

payload = {
    "branch": "change/WORKSPACE/knowledge-update",
    "file": {
        "content": "# Terms
Our terms and conditions.",
        "name": "terms.md"
    },
    "title": "Terms",
    "type": "file"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript file
const url = 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"branch":"change/WORKSPACE/knowledge-update","file":{"content":"# Terms\nOur terms and conditions.","name":"terms.md"},"title":"Terms","type":"file"}'
};

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

```go file
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"file\": {\n    \"content\": \"# Terms\\nOur terms and conditions.\",\n    \"name\": \"terms.md\"\n  },\n  \"title\": \"Terms\",\n  \"type\": \"file\"\n}")

	req, _ := http.NewRequest("POST", 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 file
require 'uri'
require 'net/http'

url = URI("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"file\": {\n    \"content\": \"# Terms\\nOur terms and conditions.\",\n    \"name\": \"terms.md\"\n  },\n  \"title\": \"Terms\",\n  \"type\": \"file\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"file\": {\n    \"content\": \"# Terms\\nOur terms and conditions.\",\n    \"name\": \"terms.md\"\n  },\n  \"title\": \"Terms\",\n  \"type\": \"file\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources', [
  'body' => '{
  "branch": "change/WORKSPACE/knowledge-update",
  "file": {
    "content": "# Terms\\nOur terms and conditions.",
    "name": "terms.md"
  },
  "title": "Terms",
  "type": "file"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp file
using RestSharp;

var client = new RestClient("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"file\": {\n    \"content\": \"# Terms\\nOur terms and conditions.\",\n    \"name\": \"terms.md\"\n  },\n  \"title\": \"Terms\",\n  \"type\": \"file\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift file
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "branch": "change/WORKSPACE/knowledge-update",
  "file": [
    "content": "# Terms
Our terms and conditions.",
    "name": "terms.md"
  ],
  "title": "Terms",
  "type": "file"
] 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")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### webpage

**Request**

```json
{
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Contact",
  "type": "url",
  "url": "https://example.com/contact"
}
```

**Response**

```json
{
  "branch": "string",
  "source": {
    "key": "string",
    "title": "string",
    "type": "string",
    "documents": [
      {
        "key": "string",
        "title": "string",
        "editable": true
      }
    ],
    "url": "string",
    "filename": "string"
  },
  "published": true,
  "warnings": [
    {
      "code": "string",
      "message": "string"
    }
  ]
}
```

**SDK Code**

```python webpage
import requests

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

payload = {
    "branch": "change/WORKSPACE/knowledge-update",
    "title": "Contact",
    "type": "url",
    "url": "https://example.com/contact"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript webpage
const url = 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"branch":"change/WORKSPACE/knowledge-update","title":"Contact","type":"url","url":"https://example.com/contact"}'
};

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

```go webpage
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Contact\",\n  \"type\": \"url\",\n  \"url\": \"https://example.com/contact\"\n}")

	req, _ := http.NewRequest("POST", 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 webpage
require 'uri'
require 'net/http'

url = URI("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Contact\",\n  \"type\": \"url\",\n  \"url\": \"https://example.com/contact\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Contact\",\n  \"type\": \"url\",\n  \"url\": \"https://example.com/contact\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources', [
  'body' => '{
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Contact",
  "type": "url",
  "url": "https://example.com/contact"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp webpage
using RestSharp;

var client = new RestClient("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Contact\",\n  \"type\": \"url\",\n  \"url\": \"https://example.com/contact\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift webpage
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Contact",
  "type": "url",
  "url": "https://example.com/contact"
] 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")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### website

**Request**

```json
{
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Help centre",
  "type": "sitemap",
  "url": "https://example.com/help"
}
```

**Response**

```json
{
  "branch": "string",
  "source": {
    "key": "string",
    "title": "string",
    "type": "string",
    "documents": [
      {
        "key": "string",
        "title": "string",
        "editable": true
      }
    ],
    "url": "string",
    "filename": "string"
  },
  "published": true,
  "warnings": [
    {
      "code": "string",
      "message": "string"
    }
  ]
}
```

**SDK Code**

```python website
import requests

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

payload = {
    "branch": "change/WORKSPACE/knowledge-update",
    "title": "Help centre",
    "type": "sitemap",
    "url": "https://example.com/help"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript website
const url = 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"branch":"change/WORKSPACE/knowledge-update","title":"Help centre","type":"sitemap","url":"https://example.com/help"}'
};

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

```go website
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Help centre\",\n  \"type\": \"sitemap\",\n  \"url\": \"https://example.com/help\"\n}")

	req, _ := http.NewRequest("POST", 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 website
require 'uri'
require 'net/http'

url = URI("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Help centre\",\n  \"type\": \"sitemap\",\n  \"url\": \"https://example.com/help\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Help centre\",\n  \"type\": \"sitemap\",\n  \"url\": \"https://example.com/help\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources', [
  'body' => '{
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Help centre",
  "type": "sitemap",
  "url": "https://example.com/help"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp website
using RestSharp;

var client = new RestClient("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Help centre\",\n  \"type\": \"sitemap\",\n  \"url\": \"https://example.com/help\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift website
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Help centre",
  "type": "sitemap",
  "url": "https://example.com/help"
] 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")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### wordpress

**Request**

```json
{
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Support articles",
  "type": "wordpress",
  "url": "https://example.com"
}
```

**Response**

```json
{
  "branch": "string",
  "source": {
    "key": "string",
    "title": "string",
    "type": "string",
    "documents": [
      {
        "key": "string",
        "title": "string",
        "editable": true
      }
    ],
    "url": "string",
    "filename": "string"
  },
  "published": true,
  "warnings": [
    {
      "code": "string",
      "message": "string"
    }
  ]
}
```

**SDK Code**

```python wordpress
import requests

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

payload = {
    "branch": "change/WORKSPACE/knowledge-update",
    "title": "Support articles",
    "type": "wordpress",
    "url": "https://example.com"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript wordpress
const url = 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"branch":"change/WORKSPACE/knowledge-update","title":"Support articles","type":"wordpress","url":"https://example.com"}'
};

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

```go wordpress
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Support articles\",\n  \"type\": \"wordpress\",\n  \"url\": \"https://example.com\"\n}")

	req, _ := http.NewRequest("POST", 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 wordpress
require 'uri'
require 'net/http'

url = URI("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Support articles\",\n  \"type\": \"wordpress\",\n  \"url\": \"https://example.com\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Support articles\",\n  \"type\": \"wordpress\",\n  \"url\": \"https://example.com\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources', [
  'body' => '{
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Support articles",
  "type": "wordpress",
  "url": "https://example.com"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp wordpress
using RestSharp;

var client = new RestClient("https://app.logicdialog.ai/api/workspaces/workspaceId/knowledge/sources");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branch\": \"change/WORKSPACE/knowledge-update\",\n  \"title\": \"Support articles\",\n  \"type\": \"wordpress\",\n  \"url\": \"https://example.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift wordpress
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "branch": "change/WORKSPACE/knowledge-update",
  "title": "Support articles",
  "type": "wordpress",
  "url": "https://example.com"
] 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")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```