Edit a curated claim
curl --request PUT \
--url https://api.wondeya.com/v1/knowledge/claims/{sourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"claim": {
"es": "<string>",
"en": "<string>"
},
"topics": [
"<array>"
],
"agentId": {}
}
'import requests
url = "https://api.wondeya.com/v1/knowledge/claims/{sourceId}"
payload = {
"title": "<string>",
"claim": {
"es": "<string>",
"en": "<string>"
},
"topics": ["<array>"],
"agentId": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
claim: {es: '<string>', en: '<string>'},
topics: ['<array>'],
agentId: {}
})
};
fetch('https://api.wondeya.com/v1/knowledge/claims/{sourceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wondeya.com/v1/knowledge/claims/{sourceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'claim' => [
'es' => '<string>',
'en' => '<string>'
],
'topics' => [
'<array>'
],
'agentId' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wondeya.com/v1/knowledge/claims/{sourceId}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"claim\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"topics\": [\n \"<array>\"\n ],\n \"agentId\": {}\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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.wondeya.com/v1/knowledge/claims/{sourceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"claim\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"topics\": [\n \"<array>\"\n ],\n \"agentId\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/knowledge/claims/{sourceId}")
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 \"claim\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"topics\": [\n \"<array>\"\n ],\n \"agentId\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": {},
"kind": "<string>",
"title": "<string>",
"status": "<string>",
"lang": "<string>",
"translated": true,
"topics": [
"<string>"
],
"chunkCount": 123,
"tokenCount": 123,
"summary": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"sourceLang": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"byteSize": 123,
"url": "<string>",
"resolvedUrl": "<string>",
"lastFetchedAt": "2023-11-07T05:31:56Z",
"syncTtlMinutes": 123,
"nextSyncAt": "2023-11-07T05:31:56Z",
"claim": {
"es": "<string>",
"en": "<string>"
}
}Knowledge
Edit a curated claim
Saving re-indexes it. Editing a claim adds no document.
PUT
/
v1
/
knowledge
/
claims
/
{sourceId}
Edit a curated claim
curl --request PUT \
--url https://api.wondeya.com/v1/knowledge/claims/{sourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"claim": {
"es": "<string>",
"en": "<string>"
},
"topics": [
"<array>"
],
"agentId": {}
}
'import requests
url = "https://api.wondeya.com/v1/knowledge/claims/{sourceId}"
payload = {
"title": "<string>",
"claim": {
"es": "<string>",
"en": "<string>"
},
"topics": ["<array>"],
"agentId": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
claim: {es: '<string>', en: '<string>'},
topics: ['<array>'],
agentId: {}
})
};
fetch('https://api.wondeya.com/v1/knowledge/claims/{sourceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wondeya.com/v1/knowledge/claims/{sourceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'claim' => [
'es' => '<string>',
'en' => '<string>'
],
'topics' => [
'<array>'
],
'agentId' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wondeya.com/v1/knowledge/claims/{sourceId}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"claim\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"topics\": [\n \"<array>\"\n ],\n \"agentId\": {}\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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.wondeya.com/v1/knowledge/claims/{sourceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"claim\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"topics\": [\n \"<array>\"\n ],\n \"agentId\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/knowledge/claims/{sourceId}")
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 \"claim\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"topics\": [\n \"<array>\"\n ],\n \"agentId\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": {},
"kind": "<string>",
"title": "<string>",
"status": "<string>",
"lang": "<string>",
"translated": true,
"topics": [
"<string>"
],
"chunkCount": 123,
"tokenCount": 123,
"summary": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"sourceLang": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"byteSize": 123,
"url": "<string>",
"resolvedUrl": "<string>",
"lastFetchedAt": "2023-11-07T05:31:56Z",
"syncTtlMinutes": 123,
"nextSyncAt": "2023-11-07T05:31:56Z",
"claim": {
"es": "<string>",
"en": "<string>"
}
}Authorizations
A workspace API key: wdy_live_… / wdy_test_…. Created at POST /workspaces/{tenantId}/keys and shown exactly once.
Path Parameters
Body
application/json
Required string length:
1 - 120Show child attributes
Show child attributes
Lowercase topic tags. An empty list makes the source universal.
Maximum array length:
12On create: the agent, or null/absent for the workspace pool. On edit: absent leaves it where it is; null moves it to the pool; an id moves it there.
Response
null = the workspace pool.
upload, url or claim.
pending, ready, failed, …
The canonical corpus language of the chunks.
The index card: one English line naming what this covers.
A machine-readable failure code.
Show child attributes
Show child attributes