Enrollmenttokens: create Stay organized with collections Save and categorize content based on your preferences.
Page Summary
This method, part of the EnrollmentTokensService, is used to create an enrollment token for an enterprise.
The request requires authorization with the
https://www.googleapis.com/auth/androidenterprisescope.The request body includes fields like
enrollmentTokenType(required),duration(optional for the token's validity), andgoogleAuthenticationOptions(optional for controlling Google authentication during enrollment).The response body mirrors the request body structure and includes the generated read-only
tokenvalue.
Creates an enrollment token for the enterprise.This method is part of the EnrollmentTokensService.
Request
HTTP request
POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/enrollmentTokens
Parameters
| Parameter name | Value | Description |
|---|---|---|
| Path parameters | ||
enterpriseId | string | The ID of the enterprise. |
Authorization
This request requires authorization with the following scope:
| Scope |
|---|
https://www.googleapis.com/auth/androidenterprise |
For more information, see theauthentication and authorization page.
Request body
In the request body, supply data with the following structure:
{ "kind": "androidenterprise#enrollmentToken", "token":string, "enrollmentTokenType":string, "duration": { "seconds":long, "nanos":integer }, "googleAuthenticationOptions": { "authenticationRequirement":string, "requiredAccountEmail":string }}| Property name | Value | Description | Notes |
|---|---|---|---|
kind | string | ||
token | string | The token value that's passed to the device and authorizes the device to enroll. This is a read-only field generated by the server. | |
enrollmentTokenType | string | [Required] The type of the enrollment token. Acceptable values are:
| |
duration | nested object | [Optional] The length of time the enrollment token is valid, ranging from 1 minute toDurations.MAX_VALUE, approximately 10,000 years. If not specified, the default duration is 1 hour. | |
duration.seconds | long | Signed seconds of the span of time. | |
googleAuthenticationOptions | nested object | [Optional] Provides options related to Google authentication during the enrollment. | |
googleAuthenticationOptions.authenticationRequirement | string | [Optional] Specifies whether user should authenticate with Google during enrollment. If provided, overrides theGoogleAuthenticationSettings for theenterprise resource when devices are enrolled with this token.Acceptable values are:
| |
googleAuthenticationOptions.requiredAccountEmail | string | [Optional] Specifies the managed Google Account that the user must use during enrollment.AuthenticationRequirement must be set toREQUIRED if this field is set. |
Response
If successful, this method returns a response body with the following structure:
{ "kind": "androidenterprise#enrollmentToken", "token":string, "enrollmentTokenType":string, "duration": { "seconds":long, "nanos":integer }, "googleAuthenticationOptions": { "authenticationRequirement":string, "requiredAccountEmail":string }}| Property name | Value | Description | Notes |
|---|---|---|---|
kind | string | ||
token | string | The token value that's passed to the device and authorizes the device to enroll. This is a read-only field generated by the server. | |
enrollmentTokenType | string | [Required] The type of the enrollment token. Acceptable values are:
| |
duration | nested object | [Optional] The length of time the enrollment token is valid, ranging from 1 minute toDurations.MAX_VALUE, approximately 10,000 years. If not specified, the default duration is 1 hour. | |
duration.seconds | long | Signed seconds of the span of time. | |
googleAuthenticationOptions | nested object | [Optional] Provides options related to Google authentication during the enrollment. | |
googleAuthenticationOptions.authenticationRequirement | string | [Optional] Specifies whether user should authenticate with Google during enrollment. This setting, if specified,GoogleAuthenticationSettings specified for the enterprise resource is ignored for devices enrolled with this token.Acceptable values are:
| |
googleAuthenticationOptions.requiredAccountEmail | string | [Optional] Specifies the managed Google Account that the user must use during enrollment.AuthenticationRequirement must be set toREQUIRED |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-02 UTC.