Create Knowledge Base Data Source Link
This method allows you to link a data source to a knowledge base.
When you link a data source to a knowledge base, the initial status of the
link is NOT_INDEXED
. This means that the data source is linked to the
knowledge base, but none of the documents in the data source have been added
to an index of the knowledge base yet.
Once you trigger an indexing, or the refresh policy triggers an indexing
automatically, documents from the data source are added to the index, and
the status of the link is updated to INDEXED
.
Similarly, when you unlink a data source from the knowledge base, the status
of the link becomes PENDING_UNLINKING
, because there may still be documents
from the data source in the index. Once you trigger a new indexing (or an
indexing is started automatically due to the refresh policy), the status
of the link is updated to UNLINKING
.
Once all documents from a data source have been removed from the index, the link is removed.
Note that you can undo the removal of the link between a data source and the knowledge base prior to triggering an indexing (as no modifications to any index has been triggered yet). For details, refer to the method to Cancel unlinking a data source and a knowledge base.
knowledge_base_id
{
"data_source_id": "string"
}
ID of the data source to link to the knowledge base.
Successful Response
"LinkedDataSource Object"
ID of the link between a knowledge base and a data source.
State of the link between a knowledge base and a data source.
A data source.
The knowledge base does not support linking to a data source.
Invalid knowledge base or data source ID.
The knowledge base is already linked to this data source.
Validation Error
"HTTPValidationError Object"
detail
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"data_source_id:"string"}' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/data-sources