---
title: Job Tracking
slug: indexing-apis/job-tracking
docTags: 
createdAt: 2024-06-26T09:06:14.195Z
---

### Overview

The **Indexing Job Tracking API** is designed to monitor and manage the progress of jobs related to batch processing. These APIs allow users to track the status of jobs as they move through different stages: DONE, PROCESSING, and INITIALIZING.

Key features of the API include:

- **Job Status&#x20;**
  - Retrieve the current state of the job, helping to understand whether a job is completed (DONE), still in progress (PROCESSING), or just beginning (INITIALIZING).
- **Timestamps**

  &#x20;Access each job's start and end times, providing a timeline for tracking the job's execution duration.
- **Document Management**: Manage documents involved in the job, including:
  - **Docs in Request**

    The documents submitted in the job request.
  - **Docs Affected**

    &#x20;Documents that are impacted due to operations like inheritance, category updates.&#x20;
  - **Docs Completed**

    Track the document IDs of those that have successfully completed processing.

### Schema (Response)

```json
{
	"apiKey": "klevu-xxxxxxxxxxxxxxx",
	"jobId": "890709879342",
	"docsInRequest": ["cat1"],
	"docsAffected": [ "product1", "product2", ... ],
	"docsCompleted: [ "product1", ... ],
	"status": "INITIALIZING/PROCESSING/DONE",
	"jobType" : "BATCH_INDEX/BATCH_INDEX_PARTIAL_SAVE/BATCH_INDEX_DELETE/CHANNEL_DELETE/CHANNEL_UPDATE",
	"startTime": "2023-08-24T10:10:10.100Z",
	"endTime": "023-08-24T10:10:10.100Z"
}
```

### Understanding the response parameters&#x20;

**apiKey**&#x20;

This is the store's JS API Key. It can be obtained using [link](https://help.klevu.com/support/solutions/articles/5000876417-how-to-retrieve-store-specific-api-keys--js-template-version-and-end-points-for-product-sync--querying-indexed-data-and-submitting-analytics-events-)

**jobId**&#x20;

The unique ID represents an individual job.&#x20;

**docsInRequest**&#x20;

Originally received document id as part of user actions.

**docsAffected**&#x20;

All the document id which is going to be affected by user action eg. if we are updating the category name and it will affect 20 documents that is attached to that category, the service will get those 20 document IDs as affected documents.

**docsCompleted**&#x20;

All document IDs that are successfully cleared from the processing.&#x20;

**jobType**

Indicates the type of job submitted.

**status**

The status of the job, at the moment, we support three statuses. Here are the details: INITIALIZING - the job was accepted and is queued for processing. PROCESSING - Job is progressing through the system and Search is getting updated. DONE - Job is complete and all affected documents are updated on Search.

**startTime**

The timestamp when the job was initiated.&#x20;

**endTime** &#x20;

when status is changed to DONE, the system will use the timestamp to set this attribute in schema, it will determine at which time all documents were completed from the job.&#x20;

### API Specifications&#x20;

Please refer to **Job tracking&#x20;**&#x73;ection of [Swagger/OpenAPI Specification](docId\:W5iVV5Q4JjBfFywxDS5p8)&#x20;

