get_knowledge_base_run_metrics¶
- ArtificialIntelligenceApi.get_knowledge_base_run_metrics(id, role_id, limit=None, offset=None, sortorder=None, sortby=None, projection_expression=None, filter_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List sync job runs for a knowledge base
Returns a paginated list of JobRun items for the knowledge base. Default offset is 1 (1-based), limit 100 (max 1000), sortby StartTime, sortorder desc. RUNNING runs with an ExecutionArn are checked against Step Functions and marked FAILED if the execution failed, timed out, or was aborted. KnowledgebaseId and SortKey are stripped from each item. The knowledge base must exist. No request body.
- 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)
limit (int) – Page size. Default 100, maximum 1000.
offset (str) – 1-based page offset. Default 1.
sortorder (str) – Sort direction. Default desc. Any value other than desc is treated as ascending.
sortby (str) – Field to sort by. Default StartTime. The field must exist on every job run item.
projection_expression (str) – Comma-separated job run attributes to include. When omitted, all returned fields are included.
filter_expression (str) – Comma-separated field:value filters applied before pagination (format key:value). Status supports wildcard matching.
_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: GET /ai/knowledgebases/{id}/runs
Parameter examples¶
Name |
In |
Example |
|---|---|---|
|
path |
|
|
header |
|
|
query |
|
|
query |
|
Success (HTTP 200)¶
Paginated jobruns plus next_available, count, and total_count. Stop when next_available is “no”.
Request / response example
{
"jobruns": [
{
"Status": "RUNNING",
"SyncedBy": "jdoe",
"StartTime": "2026-08-19 10:00:00",
"EndTime": "N/A",
"Message": "Syncing in progress",
"SourceName": "sales_kb",
"ExecutionScope": "KnowledgeBase",
"ExecutionArn": "arn:aws:states:us-east-1:123456789012:execution:kb-sync:kbsyncjob-abc123"
}
],
"next_available": "no",
"count": 1,
"total_count": 1
}
Errors¶
Documented error codes: IPV-1002, IPV-1045, AUTH-1001, AUTH-1011, GE-1085, DB-1002.
HTTP 400
Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1002 (KB not found), IPV-1045 (limit over maximum), 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"
}
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"
}