diff --git a/doc/libnetconf.doc b/doc/libnetconf.doc
index 20be760..c4d7353 100644
--- a/doc/libnetconf.doc
+++ b/doc/libnetconf.doc
@@ -289,8 +289,6 @@
  * determined by the context used when accepting new NETCONF sessions. Few capabilities that
  * cannot be learnt from the context are set with separate functions
  * ::nc_server_set_capab_withdefaults() and generally ::nc_server_set_capability().
- * Timeout for receiving the _hello_ message on a new session can be set
- * by ::nc_server_set_hello_timeout().
  *
  * Context does not only determine server modules, but its overall
  * functionality as well. For every RPC the server should support,
@@ -310,7 +308,6 @@
  *
  * - ::nc_server_set_capab_withdefaults()
  * - ::nc_server_set_capability()
- * - ::nc_server_set_hello_timeout()
  *
  * Server Configuration
  * ===
@@ -701,8 +698,8 @@
  * You can adjust active and inactive read timeout using `cmake` variables.
  * For details look into `README.md`.
  *
- * API Functions
- * -------------
+ * Configurable timeouts
+ * ---------------------
  *
  * Once a new connection is established including transport protocol negotiations,
  * _hello_ message is exchanged. You can set how long will the server wait for
@@ -712,19 +709,10 @@
  * To free up some resources, it is possible to adjust the maximum idle period
  * of a session before it is disconnected. In _Call Home_, for both a persistent
  * and periodic connection can this idle timeout be specified separately for each
- * client using corresponding functions. Unlike other timeouts, the idle timeout
- * can only be set via applying configuration data.
- *
- * Lastly, SSH user authentication timeout can be also modified. It is the time
+ * client. Lastly, SSH user authentication timeout can be also modified. It is the time
  * a client has to successfully authenticate after connecting before it is disconnected.
  *
- * Functions List
- * --------------
- *
- * Available in __nc_server.h__.
- *
- * - ::nc_server_set_hello_timeout()
- * - ::nc_server_get_hello_timeout()
+ * These timeouts can be toggled by applying corresponding configuration data.
  */
 
 /**
diff --git a/modules/libnetconf2-netconf-server@2023-09-07.yang b/modules/libnetconf2-netconf-server@2023-09-07.yang
index 2f9d26f..9708c54 100644
--- a/modules/libnetconf2-netconf-server@2023-09-07.yang
+++ b/modules/libnetconf2-netconf-server@2023-09-07.yang
@@ -240,6 +240,24 @@
         https://cvsweb.openbsd.org/src/usr.bin/ssh/PROTOCOL?annotate=HEAD";
   }
 
+  augment "/ncs:netconf-server" {
+    leaf hello-timeout {
+      type uint16;
+      default 60;
+      description
+        "Represents the maximum number of seconds the server will wait for receiving a hello message.";
+    }
+  }
+
+  augment "/ncs:netconf-server" {
+    leaf idle-timeout {
+      type uint16;
+      default 0;
+      description
+        "Represents the maximum number of seconds a NETCONF session may remain idle. The value of 0 represents indefinitely.";
+    }
+  }
+
   augment "/ncs:netconf-server/ncs:listen/ncs:endpoint/ncs:transport/ncs:ssh/ncs:ssh/ncs:ssh-server-parameters/ncs:client-authentication" {
     leaf auth-attempts {
       type uint16;
diff --git a/src/server_config.c b/src/server_config.c
index 328367b..63bf0c1 100644
--- a/src/server_config.c
+++ b/src/server_config.c
@@ -1157,20 +1157,29 @@
 
 /* default leaf */
 static int
