---
title: "Get Warm Hooks State"
method: GET
path: "/v1/environments/{environmentId}/warm-hooks"
tags: ["Environments"]
---

# Get Warm Hooks State

`GET /v1/environments/{environmentId}/warm-hooks`

Returns the active warm hook (if any) and warm pool config (if any) for the environment, along with current pool counts.

## Path parameters

- `environmentId` string, required

## Response `200`

Successful response

- GetWarmHooksResponse
  - `warm_hook` WarmHookRecord, required — A warm hook — the shell script that runs while pre-warming workspaces for an environment.
    - `id` string, uuid, required
    - `organization_id` string, uuid, required
    - `environment_id` string, uuid, required
    - `version` integer, required — Monotonic version (newer scripts have higher versions)
    - `content` string, required — Shell script content
    - `is_active` boolean, required — Whether this version is the active one for the environment
    - `created_at` string, date-time, required
  - `warm_pool` WarmPoolConfigWithStats, required — Warm pool configuration plus current pool counts.
    - `id` string, uuid, required
    - `organization_id` string, uuid, required
    - `environment_id` string, uuid, required
    - `enabled` boolean, required
    - `target_size` integer, required — Target number of pre-warmed workspaces (platform-controlled)
    - `generation` integer, required — Monotonic counter bumped on every invalidation. Workspaces and snapshots carry the generation they were built for; anything older is stale by derivation.
    - `error_count` integer, required — Consecutive reconcile failures since the last success. Resets to 0 on success; drives exponential backoff via `next_retry_at`.
    - `next_retry_at` string, date-time, nullable, required — Earliest time the next reconcile pass may run for this config. Null when not in backoff.
    - `last_error_at` string, date-time, nullable, required — When the most recent reconcile error was recorded (null if no current error).
    - `last_error_message` string, nullable, required — Most recent reconcile error message (null if no current error).
    - `has_base_snapshot` boolean, required — True when a base snapshot is installed for the current generation. For snapshot-capable providers (E2B), distinguishes the initial seed-build phase (false + warming > 0) from the clone-refill phase (true + warming > 0). Always false on providers without live snapshots.
    - `updated_at` string, date-time, required
    - `ready_count` integer, required — Number of pre-warmed workspaces at the current generation that are ready to be assigned
    - `stale_count` integer, required — Number of ready workspaces at older generations. Still claimable as a fallback; trimmed by reconcile when over target.
    - `warming_count` integer, required — Number of workspaces at the current generation that are currently warming (warm hooks running)
    - `snapshotting_count` integer, required — Number of seed workspaces currently capturing a base snapshot (E2B only). Always 0 on providers without live snapshots.
    - `last_failure_at` string, date-time, nullable, required — When the most recent warm-up failure occurred (null if never)
    - `last_failure_reason` string, nullable, required — Reason for the most recent warm-up failure

## Other responses

- `400` — Bad request - Missing or invalid parameters
- `401` — Unauthorized - Invalid or missing API key
- `500` — Internal server error

---

[API](https://skmtc.net/tryreplicas/apis/replica-api.md) · [All operations](https://skmtc.net/tryreplicas/apis/replica-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryreplicas/replica-api/versions/aa3b4c932f7a/schema)
