> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# Get Update Status

GET https://acme.captain.dev/v1/indexes/{index}/updates

Get how far record changes have been applied: the last accepted and the last applied `seq`.

Reference: https://docs.runcaptain.com/reference/product-search/indexes/get-update-status

## Authentication

- `Authorization` header (bearer token, required) — A write key, issued by Captain. Server side only. Sent as Authorization: Bearer \<key>.

## Request

### Path parameters

- `index` (string, required) — index name

## Response

### 200

status

- `incarnation` (string, optional) — the index's incarnation, the same value as the X-Captain-Index-Incarnation header: it changes only when the index is deleted and created again, or restored from a backup. Seqs from different incarnations are not comparable
- `accepted_seq` (integer, optional)
- `keyword_seq` (integer, optional, nullable) — the last seq whose added and replaced records match keyword searches (names, brands, SKUs). It is never below applied_seq. null while loading
- `applied_seq` (integer, optional, nullable) — the last seq that search has fully applied: added and replaced records are fully searchable, with semantic matching and their final ranking. null while loading: nothing is applied yet on this server
- `pending` (integer, optional, nullable)
- `loading` (boolean, optional) — present and true while the index is still loading on this server after a restart: it is not served here yet (its searches answer 503 INDEX_LOADING)
- `last_lag_seconds` (double, optional, nullable)
- `last_applied` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaLastApplied, optional, nullable)
- `build` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaBuild, optional) — on servers that build by themselves (Product Search): where the automatic build stands. Small adds are searchable before it runs (keyword_seq, then applied_seq); larger ones when it finishes
- `paused` (enum, optional) — present while a backup holds: updates are accepted and applied when it ends
  - Allowed values: `backup`
- `publish_paused` (enum, optional) — present while a backup of this index is being taken: a finished build goes live when the backup releases. Absent for an index the backup does not snapshot
  - Allowed values: `backup`
- `hold_expires_at` (integer, optional) — with paused or publish_paused: unix seconds when the hold ends at the latest
- `eta` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEta, optional, nullable) — when added records waiting for a build, or being built, will be searchable, estimated from the work ahead of them and this tenant's recent build speeds; null when nothing waits

## Types

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaLastApplied

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaBuild

on servers that build by themselves (Product Search): where the automatic build stands. Small adds are searchable before it runs (keyword_seq, then applied_seq); larger ones when it finishes

- `automatic` (boolean, optional)
- `state` (enum, optional) — scaling: the next build waits while the tenant is resized to fit its records; search keeps serving the last build
  - Allowed values: `idle`, `waiting`, `building`, `scaling`, `failed`
- `eta_s` (integer, optional) — scaling: seconds until the records are searchable, about
- `starts_in_s` (double, optional) — waiting: seconds until it starts, if no more records arrive
- `after` (string, optional) — waiting: this index's own build still running; the next build starts after it
- `retry_in_s` (double, optional) — failed: seconds until the same records are built again (3 tries in all, 30 s then 120 s apart); absent when no try is left and only the next write starts another
- `progress` (BuildProgress, optional) — index.build: how far the build has got. records_done counts the records the running step has done; a step that doesn't count records (tables, verify, publish) reports every record done
- `job_id` (string, optional) — the build job; GET /v1/jobs/\{job\_id} answers for it with this index's write key
- `message` (string, optional) — why: failed, the reason; building while held for memory (other builds are using it), what it waits for

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEta

when added records waiting for a build, or being built, will be searchable, estimated from the work ahead of them and this tenant's recent build speeds; null when nothing waits

- `state` (enum, optional) — building: the build holding the records is running. fast_lane: no build is needed; keyword search finds the records already and their meaning is being added
  - Allowed values: `waiting`, `building`, `fast_lane`
- `mode` (enum, optional) — full: the whole index is built again. incremental: only changed records are written into the served index. fast_lane: no build, the records are being made fully searchable
  - Allowed values: `full`, `incremental`, `fast_lane`
