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

# Test Warm Hook

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

Runs the supplied script in an isolated sandbox without persisting it. Useful for iterating on a warm hook from the API before committing it via `save-test`. Takes 30–90 seconds to return.

## Path parameters

- `environmentId` string, required

## Request body

- TestWarmHookRequest
  - `content` string, required — Shell script to execute (not persisted)

## Response `200`

Test executed

- TestWarmHookResponse
  - `test` WarmHookTestResult, required — Result of running a warm hook script in an isolated sandbox.
    - `exit_code` integer, required — Process exit code (0 = success)
    - `output` string, required — Captured stdout + stderr
    - `timed_out` boolean, required — Whether execution was killed for taking too long

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