Sanitizing textarea for wp_insert_post with TinyMCE enabled or disabled

All you need to know about the sanitization and escaping function is within the codex: https://codex.wordpress.org/Data_Validation

In anycase, you should find usefull wp_kses_* functions, particular wp_kses_post

What function to use depend by what you want to filter and sanitize.

error code: 523