---
title: "Test Start Hook (Streaming)"
method: POST
path: "/v1/environments/{environmentId}/start-hooks/test/stream"
tags: ["Environments"]
---

# Test Start Hook (Streaming)

`POST /v1/environments/{environmentId}/start-hooks/test/stream`

Provisions an isolated sandbox, runs the supplied start hook script, and streams output back as Server-Sent Events. Use this instead of a synchronous test endpoint to avoid gateway timeouts on long-running hooks. Events emitted: `progress` (status messages), `output` (captured stdout/stderr), `complete` (final `exit_code` and `timed_out`), and `error` (terminal failure).

## Path parameters

- `environmentId` string, required

## Request body

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

## Response `200`

SSE stream of start hook test events

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