Update the settings of a URL source
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
url: '<string>',
pageLimit: 123,
includePaths: ['<string>'],
excludePaths: ['<string>'],
recrawlIntervalHours: 123,
crawlerName: '<string>'
})
};
fetch('https://blackbox.dasha.ai/api/v1/rag/kb/{kbId}/sources/{sourceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://blackbox.dasha.ai/api/v1/rag/kb/{kbId}/sources/{sourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"url": "<string>",
"pageLimit": 123,
"includePaths": [
"<string>"
],
"excludePaths": [
"<string>"
],
"recrawlIntervalHours": 123,
"crawlerName": "<string>"
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/rag/kb/{kbId}/sources/{sourceId}"
payload = {
"url": "<string>",
"pageLimit": 123,
"includePaths": ["<string>"],
"excludePaths": ["<string>"],
"recrawlIntervalHours": 123,
"crawlerName": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"knowledgeBaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "url",
"url": "<string>",
"scope": "section",
"pageLimit": 123,
"includePaths": [
"<string>"
],
"excludePaths": [
"<string>"
],
"pageCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"recrawlIntervalHours": 123,
"crawlerName": "<string>",
"nextRunAt": "2023-11-07T05:31:56Z",
"lastRun": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"trigger": "initial",
"counts": {
"discovered": 123,
"fetched": 123,
"unchanged": 123,
"failed": 123,
"removed": 123,
"covered": 123
},
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"errorCode": "not_configured",
"warning": "<string>"
}
}{
"errors": {},
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Update the settings of a URL source
Saves new settings without starting a crawl; the next crawl uses them. The URL of a source cannot change: add a new URL source to crawl a different address. After narrowing the scope, the path patterns or the page limit, the next completed crawl removes the pages left out even when they are more than half of the previous crawl.
PUT
/
api
/
v1
/
rag
/
kb
/
{kbId}
/
sources
/
{sourceId}
Update the settings of a URL source
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
url: '<string>',
pageLimit: 123,
includePaths: ['<string>'],
excludePaths: ['<string>'],
recrawlIntervalHours: 123,
crawlerName: '<string>'
})
};
fetch('https://blackbox.dasha.ai/api/v1/rag/kb/{kbId}/sources/{sourceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://blackbox.dasha.ai/api/v1/rag/kb/{kbId}/sources/{sourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"url": "<string>",
"pageLimit": 123,
"includePaths": [
"<string>"
],
"excludePaths": [
"<string>"
],
"recrawlIntervalHours": 123,
"crawlerName": "<string>"
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/rag/kb/{kbId}/sources/{sourceId}"
payload = {
"url": "<string>",
"pageLimit": 123,
"includePaths": ["<string>"],
"excludePaths": ["<string>"],
"recrawlIntervalHours": 123,
"crawlerName": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"knowledgeBaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "url",
"url": "<string>",
"scope": "section",
"pageLimit": 123,
"includePaths": [
"<string>"
],
"excludePaths": [
"<string>"
],
"pageCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"recrawlIntervalHours": 123,
"crawlerName": "<string>",
"nextRunAt": "2023-11-07T05:31:56Z",
"lastRun": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"trigger": "initial",
"counts": {
"discovered": 123,
"fetched": 123,
"unchanged": 123,
"failed": 123,
"removed": 123,
"covered": 123
},
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"errorCode": "not_configured",
"warning": "<string>"
}
}{
"errors": {},
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
New settings
Response
OK
Was this page helpful?