+nc_server_config_hello_timeout(const struct lyd_node *node, NC_OPERATION op)
+{
+    assert(!strcmp(LYD_NAME(node), "hello-timeout"));
+
+    if ((op == NC_OP_CREATE) || (op == NC_OP_REPLACE)) {
+        server_opts.hello_timeout = strtoul(lyd_get_value(node), NULL, 10);
+    } else {
+        /* default value */
+        server_opts.hello_timeout = 60;
+    }
+
+    return 0;
+}
+
+/* default leaf */
+static int
 nc_server_config_idle_timeout(const struct lyd_node *node, NC_OPERATION op)
 {
     struct nc_ch_client *ch_client;
 
     assert(!strcmp(LYD_NAME(node), "idle-timeout"));
 
-    if (is_listen(node)) {
-        if ((op == NC_OP_CREATE) || (op == NC_OP_REPLACE)) {
-            server_opts.idle_timeout = strtoul(lyd_get_value(node), NULL, 10);
-        } else {
-            /* default value */
-            server_opts.idle_timeout = 180;
-        }
-    } else {
+    if (is_ch(node)) {
         /* call-home idle timeout */
         if (nc_server_config_get_ch_client_with_lock(node, &ch_client)) {
             /* to avoid unlock on fail */
@@ -1184,6 +1193,14 @@
         }
 
         nc_ch_client_unlock(ch_client);
+    } else {
+        /* whole server idle timeout */
+        if ((op == NC_OP_CREATE) || (op == NC_OP_REPLACE)) {
+            server_opts.idle_timeout = strtoul(lyd_get_value(node), NULL, 10);
+        } else {
+            /* default value */
+            server_opts.idle_timeout = 0;
+        }
     }
 
     return 0;
@@ -4207,8 +4224,8 @@
         ret = nc_server_config_listen(node, op);
     } else if (!strcmp(name, "call-home")) {
         ret = nc_server_config_ch(node, op);
-    } else if (!strcmp(name, "idle-timeout")) {
-        ret = nc_server_config_idle_timeout(node, op);
+    } else if (!strcmp(name, "hello-timeout")) {
+        ret = nc_server_config_hello_timeout(node, op);
     } else if (!strcmp(name, "endpoint")) {
         ret = nc_server_config_endpoint(node, op);
     } else if (!strcmp(name, "unix-socket")) {
@@ -4309,6 +4326,8 @@
         ret = nc_server_config_period(node, op);
     } else if (!strcmp(name, "anchor-time")) {
         ret = nc_server_config_anchor_time(node, op);
+    } else if (!strcmp(name, "idle-timeout")) {
+        ret = nc_server_config_idle_timeout(node, op);
     } else if (!strcmp(name, "reconnect-strategy")) {
         ret = nc_server_config_reconnect_strategy(node, op);
     } else if (!strcmp(name, "start-with")) {
diff --git a/src/session_server.c b/src/session_server.c
index 7e37cb0..be53450 100644
--- a/src/session_server.c
+++ b/src/session_server.c
@@ -959,24 +959,6 @@
     server_opts.content_id_data_free = free_user_data;
 }
 
-API void
-nc_server_set_hello_timeout(uint16_t hello_timeout)
-{
-    server_opts.hello_timeout = hello_timeout;
-}
-
-API uint16_t
-nc_server_get_hello_timeout(void)
-{
-    return server_opts.hello_timeout;
-}
-
-API uint16_t
-nc_server_get_idle_timeout(void)
-{
-    return server_opts.idle_timeout;
-}
-
 API NC_MSG_TYPE
 nc_accept_inout(int fdin, int fdout, const char *username, const struct ly_ctx *ctx, struct nc_session **session)
 {
diff --git a/src/session_server.h b/src/session_server.h
index 660bada..d9486f0 100644
--- a/src/session_server.h
+++ b/src/session_server.h
@@ -200,20 +200,6 @@
         void (*free_user_data)(void *user_data));
 
 /**
- * @brief Set server timeout for receiving a hello message.
- *
- * @param[in] hello_timeout Hello message timeout. 0 for infinite waiting.
- */
-void nc_server_set_hello_timeout(uint16_t hello_timeout);
-
-/**
- * @brief get server timeout for receiving a hello message.
- *
- * @return Hello message timeout, 0 is infinite.
- */
-uint16_t nc_server_get_hello_timeout(void);
-
-/**
  * @brief Get all the server capabilities including all the schemas.
  *
  * A few capabilities (with-defaults, interleave) depend on the current
