# Indexing Jobs ## Create **post** `/v2/gen-ai/indexing_jobs` To start an indexing job for a knowledge base, send a POST request to `/v2/gen-ai/indexing_jobs`. ### Returns - **job:** `APIIndexingJob` IndexingJob description ## Retrieve **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}`. ### Returns - **job:** `APIIndexingJob` IndexingJob description ## List **get** `/v2/gen-ai/indexing_jobs` To list all indexing jobs for a knowledge base, send a GET request to `/v2/gen-ai/indexing_jobs`. ### Returns - **jobs:** `array of APIIndexingJob` The indexing jobs - **links:** `APILinks` Links to other pages - **meta:** `APIMeta` Meta information about the data set ## Retrieve Data Sources **get** `/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources` To list all datasources for an indexing job, send a GET request to `/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources`. ### Returns - **indexed\_data\_sources:** `array of APIIndexedDataSource` ## Update Cancel **put** `/v2/gen-ai/indexing_jobs/{uuid}/cancel` To cancel an indexing job for a knowledge base, send a PUT request to `/v2/gen-ai/indexing_jobs/{uuid}/cancel`. ### Returns - **job:** `APIIndexingJob` IndexingJob description ## Domain Types ### API Indexed Data Source - **APIIndexedDataSource:** `object { completed_at, data_source_uuid, error_details, 11 more }` - **completed\_at:** `string` Timestamp when data source completed indexing - **data\_source\_uuid:** `string` Uuid of the indexed data source - **error\_details:** `string` A detailed error description - **error\_msg:** `string` A string code provinding a hint which part of the system experienced an error - **failed\_item\_count:** `string` Total count of files that have failed - **indexed\_file\_count:** `string` Total count of files that have been indexed - **indexed\_item\_count:** `string` Total count of files that have been indexed - **removed\_item\_count:** `string` Total count of files that have been removed - **skipped\_item\_count:** `string` Total count of files that have been skipped - **started\_at:** `string` Timestamp when data source started indexing - **status:** `"DATA_SOURCE_STATUS_UNKNOWN" or "DATA_SOURCE_STATUS_IN_PROGRESS" or "DATA_SOURCE_STATUS_UPDATED" or 3 more` - `"DATA_SOURCE_STATUS_UNKNOWN"` - `"DATA_SOURCE_STATUS_IN_PROGRESS"` - `"DATA_SOURCE_STATUS_UPDATED"` - `"DATA_SOURCE_STATUS_PARTIALLY_UPDATED"` - `"DATA_SOURCE_STATUS_NOT_UPDATED"` - `"DATA_SOURCE_STATUS_FAILED"` - **total\_bytes:** `string` Total size of files in data source in bytes - **total\_bytes\_indexed:** `string` Total size of files in data source in bytes that have been indexed - **total\_file\_count:** `string` Total file count in the data source ### API Indexing Job - **APIIndexingJob:** `object { completed_datasources, created_at, data_source_uuids, 12 more }` IndexingJob description - **completed\_datasources:** `number` Number of datasources indexed completed - **created\_at:** `string` Creation date / time - **data\_source\_uuids:** `array of string` - **finished\_at:** `string` - **knowledge\_base\_uuid:** `string` Knowledge base id - **phase:** `"BATCH_JOB_PHASE_UNKNOWN" or "BATCH_JOB_PHASE_PENDING" or "BATCH_JOB_PHASE_RUNNING" or 4 more` - `"BATCH_JOB_PHASE_UNKNOWN"` - `"BATCH_JOB_PHASE_PENDING"` - `"BATCH_JOB_PHASE_RUNNING"` - `"BATCH_JOB_PHASE_SUCCEEDED"` - `"BATCH_JOB_PHASE_FAILED"` - `"BATCH_JOB_PHASE_ERROR"` - `"BATCH_JOB_PHASE_CANCELLED"` - **started\_at:** `string` - **status:** `"INDEX_JOB_STATUS_UNKNOWN" or "INDEX_JOB_STATUS_PARTIAL" or "INDEX_JOB_STATUS_IN_PROGRESS" or 4 more` - `"INDEX_JOB_STATUS_UNKNOWN"` - `"INDEX_JOB_STATUS_PARTIAL"` - `"INDEX_JOB_STATUS_IN_PROGRESS"` - `"INDEX_JOB_STATUS_COMPLETED"` - `"INDEX_JOB_STATUS_FAILED"` - `"INDEX_JOB_STATUS_NO_CHANGES"` - `"INDEX_JOB_STATUS_PENDING"` - **tokens:** `number` Number of tokens - **total\_datasources:** `number` Number of datasources being indexed - **total\_items\_failed:** `string` Total Items Failed - **total\_items\_indexed:** `string` Total Items Indexed - **total\_items\_skipped:** `string` Total Items Skipped - **updated\_at:** `string` Last modified - **uuid:** `string` Unique id