Serviceaccountkeys: insert

  • This method generates new credentials for the service account associated with the enterprise.

  • This method is deprecated and will not be accessible after September 30, 2025, with new integrations advised to use alternative methods.

  • The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and set by calling Enterprises.SetAccount.

  • The request requires authorization with the scope https://www.googleapis.com/auth/androidenterprise and includes the enterprise ID as a path parameter.

  • The request body requires the type property of the key to be inserted, which can be googleCredentials or pkcs12.

Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.

Only the type of the key should be populated in the resource to be inserted.

Request

HTTP request

POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/serviceAccountKeys

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 the authentication and authorization page.

Request body

In the request body, supply a Serviceaccountkeys resource with the following properties:

Property name Value Description Notes
Required Properties
type string The file format of the generated key data.

Acceptable values are:
  • "googleCredentials"
  • "pkcs12"

Response

If successful, this method returns a Serviceaccountkeys resource in the response body.