There’s a typescript client here, you could look at that for examples, I can’t see any dedicated API documentation anywhere https://github.com/LemmyNet/lemmy-js-client/tree/main/src
See more details in this issue here https://github.com/LemmyNet/lemmy/issues/2937
I would have agreed with you a couple of weeks ago, but this video explains it well. It wouldn’t be such a well known fallacy if it wasn’t so counterintuitive.
https://youtu.be/ytfCdqWhmdg?si=bNplB3ftYAfvnLYO