get_ai_knowledge_base

ArtificialIntelligenceApi.get_ai_knowledge_base(id, role_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Get details of a specific knowledge base

Retrieves a knowledge base by ID, including SourceDetails and the caller’s AccessType. Unstructured knowledge bases also include aggregated Metrics. Requires at least read-only access. If status is CREATING or UPDATING, it is refreshed from Bedrock before the response is returned.

Parameters:
  • id (str) – Unique identifier of the knowledge base. (required)

  • role_id (str) – Amorphic role ID of the requesting user. Must be a role the authenticated user belongs to. (required)

  • _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:

KnowledgeBaseDetail

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /ai/knowledgebases/{id}

Parameter examples

Name

In

Example

id

path

"ABCDEFGHIJ"

role_id

header

"custom-role-123e4567-e89b-12d3-a456-426614174000"

Success (HTTP 200)

Knowledge base details, sources, AccessType, and (for unstructured) Metrics.

Request / response example

{
  "KnowledgebaseId": "ABCDEFGHIJ",
  "KnowledgebaseName": "sales_docs_kb",
  "KnowledgebaseType": "unstructured",
  "Description": "Product and sales documentation",
  "KnowledgebaseStatus": "ACTIVE",
  "EmbeddingModel": "amazon.titan-embed-text-v2:0",
  "CreationTime": "2026-07-15 09:00:00",
  "CreatedBy": "jane.doe",
  "LastModifiedTime": "2026-08-01 10:15:00",
  "LastModifiedBy": "jane.doe",
  "LastSyncedTime": "N/A",
  "LastSyncedStatus": "N/A",
  "AccessType": "owner",
  "SmartChunking": false,
  "SortKey": "Metadata",
  "Metrics": {
    "SourcesAttached": 1,
    "FilesScanned": 12,
    "FilesDeleted": 0,
    "FilesFailed": 0,
    "MetadataFilesScanned": 0,
    "MetadataFilesModified": 0,
    "ModifiedFilesIndexed": 0,
    "NewFilesIndexed": 12
  },
  "SourceDetails": [
    {
      "SourceName": "sales_docs",
      "SourceId": "ABCDEFGHIJDS",
      "SourceStatus": "ACTIVE",
      "ResourceType": "Dataset",
      "ResourceKey": "ds-123e4567-e89b-12d3-a456-426614174000",
      "ResourceName": "sales_docs",
      "ParsingStrategy": "DEFAULT",
      "ChunkingConfiguration": {
        "ChunkingStrategy": "NONE"
      }
    }
  ]
}

Errors

Documented error codes: GE-1046, AUTH-1012, AI-1004, AUTH-1001, AUTH-1011, IPV-1002, GE-1085, DB-1002.

HTTP 400

Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1046 (Bedrock KB not found while CREATING/UPDATING), AUTH-1012 (insufficient access), AI-1004 (AICore disabled), AUTH-1001 (missing role_id), 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 404

Knowledge base not found. Body is {“Message”: “<CODE> - <text>”}. Code: IPV-1002.

Knowledge base not found

{
  "Message": "IPV-1002 - Invalid knowledge base - ABCDEFGHIJ, resource not found."
}

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"
}