---
schema_version: "1"
id: f8aaebb37e80a70746514bf3bdc1d053ea2b4526a6b9633fc8e9c4c32db31382
title: Ensure Secure API Responses for Unauthenticated Requests
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/b2c_rn_25_5_api_responses.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.b2c_rn_25_5_api_responses.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b4898a7757b25b740a3cfc65a463fe889987ec053afec3262878d87dd5368cde
description: We've updated the authentication handling for the GET/sandboxes and POST /realms/usages ODS API responses. The responses now return a 401 unauthorized status code with a structured error response for unauthenticated requests. This change enhances security and aligns with standard HTTP practices.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Ensure Secure API Responses for Unauthenticated Requests

We've updated the authentication handling for the `GET/sandboxe`s and `POST /realms/usages` ODS API responses. The responses now return a 401 unauthorized status code with a structured error response for unauthenticated requests. This change enhances security and aligns with standard HTTP practices.

**How:** Admins and developers should ensure that all API requests are properly authenticated to avoid receiving a 401 unauthorized status code. For unauthenticated requests, the API now returns a structured error response indicating the need for full authentication.

Previouw Response:

```
{
      "kind": "SandboxList",
      "code": 200,
      "status": "Success"
      }
    
```

Updated Response

```
{
      "kind": "Status",
      "code": 401,
      "status": "Failure",
      "error": {
      "status": "Failure",
      "message": "Full authentication is required to access this resource",
      "reason": "Unauthorized"
      }
    
```