---
title: "Troubleshooting API authentication errors"
slug: "troubleshooting-api-authentication-errors"
updated: 2026-07-27T04:33:33Z
published: 2026-07-27T04:33:33Z
canonical: "docs.document360.com/troubleshooting-api-authentication-errors"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.document360.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting API authentication errors

### 403 error when using Try It!

**When it occurs:** Clicking Try It! on an endpoint immediately returns a 403 error after a spec has been successfully uploaded.

![API request interface showing authentication, request, and response sections with status codes.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/1_Screenshot-Troubleshooting_api_403_error.png)

**Why it happens:** The spec is missing a definition for the `BearerAuth` security mechanism under `components/securitySchemes`.

**How to fix it:**

1. Check your spec for a `BearerAuth` security scheme definition under `components/securitySchemes`.
2. If it is missing, add it:

```
   components:
     securitySchemes:
       BearerAuth:
         type: http
         scheme: bearer
```

1. Re-upload the spec.
2. During import, check the **Alerts** section for any warnings related to Bearer Authentication and address them.  

![Error messages displayed during API reference import, highlighting invalid identifiers.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/2_Screenshot-Troubleshooting_api_invalid_bearerauth_definition.png)

---

### 401 Unauthorized error from incorrect server URL

**When it occurs:** API requests return a 401 Unauthorized response when using Try It! or when making direct API calls.

**Why it happens:** The wrong region-based server URL is being used. For example, sending a request to `https://api.yourdomain.com` when the correct endpoint is `https://api.us.yourdomain.com` will cause authentication failures because the region-specific endpoint validates credentials differently.

**How to fix it:**

1. Confirm you are using the correct region-based URL for your account.
2. Ensure the correct client ID and client secret are being used with that URL.
3. Verify the authentication token is correctly included in the request header.
