Skip to content

Retrieve Status of Indexing Job for a Knowledge Base

client.KnowledgeBases.IndexingJobs.Get(ctx, uuid) (*KnowledgeBaseIndexingJobGetResponse, error)
get/v2/gen-ai/indexing_jobs/{uuid}

To get status of an indexing Job for a knowledge base, send a GET request to /v2/gen-ai/indexing_jobs/{uuid}.

ParametersExpand Collapse
uuid string
ReturnsExpand Collapse
type KnowledgeBaseIndexingJobGetResponse struct{…}

GetKnowledgeBaseIndexingJobOutput description

Job APIIndexingJoboptional

IndexingJob description

CompletedDatasources int64optional

Number of datasources indexed completed

formatint64
CreatedAt Timeoptional

Creation date / time

formatdate-time
DataSourceJobs []APIIndexedDataSourceoptional

Details on Data Sources included in the Indexing Job

CompletedAt Timeoptional

Timestamp when data source completed indexing

formatdate-time
DataSourceUuid stringoptional

Uuid of the indexed data source

ErrorDetails stringoptional

A detailed error description

ErrorMsg stringoptional

A string code provinding a hint which part of the system experienced an error

FailedItemCount stringoptional

Total count of files that have failed

formatuint64
IndexedFileCount stringoptional

Total count of files that have been indexed

formatuint64
IndexedItemCount stringoptional

Total count of files that have been indexed

formatuint64
RemovedItemCount stringoptional

Total count of files that have been removed

formatuint64
SkippedItemCount stringoptional

Total count of files that have been skipped

formatuint64
StartedAt Timeoptional

Timestamp when data source started indexing

formatdate-time
Status APIIndexedDataSourceStatusoptional
Accepts one of the following:
const APIIndexedDataSourceStatusDataSourceStatusUnknown APIIndexedDataSourceStatus = "DATA_SOURCE_STATUS_UNKNOWN"
const APIIndexedDataSourceStatusDataSourceStatusInProgress APIIndexedDataSourceStatus = "DATA_SOURCE_STATUS_IN_PROGRESS"
const APIIndexedDataSourceStatusDataSourceStatusUpdated APIIndexedDataSourceStatus = "DATA_SOURCE_STATUS_UPDATED"
const APIIndexedDataSourceStatusDataSourceStatusPartiallyUpdated APIIndexedDataSourceStatus = "DATA_SOURCE_STATUS_PARTIALLY_UPDATED"
const APIIndexedDataSourceStatusDataSourceStatusNotUpdated APIIndexedDataSourceStatus = "DATA_SOURCE_STATUS_NOT_UPDATED"
const APIIndexedDataSourceStatusDataSourceStatusFailed APIIndexedDataSourceStatus = "DATA_SOURCE_STATUS_FAILED"
const APIIndexedDataSourceStatusDataSourceStatusCancelled APIIndexedDataSourceStatus = "DATA_SOURCE_STATUS_CANCELLED"
TotalBytes stringoptional

Total size of files in data source in bytes

formatuint64
TotalBytesIndexed stringoptional

Total size of files in data source in bytes that have been indexed

formatuint64
TotalFileCount stringoptional

Total file count in the data source

formatuint64
DataSourceUuids []stringoptional
FinishedAt Timeoptional
formatdate-time
IsReportAvailable booloptional

Boolean value to determine if the indexing job details are available

KnowledgeBaseUuid stringoptional

Knowledge base id

