# Enterprises

<br />

For a list of [methods](https://developers.google.com/android/work/play/emm-api/v1/enterprises#methods) for this resource, see the end of this page.

## Resource representations

An Enterprises resource represents the binding between an EMM and a specific organization. That binding can be instantiated in one of two different ways using this API as follows:

- For Google managed domain customers, the process involves using `Enterprises.enroll` and `Enterprises.setAccount` (in conjunction with artifacts obtained from the Admin console and the Google API Console) and submitted to the EMM through a more-or-less manual process.
- For managed Google Play Accounts customers, the process involves using `Enterprises.generateSignupUrl` and `Enterprises.completeSignup` in conjunction with the managed Google Play sign-up UI (Google-provided mechanism) to create the binding without manual steps.

As an EMM, you can support either or both approaches in your EMM console. See [Create an Enterprise](https://developers.google.com/android/work/play/emm-api/create-enterprise) for details.   

<br />

```
{
  "kind": "androidenterprise#enterprise",
  "id": string,
  "primaryDomain": string,
  "name": string,
  "administrator": [
    {
      "email": string
    }
  ],
  "googleAuthenticationSettings": {
    "googleAuthenticationRequired": string,
    "dedicatedDevicesAllowed": string,
    "createdAt": {
      "seconds": long,
      "nanos": integer
    },
    "updatedAt": {
      "seconds": long,
      "nanos": integer
    }
  },
  "enterpriseType": string,
  "managedGoogleDomainType": string
}
```

| Property name | Value | Description | Notes |
|---|---|---|---|
| `administrator[]` | `list` | Admins of the enterprise. This is only supported for enterprises created via the EMM-initiated flow. |   |
| `administrator[].email` | `string` | The admin's email address. |   |
| `enterpriseType` | `string` | The type of the enterprise. <br /> Acceptable values are: - "`enterpriseTypeUnspecified`" - "`managedGoogleDomain`" - "`managedGooglePlayAccountsEnterprise`" |   |
| `googleAuthenticationSettings` | `nested object` | Settings for Google-provided user authentication. |   |
| `googleAuthenticationSettings.createdAt` | `nested object` | Timestamp of when the settings were first created or modified. |   |
| `googleAuthenticationSettings.createdAt.nanos` | `integer` | Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. |   |
| `googleAuthenticationSettings.createdAt.seconds` | `long` | Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. |   |
| `googleAuthenticationSettings.dedicatedDevicesAllowed` | `string` | Whether dedicated devices are allowed. <br /> Acceptable values are: - "`allowed`" - "`dedicatedDevicesAllowedUnspecified`" - "`disallowed`" |   |
| `googleAuthenticationSettings.googleAuthenticationRequired` | `string` | Whether Google authentication is required. <br /> Acceptable values are: - "`googleAuthenticationRequiredUnspecified`" - "`notRequired`" - "`required`" |   |
| `googleAuthenticationSettings.updatedAt` | `nested object` | Timestamp of when the settings were last modified. |   |
| `googleAuthenticationSettings.updatedAt.nanos` | `integer` | Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. |   |
| `googleAuthenticationSettings.updatedAt.seconds` | `long` | Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. |   |
| `id` | `string` | The unique ID for the enterprise. |   |
| `id` | `string` | The unique ID for the enterprise. |   |
| `kind` | `string` |   |   |
| `managedGoogleDomainType` | `string` | The type of managed Google domain <br /> Acceptable values are: - "`managedGoogleDomainTypeUnspecified`" - "`typeDomain`" - "`typeTeam`" |   |
| `name` | `string` | The name of the enterprise, for example, "Example, Inc". |   |
| `primaryDomain` | `string` | The enterprise's primary domain, such as "example.com". |   |

## Methods

[acknowledgeNotificationSet](https://developers.google.com/android/work/play/emm-api/v1/enterprises/acknowledgeNotificationSet)
:   Acknowledges notifications that were received from
    Enterprises.PullNotificationSet to prevent subsequent calls from returning
    the same notifications.

[completeSignup](https://developers.google.com/android/work/play/emm-api/v1/enterprises/completeSignup)
:   Completes the signup flow, by specifying the Completion token and
    Enterprise token.
    This request must not be called multiple times for a given Enterprise
    Token.

[createWebToken](https://developers.google.com/android/work/play/emm-api/v1/enterprises/createWebToken)
:   Returns a unique token to access an embeddable UI. To generate a
    web UI, pass the generated token into the managed Google Play javascript
    API. Each token may only be used to start one UI session. See the
    [JavaScript API documentation](https://developers.google.com/api-client-library/javascript/apis/androidenterprise/v1) for further information.

[enroll](https://developers.google.com/android/work/play/emm-api/v1/enterprises/enroll)
:   Enrolls an enterprise with the calling EMM.

[generateEnterpriseUpgradeUrl](https://developers.google.com/android/work/play/emm-api/v1/enterprises/generateEnterpriseUpgradeUrl)
:   Generates an enterprise upgrade URL to upgrade an existing managed Google
    Play Accounts enterprise to a managed Google domain.
    See [the guide to upgrading an enterprise](https://developers.google.com/android/work/play/emm-api/upgrade-an-enterprise) for more details.

[generateSignupUrl](https://developers.google.com/android/work/play/emm-api/v1/enterprises/generateSignupUrl)
:   Generates a sign-up URL.

[get](https://developers.google.com/android/work/play/emm-api/v1/enterprises/get)
:   Retrieves the name and domain of an enterprise.

[getServiceAccount](https://developers.google.com/android/work/play/emm-api/v1/enterprises/getServiceAccount)
:   Returns a service account and credentials. The service account
    can be bound to the enterprise by calling setAccount. The service account
    is unique to this enterprise and EMM, and will be deleted if the enterprise
    is unbound. The credentials contain private key data and are not stored
    server-side.

    <br />


    This method can only be called after calling
    Enterprises.Enroll or Enterprises.CompleteSignup, and before
    Enterprises.SetAccount; at other times it will return an error.

    <br />


    Subsequent calls after the first will generate a new, unique set of
    credentials, and invalidate the previously generated credentials.

    <br />


    Once the service account is bound to the enterprise, it can be managed
    using the serviceAccountKeys resource.

    <br />


    <br />

    **Note:** After you create a key, you might need to wait for 60 seconds or more before you perform another operation with the key. If you try to perform an operation with the key immediately after you create the key, and you receive an error, you can [retry
    the request with exponential backoff](https://cloud.google.com/iam/docs/retry-strategy)

    <br />

    .

[getStoreLayout](https://developers.google.com/android/work/play/emm-api/v1/enterprises/getStoreLayout)
:   Returns the store layout for the enterprise. If the store layout
    has not been set, returns "basic" as the store layout type and no
    homepage.

[list](https://developers.google.com/android/work/play/emm-api/v1/enterprises/list)
:   Looks up an enterprise by domain name.
    This is only supported for enterprises created via the Google-initiated
    creation flow. Lookup of the id is not needed for enterprises created via
    the EMM-initiated flow since the EMM learns the enterprise ID in the
    callback specified in the Enterprises.generateSignupUrl call.

[pullNotificationSet](https://developers.google.com/android/work/play/emm-api/v1/enterprises/pullNotificationSet)
:   Pulls and returns a notification set for the enterprises associated with
    the service account authenticated for the request. The notification set may
    be empty if no notification are pending.


    A notification set returned needs to be acknowledged within 20 seconds
    by calling Enterprises.AcknowledgeNotificationSet, unless the
    notification set is empty.


    Notifications that are not acknowledged within the 20 seconds will
    eventually be included again in the response to another PullNotificationSet
    request, and those that are never acknowledged will ultimately be deleted
    according to the Google Cloud Platform Pub/Sub system policy.


    Multiple requests might be performed concurrently to retrieve
    notifications, in which case the pending notifications (if any) will be
    split among each caller, if any are pending.


    If no notifications are present, an empty notification list is returned.
    Subsequent requests may return more notifications once they become
    available.

[sendTestPushNotification](https://developers.google.com/android/work/play/emm-api/v1/enterprises/sendTestPushNotification)
:   Sends a test notification to validate the EMM integration with
    the Google Cloud Pub/Sub service for this enterprise.

[setAccount](https://developers.google.com/android/work/play/emm-api/v1/enterprises/setAccount)
:   Sets the account that will be used to authenticate to the API as the
    enterprise.

[setStoreLayout](https://developers.google.com/android/work/play/emm-api/v1/enterprises/setStoreLayout)
:   Sets the store layout for the enterprise. By default, storeLayoutType
    is set to "basic" and the basic store layout is enabled. The basic
    layout only contains apps approved by the admin, and that have
    been added to the available product set for a user (using the
    [setAvailableProductSet](https://developers.google.com/android/work/play/emm-api/v1/users/setAvailableProductSet) call). Apps on the page are sorted in order of
    their product ID value. If you create a custom store layout (by setting
    storeLayoutType = "custom" and setting a homepage), the basic store
    layout is disabled.

[unenroll](https://developers.google.com/android/work/play/emm-api/v1/enterprises/unenroll)
:   Unenrolls an enterprise from the calling EMM.