> [!NOTE]
> **Note:** Requires [authorization](https://developers.google.com/android/work/play/emm-api/v1/serviceaccountkeys/insert#auth).

<br />

**Deprecated:** New integrations cannot use this method and can refer to our [new
recommendations](https://developers.google.com/android/work/deprecations#recommended_alternative_4).  
**This method will no longer be accessible by
anyone after September 30, 2025.** 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.

<br />

## 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](https://developers.google.com/android/work/play/emm-api/v1/how-tos/authorizing) page.

### Request body

In the request body, supply a [Serviceaccountkeys resource](https://developers.google.com/android/work/play/emm-api/v1/serviceaccountkeys#resource) with the following properties:

| Property name | Value | Description | Notes |
|---|---|---|---|
| **Required Properties** ||||
| `type` | `string` | The file format of the generated key data. <br /> Acceptable values are: - "`googleCredentials`" - "`pkcs12`" |   |

## Response

If successful, this method returns a [Serviceaccountkeys resource](https://developers.google.com/android/work/play/emm-api/v1/serviceaccountkeys#resource) in the response body.