---
title: "Save Warm Hook"
method: POST
path: "/v1/environments/{environmentId}/warm-hooks/save"
tags: ["Environments"]
---

# Save Warm Hook

`POST /v1/environments/{environmentId}/warm-hooks/save`

Persists and activates the supplied script as the warm hook for the environment without running a test. Use this when you want to save quickly without waiting for a sandbox to spin up.

## Path parameters

- `environmentId` string, required

## Request body

- SaveWarmHookRequest
  - `content` string, required — Shell script to persist and activate

## Response `201`

Warm hook saved and activated

- SaveWarmHookResponse
  - `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

## 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)
