I'm not sure I said thoroughly But hopefully it will be good enough. It will mostly be automatically generated from within the code itself. For a sneak peek at what that looks like in code you can check out
src/XF/Api/Controller/Threads.php
and actionPost()