Skip to main content
POST
/
v1
/
environments
/
{environmentId}
/
start-hooks
/
save
Save Start Hook
curl --request POST \
  --url https://api.tryreplicas.com/v1/environments/{environmentId}/start-hooks/save \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>"
}
'
{
  "start_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"
  }
}

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 persist and activate

Response

Start hook saved and activated

start_hook
object
required

A start hook — the shell script that runs at workspace boot (after the warm sandbox is claimed) for an environment.