[docs] update Doxygen groupings for new APIs (#4166)

diff --git a/include/openthread/error.h b/include/openthread/error.h
index 3c4c2d5..3d7b749 100644
--- a/include/openthread/error.h
+++ b/include/openthread/error.h
@@ -123,11 +123,20 @@
  * @defgroup api-crypto              Crypto
  * @defgroup api-entropy             Entropy Source
  * @defgroup api-factory-diagnostics Factory Diagnostics
+ * @defgroup api-heap                Heap
  * @defgroup api-jam-detection       Jam Detection
  * @defgroup api-logging             Logging
  * @defgroup api-ncp                 Network Co-Processor
  * @defgroup api-network-time        Network Time Synchronization
- * @defgroup api-random              Random Number Generator
+ * @defgroup api-random-group        Random Number Generator
+ *
+ * @{
+ *
+ * @defgroup api-random-crypto       RNG Cryptographic
+ * @defgroup api-random-non-crypto   RNG Non-cryptographic
+ *
+ * @}
+ *
  * @defgroup api-sntp                SNTP
  *
  * @}
diff --git a/include/openthread/random_crypto.h b/include/openthread/random_crypto.h
index 42900ae..da4ba7b 100644
--- a/include/openthread/random_crypto.h
+++ b/include/openthread/random_crypto.h
@@ -45,7 +45,7 @@
 #endif
 
 /**
- * @addtogroup api-random
+ * @addtogroup api-random-crypto
  *
  * @brief
  *   This module includes functions that generates cryptographic random numbers.
diff --git a/include/openthread/random_noncrypto.h b/include/openthread/random_noncrypto.h
index 6b07cbc..40bb260 100644
--- a/include/openthread/random_noncrypto.h
+++ b/include/openthread/random_noncrypto.h
@@ -42,7 +42,7 @@
 #endif
 
 /**
- * @addtogroup api-random
+ * @addtogroup api-random-non-crypto
  *
  * @brief
  *   This module includes functions that generates non cryptographic random numbers.