Mutation
mutation CreateKnowledgeSource($input: CreateKnowledgeSourceInput!) {
createKnowledgeSource(input: $input) {
knowledgeSource {
__typename
... on KnowledgeSourceSitemap {
id
type
url
labelTypes {
__typename
}
status {
__typename
... on IndexingStatusPending {
__typename
}
}
indexedDocumentCounts {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"url": "string",
"type": "SITEMAP"
}
}Response
{
"data": {
"createKnowledgeSource": {
"knowledgeSource": {
"__typename": "KnowledgeSourceSitemap",
"id": "id",
"type": "SITEMAP",
"url": "string",
"labelTypes": [
{
"__typename": "LabelType"
}
],
"status": {
"__typename": "IndexingStatusPending"
},
"indexedDocumentCounts": {
"__typename": "KnowledgeSourceSitemapIndexedDocumentCounts"
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
createKnowledgeSource
Create a new knowledge source that Plain AI will index and use when generating replies.
Use type SITEMAP to crawl all URLs listed in a sitemap XML file, or type URL to index a
single page. Requires Plain AI to be enabled on the workspace.
MUTATION
createKnowledgeSource(input: CreateKnowledgeSourceInput!): CreateKnowledgeSourceOutput!Arguments
input
required
Returns
knowledgeSource
error
Mutation
mutation CreateKnowledgeSource($input: CreateKnowledgeSourceInput!) {
createKnowledgeSource(input: $input) {
knowledgeSource {
__typename
... on KnowledgeSourceSitemap {
id
type
url
labelTypes {
__typename
}
status {
__typename
... on IndexingStatusPending {
__typename
}
}
indexedDocumentCounts {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"url": "string",
"type": "SITEMAP"
}
}Response
{
"data": {
"createKnowledgeSource": {
"knowledgeSource": {
"__typename": "KnowledgeSourceSitemap",
"id": "id",
"type": "SITEMAP",
"url": "string",
"labelTypes": [
{
"__typename": "LabelType"
}
],
"status": {
"__typename": "IndexingStatusPending"
},
"indexedDocumentCounts": {
"__typename": "KnowledgeSourceSitemapIndexedDocumentCounts"
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

