> 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

# ObserveEmailActions

# Package: businessEmail

# Namespace: GoogleProductEligibility

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

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

## Introduction

Evaluates the email recovery state of the specified domains.

Returns only how many domains were evaluated and how many were skipped. Results for individual domains aren't returned, and the method doesn't change any data.

Domains the caller's account doesn't own are skipped. Up to 20 distinct domains are evaluated per request, and any others are counted in `skipped`.

Evaluation isn't available for every caller. When it isn't available, every requested domain is counted in `skipped`.

---

## REST API

### Schema

```
 Method: observeEmailActions
 Description: Evaluates the email recovery state of the specified domains.  Returns only how many domains were evaluated and how many were skipped. Results for individual domains aren't returned, and the method doesn't change any data.  Domains the caller's account doesn't own are skipped. Up to 20 distinct domains are evaluated per request, and any others are counted in `skipped`.  Evaluation isn't available for every caller. When it isn't available, every requested domain is counted in `skipped`.
 URL: https://www.wixapis.com/google-subscriptions/v1/google-subscriptions/observe-email-actions
 Method: POST
 Method parameters:
   param name: domainNames | type: array<domainNames> | description: Domains to evaluate. For example, `my-domain.com`.  Duplicates are ignored, regardless of case. Domains the caller's account doesn't own are skipped.  Up to 20 distinct domains are evaluated per request. Any others are counted in `skipped`.  | validation: minItems 1, maxItems 50, format HOSTNAME
 Return type: ObserveEmailActionsResponse
  - name: observed | type: integer | description: Number of distinct domains that were evaluated. Includes domains where some of the data needed for the evaluation couldn't be read.  
  - name: skipped | type: integer | description: Number of requested domains that weren't evaluated. Includes duplicates, domains the caller's account doesn't own, domains beyond the per-request limit, and domains whose evaluation failed.  


```

### Examples

### Evaluate the email recovery state of domains
Evaluates the email recovery state of 2 domains owned by the caller's account.

```curl
curl -X POST \
'https://www.wixapis.com/google-subscriptions/v1/google-subscriptions/observe-email-actions' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "domainNames": [
    "my-domain.com",
    "my-shop.com"
  ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.premium.googleSubscriptions.observeEmailActions(options)
 Description: Evaluates the email recovery state of the specified domains.  Returns only how many domains were evaluated and how many were skipped. Results for individual domains aren't returned, and the method doesn't change any data.  Domains the caller's account doesn't own are skipped. Up to 20 distinct domains are evaluated per request, and any others are counted in `skipped`.  Evaluation isn't available for every caller. When it isn't available, every requested domain is counted in `skipped`.
 Method parameters:
   param name: options | type: ObserveEmailActionsOptions  none  
        - name: domainNames | type: array<string> | description: Domains to evaluate. For example, `my-domain.com`.  Duplicates are ignored, regardless of case. Domains the caller's account doesn't own are skipped.  Up to 20 distinct domains are evaluated per request. Any others are counted in `skipped`.  | validation: minItems 1, maxItems 50, format HOSTNAME
 Return type: PROMISE<ObserveEmailActionsResponse>
  - name: observed | type: integer | description: Number of distinct domains that were evaluated. Includes domains where some of the data needed for the evaluation couldn't be read.  
  - name: skipped | type: integer | description: Number of requested domains that weren't evaluated. Includes duplicates, domains the caller's account doesn't own, domains beyond the per-request limit, and domains whose evaluation failed.  


```

### Examples

### Evaluate the email recovery state of domains
Evaluates the email recovery state of 2 domains owned by the caller's account.

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

async function observeEmailActions() {
  const response = await googleSubscriptions.observeEmailActions({
    domainNames: ["my-domain.com", "my-shop.com"],
  });
}

/* Promise resolves to:
 * {
 *   "observed": 2,
 *   "skipped": 0
 * }
 */

```

### observeEmailActions (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 observeEmailActions(options) {
  const response = await myWixClient.googleSubscriptions.observeEmailActions(options);
};
```

---