Permission & Access Issues

Fix Access Denied When Creating a SharePoint Site Through the API

Olivia MillerOlivia Miller Nov 20, 2026 869 views

Question details

Determine why a SharePoint app receives an access denied error when creating a site through an API.

Fix Access Denied When Creating a SharePoint Site Through the API
Product
Microsoft SharePoint Online API
Device & OS
not provided
Scenario
An application attempts to create a SharePoint site using app-only authentication.
Observed behavior
The site creation request returns an UnauthorizedAccessException even though app-only permissions have been configured.
Before you start

Identify the exact API endpoint, authentication method, tenant, and site type used by the request. Have an administrator available to review application permissions and tenant-wide consent.

Solution 1Recommended

Verify API permissions, consent, and app-only support

Use this check when an app-only site creation request returns an access denied error.

1
Check the API endpoint

Review the request URL and method in your application or API client. Consult the documentation for that exact endpoint to confirm that it supports app-only site creation and identify its required permissions.

2
Review application permissions

In the Microsoft Entra admin center, open App registrations, select the app, and choose API permissions. Verify that the required application permissions are configured for the API being called, rather than relying only on delegated permissions.

3
Confirm tenant consent

On the app's API permissions page, check the consent status. If consent is missing, ask a suitably authorized administrator to select Grant admin consent for the tenant.

4
Inspect the access token

Acquire a new token after any permission or consent changes. Inspect its audience and roles locally or with a trusted diagnostic tool to confirm that it targets the API being called and contains the expected application roles.

5
Check endpoint prerequisites

Compare the request body, site type, tenant settings, and authentication method with the endpoint's documentation. Some site creation operations have additional administrative requirements or do not support every app-only authentication method.

Verify API permissions, consent, and app-only support
Keep credentials private: Do not publish access tokens, client secrets, certificates, or other credentials when troubleshooting.
Free Microsoft Office alternative

Work with Office documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with documents, spreadsheets, and presentations. Its Office format support helps you move existing files into a new workflow, though it does not fix SharePoint API permissions or create SharePoint sites.

Open and edit Microsoft Office formats, including DOCX, XLSX, and PPTXUse familiar editing tools for documents, spreadsheets, and presentationsMove existing Office files into a lightweight productivity suiteWork with site-related documents separately from SharePoint API troubleshooting
microsoft office alternative - wps office

Frequently Asked Questions

Why can site creation fail even after I add app permissions?

Adding permissions is not always sufficient. Check tenant admin consent, the token audience and roles, the endpoint's app-only support, and any site creation prerequisites in the endpoint documentation.

Where can I check whether admin consent was granted?

In the Microsoft Entra admin center, open App registrations, select your app, and go to API permissions. Review the status for the required permissions and ask an authorized administrator to grant consent if needed.

Do I need a new token after changing permissions?

Yes. Acquire a new access token after permissions or consent change, then check its audience and roles before retrying the API request.

What should I include in a SharePoint development support question?

Include the endpoint, HTTP method, site type, authentication method, permission manifest, consent status, full error message, and any correlation ID or timestamp. Remove tokens, secrets, certificates, and sensitive tenant information.