- `records` (integer, optional) — records in the build
- `to_encode` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaToEncode, optional) — records the build processes from scratch (unchanged records are not processed again)
- `searchable_in_s` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaSearchableInS, optional) — seconds from now: low, likeliest (point) and high
- `searchable_by` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaSearchableBy, optional) — the same, as unix seconds
- `all_regions_in_s` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaAllRegionsInS, optional) — when builds replicate to other regions: seconds until every region serves the records
- `stages` (list of V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaStagesItems, optional) — the estimate step by step, in order; a finished step is 0. With mode fast_lane: keyword (done) and meaning (running, no time given)
- `basis` (string, optional) — where the speeds come from: index (its recent builds), tenant (other indexes' builds), default (no build measured yet: the first build on a tenant is least accurate); +other_layout when no build of this size's storage layout has run
- `jobs_measured` (integer, optional)
- `shared_with_builds` (integer, optional) — other indexes building at the same time
- `job_id` (string, optional)
- `keyword_first` (boolean, optional) — present and true on a new index's first build: it goes live for keyword searches before each record's meaning is added, so searchable_in_s estimates that moment
- `fully_searchable_in_s` (V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaFullySearchableInS, optional) — with keyword_first: seconds until the first build has added meaning too: low, likeliest (point) and high

### BuildProgress

index.build: how far the build has got. records_done counts the records the running step has done; a step that doesn't count records (tables, verify, publish) reports every record done

- `step` (string, optional) — the step running now, as named in stages; queued before the first, done after the last
- `step_number` (integer, optional) — its place in the build, from 1
- `steps` (integer, optional) — steps in this build
- `records_done` (integer, optional)
- `records_total` (integer, optional, nullable)
- `phase` (enum, optional) — the build in five phases a progress screen can show: prepare (read and analyze the records), encode (the records read for search and written), index (the search index built and checked), warm (the catalog read into memory), snapshot (a backup taken before the catalog goes live)
  - Allowed values: `queued`, `prepare`, `encode`, `index`, `warm`, `snapshot`, `done`
- `phase_number` (integer, optional) — 1 to phases; 0 while queued
- `phases` (integer, optional) — 5
- `phase_label` (string, optional) — the phase in plain words
- `phase_done` (integer, optional, nullable) — units done in this phase (phase_unit), never decreasing within it
- `phase_total` (integer, optional, nullable)
- `phase_unit` (enum, optional)
  - Allowed values: `records`, `percent`, `collections`
- `phase_fraction` (double, optional, nullable) — 0 to 1; null when the phase has no count of its own
- `fraction` (double, optional) — 0 to 1 for the whole build, by the phases' measured share of a build's time
- `skipped_phases` (list of string, optional) — phases this build does not run (warm without a warm keeper, snapshot on a cell that does not replicate)
- `eta_s` (BuildProgressEtaS, optional, nullable) — seconds until the index is searchable, as GET .../updates estimates it: \{low, point, high}

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaToEncode

records the build processes from scratch (unchanged records are not processed again)

- `low` (integer, optional)
- `high` (integer, optional)

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaSearchableInS

seconds from now: low, likeliest (point) and high

- `low` (double, optional)
- `point` (double, optional)
- `high` (double, optional)

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaSearchableBy

the same, as unix seconds

- `low` (integer, optional)
- `point` (integer, optional)
- `high` (integer, optional)

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaAllRegionsInS

when builds replicate to other regions: seconds until every region serves the records

- `low` (double, optional)
- `point` (double, optional)
- `high` (double, optional)

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaStagesItems

- `name` (enum, optional)
  - Allowed values: `queue`, `prepare`, `dense`, `splade`, `upload`, `tables`, `verify`, `replicate`, `keyword`, `meaning`
- `status` (string, optional)
- `low_s` (double, optional)
- `point_s` (double, optional)
- `high_s` (double, optional)
- `units` (integer, optional)
- `basis` (string, optional)

### V1IndexesIndexUpdatesGetResponsesContentApplicationJsonSchemaEtaFullySearchableInS

with keyword_first: seconds until the first build has added meaning too: low, likeliest (point) and high

- `low` (double, optional)
- `point` (double, optional)
- `high` (double, optional)

### BuildProgressEtaS

seconds until the index is searchable, as GET .../updates estimates it: \{low, point, high}

## Examples

**Response**

```json
{
  "accepted_seq": 1844,
  "applied_seq": 1844,
  "pending": 0
}
```

**SDK Code**

```python Python REST
import json
import requests

BASE_URL = "https://acme.captain.dev"
API_KEY = "your_write_key"
INDEX = "products"

headers = {
    "Authorization": f"Bearer {API_KEY}",
}

response = requests.get(
    f"{BASE_URL}/v1/indexes/{INDEX}/updates",
    headers=headers,
    timeout=30.0,
)

print(json.dumps(response.json(), indent=2))
```

```typescript TypeScript REST
const BASE_URL = "https://acme.captain.dev";
const API_KEY = "your_write_key";
const index = "products";

const response = await fetch(`${BASE_URL}/v1/indexes/${index}/updates`, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
  },
});

const result = await response.json();
console.log(JSON.stringify(result, null, 2));
```