> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetStorageUsage

# Package: businessEmail

# Namespace: GoogleSubscriptions

# Method link: https://dev.wix.com/docs/api-reference/account-level/premium/business-email/google-subscription-v1/get-storage-usage.md

## Permission Scopes:
Read Business Email: SCOPE.ACC-DC-PREMIUM.READ-MAILBOXES

## Introduction

Retrieves how much storage a Google Workspace has used out of its pooled quota.

The numbers come from Google's daily usage report, so they trail live usage by about a day. `asOfDate` is the report day.

The response is empty when no usage data is available. For example, when the subscription isn't live, when Google doesn't grant access to the customer's reports, or when the day's report isn't published yet.

Storage usage isn't available for every caller. When it isn't available, the response is empty.

---

## REST API

### Schema

```
 Method: getStorageUsage
 Description: Retrieves how much storage a Google Workspace has used out of its pooled quota.  The numbers come from Google's daily usage report, so they trail live usage by about a day. `asOfDate` is the report day.  The response is empty when no usage data is available. For example, when the subscription isn't live, when Google doesn't grant access to the customer's reports, or when the day's report isn't published yet.  Storage usage isn't available for every caller. When it isn't available, the response is empty.
 URL: https://www.wixapis.com/google-subscriptions/v1/google-subscriptions/storage-usage/{googleWorkspacePremiumId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  googleWorkspacePremiumId
 Method parameters: 
   param name: googleWorkspacePremiumId | type:   none | required: true 
 Return type: GetStorageUsageResponse
  - name: asOfDate | type: string | description: Day of the usage report the numbers describe, in `YYYY-MM-DD` format. Google publishes storage usage once a day, using the UTC-8 time zone, so the numbers trail live usage.  Returned only when usage data is available.  | validation: maxLength 10
  - name: usedMb | type: string | description: Storage used across the whole Google Workspace, in MB. Includes all mailboxes, Google Drive, and Google Photos.  | validation: format int64
  - name: quotaMb | type: string | description: Pooled storage quota, in MB, shared by all users. Equals the edition's storage allowance per seat multiplied by the number of licensed seats.  | validation: format int64

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: PERMISSION_DENIED_FOR_STORAGE_USAGE | Description: The caller's account doesn't own the Google Workspace.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: NOT_FOUND_GWS_FOR_STORAGE_USAGE | Description: Couldn't find the Google Workspace.


```

### Examples

### Retrieve a Google Workspace's storage usage
Retrieves how much storage a Google Workspace has used out of its pooled quota.

```curl
curl -X GET \
'https://www.wixapis.com/google-subscriptions/v1/google-subscriptions/storage-usage/3f8c1d2e-7a4b-4c9e-b1d5-6e2f0a9c8b74' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.premium.googleSubscriptions.getStorageUsage(googleWorkspacePremiumId)
 Description: Retrieves how much storage a Google Workspace has used out of its pooled quota.  The numbers come from Google's daily usage report, so they trail live usage by about a day. `asOfDate` is the report day.  The response is empty when no usage data is available. For example, when the subscription isn't live, when Google doesn't grant access to the customer's reports, or when the day's report isn't published yet.  Storage usage isn't available for every caller. When it isn't available, the response is empty.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  googleWorkspacePremiumId
 Method parameters: 
   param name: googleWorkspacePremiumId | type: string | description: Premium subscription GUID of the Google Workspace whose storage usage to retrieve. | required: true | validation: format GUID
 Return type: PROMISE<GetStorageUsageResponse>
  - name: asOfDate | type: string | description: Day of the usage report the numbers describe, in `YYYY-MM-DD` format. Google publishes storage usage once a day, using the UTC-8 time zone, so the numbers trail live usage.  Returned only when usage data is available.  | validation: maxLength 10
  - name: usedMb | type: string | description: Storage used across the whole Google Workspace, in MB. Includes all mailboxes, Google Drive, and Google Photos.  | validation: format int64
  - name: quotaMb | type: string | description: Pooled storage quota, in MB, shared by all users. Equals the edition's storage allowance per seat multiplied by the number of licensed seats.  | validation: format int64

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: PERMISSION_DENIED_FOR_STORAGE_USAGE | Description: The caller's account doesn't own the Google Workspace.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: NOT_FOUND_GWS_FOR_STORAGE_USAGE | Description: Couldn't find the Google Workspace.


```

### Examples

### Retrieve a Google Workspace's storage usage
Retrieves how much storage a Google Workspace has used out of its pooled quota.

```javascript
import { googleSubscriptions } from "@wix/premium";

async function getStorageUsage() {
  const response = await googleSubscriptions.getStorageUsage(
    "3f8c1d2e-7a4b-4c9e-b1d5-6e2f0a9c8b74",
  );
}

/* Promise resolves to:
 * {
 *   "asOfDate": "2026-10-04",
 *   "usedMb": 18432,
 *   "quotaMb": 153600
 * }
 */

```

### getStorageUsage (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { googleSubscriptions } from '@wix/premium';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { googleSubscriptions },
  // Include the auth strategy and host as relevant
});


async function getStorageUsage(googleWorkspacePremiumId) {
  const response = await myWixClient.googleSubscriptions.getStorageUsage(googleWorkspacePremiumId);
};
```

---