# Best way to limit APIs per Application

**URL:** <https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490>\
**Category:** Get Help\
**Tags:** jwt, api, authentication, auth0\
**Created:** [February 17, 2022, 2:16pm UTC](https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490 "2022-02-17T14:16:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkulakou](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kkulakou/32/35297_2.png) [@kkulakou](https://community.auth0.com/u/kkulakou)\
**Post date:** [February 17, 2022, 2:16pm UTC](https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490/1 "2022-02-17T14:16:55Z")

</div>

I want to limit my audiences per client when going through code flow.

Right now I have multiple applications as well as multiple client. When I go through code flow I can include any API as an audience for my access token.

What I want to do is I want to limit my Application to have only be able to ask for one audience, so that when I go through code flow I will get unauthorized or bad request when I request wrong audience for that Application

We are fairly new to Auth0 provider and perhaps I am missing a setting somewhere.

(Audience is an API in dash board).

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [February 17, 2022, 8:13pm UTC](https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490/3 "2022-02-17T20:13:56Z")

</div>

Hi @kkulakou,

Welcome to the Auth0 Community!

I understand that you are looking to limit API access for your applications.

To do so, you will have to navigate to your API settings on your tenant dashboard settings and click on the _Machine to Machine Application_ tab.

On that page, you have the option to enable the applications you would like to grant API access. See below.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/b/2/b2016341dfdac5777cd4fc928f1e286a9667ef36.jpeg)

Once that is complete, the application can get an access token for the corresponding APIs and an unauthorized error otherwise.

Please do not hesitate to reach out if you have additional questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![kkulakou](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kkulakou/32/35297_2.png) [@kkulakou](https://community.auth0.com/u/kkulakou)\
**Post date:** [February 18, 2022, 3:40pm UTC](https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490/4 "2022-02-18T15:40:02Z")

</div>

> [@rueben.tiow](#):
>
> do so, you will have to navigate to your API se

Thank you for your suggestion. I am a little bit confused by this UI. This says Machine to Machine Application. In my case I will be going through `code` flow and not `client_credentials`.

It might that my explanation was a little bit off. I am going through grant flow and requesting tokens from specific application, also with request URL I pass `autdience` parameter. Audience is my APIs, so what I want to do is limit audience per applicatoin in `code` flow.

Thanks you!

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [February 18, 2022, 10:49pm UTC](https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490/5 "2022-02-18T22:49:27Z")

</div>

Hi @kkulakou,

I understand your confusion, and it is good feedback. For now, this is the way to enable API access to your **Machine-to-Machine** and **Regular Web Applications**. Single Page Applications and Native Apps are excluded from this list since they do not require additional configuration.

Note that granting API access through this interface is separate from the grant type flows such as `code` or `client_credentials` as you described.

In this case, granting your regular web app API access will still allow you to [call the API using the authorization code flow](https://auth0.com/docs/authorization/flows/call-your-api-using-the-authorization-code-flow). In the request, you can specify the API identifier in the `audience` parameter.

And to reiterate, regular web applications will only receive an unauthorized error when trying to authorize with an API that they do not have access to.

Hoped this helps!

Please let me know if you have any further questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![kkulakou](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kkulakou/32/35297_2.png) [@kkulakou](https://community.auth0.com/u/kkulakou)\
**Post date:** [February 22, 2022, 3:49pm UTC](https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490/6 "2022-02-22T15:49:01Z")

</div>

Thank you. Will take a look and try, and accept this as an answer if works as appropriate.

---

<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 9, 2022, 3:49pm UTC](https://community.auth0.com/t/best-way-to-limit-apis-per-application/78490/7 "2022-03-09T15:49:51Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
