---
title: "Replace jail lifecycle hooks"
method: PUT
path: "/jail/{ctid}/options/lifecycle-hooks"
tags: ["Jail"]
---

# Replace jail lifecycle hooks

`PUT /jail/{ctid}/options/lifecycle-hooks`

## Request

- Base URL: `https://sylve.lan:8181/api`
- URL: `https://sylve.lan:8181/api/jail/{ctid}/options/lifecycle-hooks`
- Auth: API key in header `Authorization`

Replace all six jail exec.* lifecycle-hook phases; every phase, enabled flag, and script must be supplied, and disabled empty scripts explicitly clear a phase

## Path parameters

- `ctid` integer, required

## Request body

- InternalHandlersJailModifyLifecycleHooksRequest
  - `hooks` InternalHandlersJailModifyLifecycleHooksPayload, required
    - `poststart` InternalHandlersJailModifyLifecycleHookPhaseRequest, required
      - `enabled` boolean, required
      - `script` string, required
    - `poststop` InternalHandlersJailModifyLifecycleHookPhaseRequest, required
      - `enabled` boolean, required
      - `script` string, required
    - `prestart` InternalHandlersJailModifyLifecycleHookPhaseRequest, required
      - `enabled` boolean, required
      - `script` string, required
    - `prestop` InternalHandlersJailModifyLifecycleHookPhaseRequest, required
      - `enabled` boolean, required
      - `script` string, required
    - `start` InternalHandlersJailModifyLifecycleHookPhaseRequest, required
      - `enabled` boolean, required
      - `script` string, required
    - `stop` InternalHandlersJailModifyLifecycleHookPhaseRequest, required
      - `enabled` boolean, required
      - `script` string, required

## Response `200`

Success

- GithubComAlchemillahqSylveInternalAPIResponseAny
  - `data` unknown
  - `error` string
  - `message` string
  - `status` string

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `413`: Request Entity Too Large
- `500`: Internal Server Error

## Changes

- **2026-08-12** `9a5026bf9057`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/alchemillahq/apis/sylve-api/changes/jail/:ctid/options/lifecycle-hooks/put.md)

---

[API](https://skmtc.dev/alchemillahq/apis/sylve-api.md) - [All operations](https://skmtc.dev/alchemillahq/apis/sylve-api/llms.txt) - [OpenAPI document](https://skmtc.dev/alchemillahq/apis/sylve-api/revisions/9565cdd0abf5?raw)
