I'm currently working on an OpenAPI (Swagger) document for the v2 API. I still have a number of endpoints to add and I've been guessing some of the field descriptions but I hope others will find it useful. I'd be happy if MangaDex decides to use what I started and refine it as well. 😄
If there are any suggestions or fixes, feel free to submit a merge request or create an issue in the project.
https://gitlab.com/gondolyr/mangadex-api/-/blob/main/src/v2/openapi.yaml
Regarding login examples, I've made a login function in Rust which stores the session in the HTTP client: https://gitlab.com/gondolyr/mangascholar/-/blob/master/mangascholar_api/src/sources/mangadex.rs#L287
There's also the Komikku project (written in Python) which also uses the AJAX endpoint to log in: https://gitlab.com/valos/Komikku/-/blob/master/komikku/servers/mangadex.py#L289
Edit 2020-11-14: I've finished adding all of the public endpoints to the best of my understanding for the OpenAPI document.