---
title: "Test warm hook"
method: POST
path: "/v1/environments/{environment_id}/warm-hooks/test"
tags: ["Hooks"]
---

# Test warm hook

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

## Request

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

Runs the script in a new sandbox without saving it. Takes 30–90 seconds.

## Path parameters

- `environment_id` string, required

## Headers

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

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