update_knowledge_base¶
- ArtificialIntelligenceApi.update_knowledge_base(id, role_id, knowledge_base_update_request, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Update an existing knowledge base
Updates Description (required, max 200 characters) and optional GuardRails. If GuardRails is omitted or empty, the default guard rail is applied. KnowledgebaseName cannot be changed. Requires editor access.
- Parameters:
id (str) – Unique identifier of the knowledge base to update. (required)
role_id (str) – Amorphic role ID of the requesting user. Must be a role the authenticated user belongs to. (required)
knowledge_base_update_request (KnowledgeBaseUpdateRequest) – Description is required (max 200 characters). GuardRails is optional; if omitted, the default guard rail is applied. (required)
content_type (str) – Request body media type.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: PUT /ai/knowledgebases/{id}
Parameter examples¶
Name |
In |
Example |
|---|---|---|
|
path |
|
|
header |
|
|
header |
|
Request¶
Description is required (max 200 characters). GuardRails is optional; if omitted, the default guard rail is applied.
Update description only (default guard rail applied)
{
"Description": "Updated product and sales documentation"
}
Update description and attach guard rails
{
"Description": "Updated product and sales documentation",
"GuardRails": [
{
"Id": "gr-123e4567-e89b-12d3-a456-426614174000",
"Version": "DRAFT"
}
]
}
Explicitly reset to default guard rail
{
"Description": "Updated product and sales documentation",
"GuardRails": []
}
Success (HTTP 200)¶
Knowledge base updated. Returns Message and KnowledgebaseId.
Request / response example
{
"Message": "Knowledge base updated successfully.",
"KnowledgebaseId": "ABCDEFGHIJ"
}
Errors¶
Documented error codes: IPV-1008, IPV-1002, DS-1006, AUTH-1001, AUTH-1012, AUTH-1011, GE-1085, DB-1002.
HTTP 400
Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1008 (missing Description), IPV-1002 (knowledge base not found), DS-1006 (Bedrock update failed), AUTH-1001 (missing role_id), AUTH-1012 (editor required), AUTH-1011 (caller not authorized).
Missing role_id header
{
"Message": "AUTH-1001 - Missing role information in event header"
}
Caller not authorized
{
"Message": "AUTH-1011 - User does not have sufficient permission to perform this action"
}
HTTP 500
Backend failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1085 (unexpected backend failure), DB-1002 (persistence failure).
Unexpected backend failure
{
"Message": "GE-1085 - An unexpected error occurred"
}