COMMON HTTP 4XX CLIENT ERRORS

SharePoint Mentor Curated Articles

Common HTTP 4xx client errors in SharePoint Online, why they appear and how to resolve them.

These are the primary status codes users and developers encounter in the browser, REST/CSOM/Microsoft Graph calls, Power Automate, PowerShell, or apps.

400 Bad Request

Why it appears: The request is malformed or invalid. Common triggers include:

  • Invalid or malformed URL, query parameters, or request body (e.g., bad JSON in REST/Graph calls).
  • File/folder names containing forbidden characters (# % & * : < > ? / \), trailing spaces/periods, or overly long paths (SharePoint has path length limits).
  • Excessively large HTTP request headers (often from too many cookies after repeated sign-in attempts).
  • Incorrect OAuth endpoints, client secrets, or authentication configuration in custom apps/PowerShell.
  • Invalid list item data, missing required fields, or unsupported operations.
  • Browser/cache issues or TLS version mismatches on older clients.

How to correct it

  • Validate the full URL, parameters, and request body. Test with a simple name/path first.
  • Remove forbidden characters and shorten deep folder structures.
  • Clear browser cookies and cache (or use InPrivate/Incognito). For the specific “Header Field Too Long” variant, delete cookies.
  • For PowerShell (Connect-SPOService or PnP): Use Windows PowerShell compatibility mode if on PowerShell 7+, ensure correct admin URL format, and verify authentication method.
  • For API calls: Confirm request digest/form digest is valid and headers (especially Authorizationand Accept) are correct.
  • Check Microsoft 365 service health if the issue is widespread.

401 Unauthorized

Why it appears: Authentication is missing, expired, or invalid. The client is not properly signed in or the token is rejected.

  • Expired or missing access/refresh tokens.
  • Incorrect credentials or authentication method (e.g., legacy auth disabled).
  • Session timeout or Conditional Access / MFA requirements not met.
  • App-only authentication misconfigured (wrong client ID/secret/certificate).

How to correct it

  • Sign out and sign back in (preferably in a private browser window).
  • Clear browser cache/cookies and try again.
  • For apps: Refresh tokens properly, use the correct authentication flow, and ensure the app has the required Microsoft Graph or SharePoint permissions consented.
  • Verify the account is not blocked and that modern authentication is enabled.
  • Admins: Check Microsoft Entra ID sign-in logs for the failure reason.

403 Forbidden

Why it appears: The user or app is authenticated but lacks permission (or a policy blocks access).

  • Missing SharePoint permissions on the site, library, folder, or item (broken inheritance is common).
  • External sharing restrictions, domain allow/block lists, or guest access limits.
  • Site or OneDrive locked (NoAccess / read-only state), or the personal site is not provisioned.
  • Conditional Access policies, sensitivity labels, or information barriers.
  • File requires check-in before sharing/viewing.
  • Permissions not fully replicated after sharing (can take a few minutes).

How to correct it

  • Confirm effective permissions (Site settings → Site permissions → Check Permissions, or Manage Access on the item). Grant the needed role or restore inheritance if appropriate.
  • For shared links: Re-share the file/folder after ensuring it is checked in. Wait ~30 minutes for replication.
  • Admins: Unlock locked sites/OneDrives via SharePoint admin center or PowerShell (Set-SPOSite -LockState Unlock). Provision missing OneDrive sites if needed (Request-SPOPersonalSite).
  • Review external sharing settings at organization and site levels (SharePoint admin center → Sharing). Adjust domain restrictions if they are the cause.
  • Clear browser cache and test in a private window. Check service health.

404 Not Found

Why it appears: The requested resource (site, page, list, library, folder, or file) does not exist at the given URL.

  • Content was deleted, renamed, or moved.
  • Broken or outdated links (common after migrations or site renames).
  • Deleted site still within the 93-day retention window (or beyond).
  • Homepage deleted or not set correctly.
  • File never checked in (when “Require Check Out” is enabled) and therefore not visible to others.
  • Incorrect URL spelling/structure or tenant/site path changes.

How to correct it

  • Check the site Recycle Bin (and second-stage Recycle Bin) and restore the item (items are retained ~93 days total).
  • For deleted sites: SharePoint admin center → Active sites → Deleted sites → Restore (within retention period).
  • Verify the exact current URL by navigating from the site home or Site contents. Update bookmarks, email links, web parts, and document hyperlinks.
  • If the homepage is missing: Restore Home.aspx (or equivalent) from the Recycle Bin and set it as the home page, or create a new one.
  • Ensure the file is checked in before sharing.
  • After migrations, generate fresh sharing links rather than relying on old ones.

429 Too Many Requests

Why it appears: Throttling. The user, app, or tenant exceeded SharePoint Online’s rate limits (requests, resource units, ingress/egress) in a short time window.
Common with heavy CSOM/REST loops, migration tools, sync clients, custom web parts that poll frequently, or bulk operations. Microsoft Graph, CSOM, and REST all count toward limits. SharePoint returns a Retry-After header.

How to correct it

  • Honor the Retry-After value (and RateLimit-* headers when present) and implement exponential backoff.
  • Reduce concurrency and request volume: batch operations, use $select/$filter/$top to minimize data, prefer Microsoft Graph delta queries with tokens for scanning, and avoid request spikes.
  • Prefer Microsoft Graph over older CSOM/REST where possible (lower resource unit cost).
  • Run heavy jobs off-peak, decorate traffic with a meaningful User-Agent, and avoid creating multiple AppIDs for the same purpose.
  • For migrations or bulk tools: process in smaller batches and stagger jobs.
  • Persistent or severe cases can escalate to a temporary block (still returning 429/503); Microsoft notifies via the Message Center.