# PATCH /services/{name}

First published 14 Oct 2026 (release 0.2.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the services group.

Configure monitoring and startup at boot for a daemon

- Who may call it: administrator
- Token scope, any of: settings, all
- Answers: 200 OK

Supply at least one setting for an installed daemon. UrbeStack applies the supplied settings together. The watched field controls whether the monitor watches the daemon. UrbeStack always watches its own daemons.

The rounds field sets how many consecutive rounds without an answer trigger a restart, from 1 to 10. The timeout field sets the health check timeout, from 1 to 30 seconds. Set depth to answer for a service-specific health check or process to check only whether the process is running.

Set at_boot to true to enable startup at boot without starting the daemon now. If the daemon already starts at boot, UrbeStack rejects the request and discards any monitoring settings supplied with it. A false value for at_boot has no effect.

Invalid name syntax, invalid rounds, timeout, or depth values, and requests without an applicable setting return HTTP 400.

## As a command

- [urbestack-service-set](https://urbestack.com/docs/commands/urbestack-service-set.md): Configures monitoring and startup at boot for a daemon.

## Parameters

- `name` (path, string, matching ^[a-z][a-z0-9.-]{0,39}$, required): UrbeStack daemon name returned by GET /services, such as postfix, php-8.3, panel-web, or mariadb.

## Request body

JSON, the type [ServiceSettings](https://urbestack.com/docs/api/types/ServiceSettings.md).

- `at_boot` (boolean)
- `depth` (string, one of answer, process)
- `rounds` (integer, 1 to 10)
- `timeout` (integer, 1 to 30)
- `watched` (boolean)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X PATCH "$API/services/alice" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "at_boot": true,
    "depth": "answer",
    "rounds": 1,
    "timeout": 1,
    "watched": true
  }'
```

Response, 200 OK:

```
{
  "daemon": {
    "at_boot": true,
    "check": {
      "ok": true,
      "words": "text"
    },
    "checked_by": "text",
    "cuts": "text",
    "depth": "answer",
    "falls_30d": 1,
    "group": "Panel",
    "guard": 1,
    "has_log": true,
    "installed": true,
    "last_check_at": "text",
    "last_check_words": "text",
    "last_restart_at": "text",
    "may_disable": true,
    "may_stop": true,
    "name": "alice",
    "need": "text",
    "pid": 1,
    "role": "user",
    "rounds": 1,
    "since": "text",
    "state": "up",
    "stopped_at": "text",
    "stopped_by": "text",
    "stopped_from": "text",
    "systemd_restarts": 1,
    "timeout": 1,
    "unit": "text",
    "version": "0.0.1",
    "watched": true
  }
}
```

## Errors

- 400: --name is required
- 400: --watched is on or off
- 400: <name> already starts at boot
- 400: <name> is not installed on this server
- 400: A daemon is named with letters, digits, dots and hyphens
- 400: Invalid boolean
- 400: Nothing to set: give --watched, --rounds, --timeout, --depth or --at-boot
- 400: The check waits 
- 400: The depth is answer (a service-specific health check) or process (process only)
- 400: The panel's own daemons are always watched
- 400: The rounds without an answer before a restart are 
- 400: body needs one of watched, rounds, timeout, depth, at_boot
- 401: Authentication required
