# Logging in discourse using API - using discourse as API server only

**URL:** <https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938>\
**Category:** Development\
**Created:** [Août 28, 2017, 4:00 UTC](https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938 "2017-08-28T16:00:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [Août 28, 2017, 8:02 UTC](https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938/2 "2017-08-28T20:02:22Z")

</div>

You would have to adhere to our user API to log people in, that is what our mobile app does.

The protocol is quite involved and not super documented, recommend you read through the source of discourse mobile. [GitHub - discourse/DiscourseMobile: Discourse Mobile · GitHub](https://github.com/discourse/DiscourseMobile)

In particular:

> <https://github.com/discourse/DiscourseMobile/blob/main/js/site_manager.js#L453-L487>

Either that or if you don’t need to allow the user to do this, just specify `api_username` when you make your API calls with the master id.

Yes Discourse can be used an API server.

---

_[View the full topic](https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938)._