Phase APIIndexingJobPhaseoptional
Accepts one of the following:
const APIIndexingJobPhaseBatchJobPhaseUnknown APIIndexingJobPhase = "BATCH_JOB_PHASE_UNKNOWN"
const APIIndexingJobPhaseBatchJobPhasePending APIIndexingJobPhase = "BATCH_JOB_PHASE_PENDING"
const APIIndexingJobPhaseBatchJobPhaseRunning APIIndexingJobPhase = "BATCH_JOB_PHASE_RUNNING"
const APIIndexingJobPhaseBatchJobPhaseSucceeded APIIndexingJobPhase = "BATCH_JOB_PHASE_SUCCEEDED"
const APIIndexingJobPhaseBatchJobPhaseFailed APIIndexingJobPhase = "BATCH_JOB_PHASE_FAILED"
const APIIndexingJobPhaseBatchJobPhaseError APIIndexingJobPhase = "BATCH_JOB_PHASE_ERROR"
const APIIndexingJobPhaseBatchJobPhaseCancelled APIIndexingJobPhase = "BATCH_JOB_PHASE_CANCELLED"
StartedAt Timeoptional
formatdate-time
Status APIIndexingJobStatusoptional
Accepts one of the following:
const APIIndexingJobStatusIndexJobStatusUnknown APIIndexingJobStatus = "INDEX_JOB_STATUS_UNKNOWN"
const APIIndexingJobStatusIndexJobStatusPartial APIIndexingJobStatus = "INDEX_JOB_STATUS_PARTIAL"
const APIIndexingJobStatusIndexJobStatusInProgress APIIndexingJobStatus = "INDEX_JOB_STATUS_IN_PROGRESS"
const APIIndexingJobStatusIndexJobStatusCompleted APIIndexingJobStatus = "INDEX_JOB_STATUS_COMPLETED"
const APIIndexingJobStatusIndexJobStatusFailed APIIndexingJobStatus = "INDEX_JOB_STATUS_FAILED"
const APIIndexingJobStatusIndexJobStatusNoChanges APIIndexingJobStatus = "INDEX_JOB_STATUS_NO_CHANGES"
const APIIndexingJobStatusIndexJobStatusPending APIIndexingJobStatus = "INDEX_JOB_STATUS_PENDING"
const APIIndexingJobStatusIndexJobStatusCancelled APIIndexingJobStatus = "INDEX_JOB_STATUS_CANCELLED"
Tokens int64optional

Number of tokens [This field is deprecated]

formatint64
TotalDatasources int64optional

Number of datasources being indexed

formatint64
TotalTokens stringoptional

Total Tokens Consumed By the Indexing Job

formatuint64
UpdatedAt Timeoptional

Last modified

formatdate-time
Uuid stringoptional

Unique id

Retrieve Status of Indexing Job for a Knowledge Base
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := gradient.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  indexingJob, err := client.KnowledgeBases.IndexingJobs.Get(context.TODO(), `"123e4567-e89b-12d3-a456-426614174000"`)
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", indexingJob.Job)
}
{
  "job": {
    "completed_datasources": 123,
    "created_at": "2023-01-01T00:00:00Z",
    "data_source_jobs": [
      {
        "completed_at": "2023-01-01T00:00:00Z",
        "data_source_uuid": "123e4567-e89b-12d3-a456-426614174000",
        "error_details": "example string",
        "error_msg": "example string",
        "failed_item_count": "12345",
        "indexed_file_count": "12345",
        "indexed_item_count": "12345",
        "removed_item_count": "12345",
        "skipped_item_count": "12345",
        "started_at": "2023-01-01T00:00:00Z",
        "status": "DATA_SOURCE_STATUS_UNKNOWN",
        "total_bytes": "12345",
        "total_bytes_indexed": "12345",
        "total_file_count": "12345"
      }
    ],
    "data_source_uuids": [
      "example string"
    ],
    "finished_at": "2023-01-01T00:00:00Z",
    "is_report_available": true,
    "knowledge_base_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "phase": "BATCH_JOB_PHASE_UNKNOWN",
    "started_at": "2023-01-01T00:00:00Z",
    "status": "INDEX_JOB_STATUS_UNKNOWN",
    "tokens": 123,
    "total_datasources": 123,
    "total_tokens": "12345",
    "updated_at": "2023-01-01T00:00:00Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  }
}
Returns Examples
{
  "job": {
    "completed_datasources": 123,
    "created_at": "2023-01-01T00:00:00Z",
    "data_source_jobs": [
      {
        "completed_at": "2023-01-01T00:00:00Z",
        "data_source_uuid": "123e4567-e89b-12d3-a456-426614174000",
        "error_details": "example string",
        "error_msg": "example string",
        "failed_item_count": "12345",
        "indexed_file_count": "12345",
        "indexed_item_count": "12345",
        "removed_item_count": "12345",
        "skipped_item_count": "12345",
        "started_at": "2023-01-01T00:00:00Z",
        "status": "DATA_SOURCE_STATUS_UNKNOWN",
        "total_bytes": "12345",
        "total_bytes_indexed": "12345",
        "total_file_count": "12345"
      }
    ],
    "data_source_uuids": [
      "example string"
    ],
    "finished_at": "2023-01-01T00:00:00Z",
    "is_report_available": true,
    "knowledge_base_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "phase": "BATCH_JOB_PHASE_UNKNOWN",
    "started_at": "2023-01-01T00:00:00Z",
    "status": "INDEX_JOB_STATUS_UNKNOWN",
    "tokens": 123,
    "total_datasources": 123,
    "total_tokens": "12345",
    "updated_at": "2023-01-01T00:00:00Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  }
}