web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I authenticate ...
Power Apps
Unanswered

How do I authenticate to create a model-driven power app via the web api?

(0) ShareShare
ReportReport
Posted on by 6

When following the docs to create a model-driven power app using code, what steps do I need to take to successfully make this post request below? I am currently getting a status of 401. Where do I find the bearer token?

https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/create-manage-model-driven-apps-using-code

 

```

POST [Organization URI]/api/data/v9.0/appmodules HTTP/1.1
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0
Accept: application/json

{
"name": "SDKTestApp",
"uniquename":"SDKTestApp",
"webresourceid":"953b9fac-1e5e-e611-80d6-00155ded156f"
}
```

  • thomasfnorthrup Profile Picture
    252 on at

    Hello, thanks for reaching out. 

    For custom development you need to authenticate to the API using Oauth. This link walks through the requirements. You need to create an application registration in your Azure AD, give it permissions to Dynamics 365 or Dataverse, then create an app user in the Power Platform Admin center. Then you use the client id and secret from the app registration to make a call to get the bearer token which you then pass into your call to the API. 

    Use OAuth authentication with Microsoft Dataverse (Dataverse) - Power Apps | Microsoft Learn

     

    If this helped please mark as a solution or give a kudos. 

    Have a wonderful day!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard