GET
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
async-jobs
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  // Automatically fetches more pages as needed.
  for await (const asyncJobListResponse of client.knowledgeBases.asyncJobs.list('knowledge_base_id')) {
    console.log(asyncJobListResponse.id);
  }
}

main();
[
  {
    "job_type": "evaluation-auto-eval",
    "parent_job_id": "<string>",
    "status": "<string>",
    "progress": {},
    "job_metadata": {},
    "idempotency_key": "<string>",
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "account_id": "<string>",
    "updated_at": "2023-11-07T05:31:56Z",
    "created_by_user_id": "<string>"
  }
]

Authorizations

x-api-key
string
header
required

Path Parameters

knowledge_base_id
string
required

Query Parameters

status
default:Active

Optional search by status type

Available options:
Active,
All
page
integer
default:1

Page number for pagination to be returned by the given endpoint. Starts at page 1

Required range: x >= 1
limit
integer
default:100

Maximum number of artifacts to be returned by the given endpoint. Defaults to 100 and cannot be greater than 10k.

Required range: 1 <= x <= 10000

Response

200
application/json
Successful Response

The response is of type object[].