Skip to main content
POST
/
v1
/
environments
/
{environmentId}
/
warm-hooks
/
save-test
Save and Test Warm Hook
curl --request POST \
  --url https://api.tryreplicas.com/v1/environments/{environmentId}/warm-hooks/save-test \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>"
}
'
{
  "warm_hook": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "version": 123,
    "content": "<string>",
    "is_active": true,
    "created_at": "2023-11-07T05:31:56Z"
  },
  "test": {
    "exit_code": 123,
    "output": "<string>",
    "timed_out": true
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.replicas.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key authentication. Obtain your API key from the Replicas dashboard under Settings > API Keys.

Path Parameters

environmentId
string
required

Environment UUID, or the literal string global.

Body

application/json
content
string
required

Shell script to save and execute

Response

Warm hook saved (test result included in body)

warm_hook
object
required

A warm hook — the shell script that runs while pre-warming workspaces for an environment.

test
object
required

Result of running a warm hook script in an isolated sandbox.