# Access API by logged in user

**URL:** <https://community.auth0.com/t/access-api-by-logged-in-user/7499>\
**Category:** Get Help\
**Tags:** api-authorization, jwt, api, clients, users\
**Created:** [July 13, 2017, 11:39am UTC](https://community.auth0.com/t/access-api-by-logged-in-user/7499 "2017-07-13T11:39:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhilash1in](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@abhilash1in](https://community.auth0.com/u/abhilash1in)\
**Post date:** [July 13, 2017, 11:39am UTC](https://community.auth0.com/t/access-api-by-logged-in-user/7499/1 "2017-07-13T11:39:17Z")

</div>

I have an API which uses JWT for authorization. How can I make API calls from an application (mobile and web) for users logged in? For example, an API call to change the display name in the database, for the logged in user? Is it mandatory to make a HTTP request to `/authorize?audience=IDENTIFIER` to get a JWT first and then make a call to the API? Secondly, how can I make my API authorize users by just checking if they are logged in users or not? How to call such an API?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 13, 2017, 2:40pm UTC](https://community.auth0.com/t/access-api-by-logged-in-user/7499/2 "2017-07-13T14:40:05Z")

</div>

Like you mentioned the recommended way is to make an authorization request according to OAuth2 protocol and including the `audience` parameter with the value associated with your API. This will provide you with an access token (currently in a JWT format) that can then be used to call your API (assuming the API was already configured to accept access tokens issued by your Auth0 account).

The above is generally accomplished by performing a request to the `/authorize` endpoint and depending on the grant type being used a possible additional request to `/oauth/token` endpoint. The following documentation will guide you on the exact flow you should use depending on the type of the client application:

> **[Which OAuth 2.0 Flow Should I Use?](https://auth0.com/docs/get-started/authentication-and-authorization-flow/which-oauth-2-0-flow-should-i-use)**
>
> Learn how to identify the proper OAuth 2.0 flow for your use case.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/access-api-by-logged-in-user/7499/3 "2018-03-02T05:55:21Z")

</div>


