---
title: "Get warm hook"
method: GET
path: "/v1/environments/{environment_id}/warm-hooks"
tags: ["Hooks"]
---

# Get warm hook

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

## Request

- Base URL: `https://api.replicas.dev`
- URL: `https://api.replicas.dev/v1/environments/{environment_id}/warm-hooks`
- Auth: HTTP bearer

Returns the environment's warm hook, warm pool status, and up to 20 recent snapshots.

## Path parameters

- `environment_id` string, required

## Headers

- `X-Replicas-Api-Version` '2026-10-07'

## 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, sized from the environment's recent demand
    - `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: Whether the current generation has a base snapshot.
    - `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
  - `snapshots` WarmPoolSnapshotRecord[], required: Up to 20 retained snapshots ordered newest first.
    - `id` string, uuid, required: Snapshot record UUID used by the restore endpoint
    - `warm_pool_config_id` string, uuid, required
    - `generation` integer, required: Warm-pool generation that captured this snapshot
    - `is_current` boolean, required: Whether the config is currently installed on this snapshot. Restoring an older version moves this flag back onto that version.
    - `is_fallback` boolean, required: Whether this snapshot is serving while the current generation warms or recovers
    - `created_at` string, date-time, required
  - `builds` WarmPoolBuildRecord[], required: Up to 20 builds ordered newest first.
    - `id` string, uuid, required
    - `generation` integer, required
    - `status` 'queued' | 'building' | 'succeeded' | 'failed' | 'superseded' | 'cancelled', required
    - `reasons` string[], required: Every change folded into this build while it was queued
    - `attempts` integer, required
    - `queued_at` string, date-time, required
    - `build_after` string, date-time, required: When a queued build starts unless more edits push it back
    - `started_at` string, date-time, nullable, required
    - `finished_at` string, date-time, nullable, required
    - `superseded_by` string, uuid, nullable, required
    - `error_message` string, nullable, required
    - `builder_warm_pool_workspace_id` string, uuid, nullable, required: Warm pool workspace that ran the build; stream its output from `/v1/warm-pool-workspaces/{id}/stream`
    - `changes` EnvironmentChange[], required: Edits this build applies, including those of earlier builds that never went live
      - `kind` 'repositories' | 'warm_hook' | 'variable' | 'file' | 'skill' | 'skills_registry' | 'default_skills' | 'agent_auth' | 'workspace_size' | 'agent_setup' | 'restore' | 'system', required
      - `key` string, nullable, required: The edited row: variable key, file path, skill slug, registry, or provider
      - `op` 'created' | 'updated' | 'deleted', required
      - `user_id` string, uuid, nullable, required: Who made the edit
    - `failure_kind` 'hook' | 'infra' | 'null', nullable, required
    - `restorable` boolean, required: The setup this build made live is stored and can be restored with `POST /v1/environments/{environment_id}/restore`
  - `serving` WarmPoolServingState, required
    - `serving_build` WarmPoolBuildRecord, required: One warm pool generation that was asked to build.
      - `id` string, uuid, required
      - `generation` integer, required
      - `status` 'queued' | 'building' | 'succeeded' | 'failed' | 'superseded' | 'cancelled', required
      - `reasons` string[], required: Every change folded into this build while it was queued
      - `attempts` integer, required
      - `queued_at` string, date-time, required
      - `build_after` string, date-time, required: When a queued build starts unless more edits push it back
      - `started_at` string, date-time, nullable, required
      - `finished_at` string, date-time, nullable, required
      - `superseded_by` string, uuid, nullable, required
      - `error_message` string, nullable, required
      - `builder_warm_pool_workspace_id` string, uuid, nullable, required: Warm pool workspace that ran the build; stream its output from `/v1/warm-pool-workspaces/{id}/stream`
      - `changes` EnvironmentChange[], required: Edits this build applies, including those of earlier builds that never went live
        - `kind` 'repositories' | 'warm_hook' | 'variable' | 'file' | 'skill' | 'skills_registry' | 'default_skills' | 'agent_auth' | 'workspace_size' | 'agent_setup' | 'restore' | 'system', required
        - `key` string, nullable, required: The edited row: variable key, file path, skill slug, registry, or provider
        - `op` 'created' | 'updated' | 'deleted', required
        - `user_id` string, uuid, nullable, required: Who made the edit
      - `failure_kind` 'hook' | 'infra' | 'null', nullable, required
      - `restorable` boolean, required: The setup this build made live is stored and can be restored with `POST /v1/environments/{environment_id}/restore`
    - `serving_generation` integer, nullable, required
    - `serving_is_current` boolean, required
    - `ready_count` integer, required
    - `current_ready_count` integer, required
    - `pending_build` WarmPoolBuildRecord, required: One warm pool generation that was asked to build.
      - `id` string, uuid, required
      - `generation` integer, required
      - `status` 'queued' | 'building' | 'succeeded' | 'failed' | 'superseded' | 'cancelled', required
      - `reasons` string[], required: Every change folded into this build while it was queued
      - `attempts` integer, required
      - `queued_at` string, date-time, required
      - `build_after` string, date-time, required: When a queued build starts unless more edits push it back
      - `started_at` string, date-time, nullable, required
      - `finished_at` string, date-time, nullable, required
      - `superseded_by` string, uuid, nullable, required
      - `error_message` string, nullable, required
      - `builder_warm_pool_workspace_id` string, uuid, nullable, required: Warm pool workspace that ran the build; stream its output from `/v1/warm-pool-workspaces/{id}/stream`
      - `changes` EnvironmentChange[], required: Edits this build applies, including those of earlier builds that never went live
        - `kind` 'repositories' | 'warm_hook' | 'variable' | 'file' | 'skill' | 'skills_registry' | 'default_skills' | 'agent_auth' | 'workspace_size' | 'agent_setup' | 'restore' | 'system', required
        - `key` string, nullable, required: The edited row: variable key, file path, skill slug, registry, or provider
        - `op` 'created' | 'updated' | 'deleted', required
        - `user_id` string, uuid, nullable, required: Who made the edit
      - `failure_kind` 'hook' | 'infra' | 'null', nullable, required
      - `restorable` boolean, required: The setup this build made live is stored and can be restored with `POST /v1/environments/{environment_id}/restore`

## Other responses

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

---

[API](https://skmtc.dev/replicas/apis/replicas-api.md) - [All operations](https://skmtc.dev/replicas/apis/replicas-api/llms.txt) - [OpenAPI document](https://skmtc.dev/replicas/apis/replicas-api/revisions/2703ac1c9cb7?raw)
