# Create a service account

The
[APIs explorer](https://developers.google.com/apis-explorer/#p/androidmanagement/v1/)
lets you call Android Management API directly. To call the API from a
server, you need to enable Android Management API for your project and create a
service account.

> [!NOTE]
> **Note:** a second project can be used to separate your development and production environments. You shouldn't use separate projects for each of your customers.

## Enable the Android Management API

Enable the Android Management API for your project.

1. Sign in to the Google API Console.

2. Select or create a project.

   [Go to the Projects Page](https://console.cloud.google.com/project)
3. Click **Enable API**.

4. Search for and select **Android Management API** in the API library.

   [Go to the API Library Page](https://console.cloud.google.com/apis/library)
5. Click **Enable**.

## Create your service account

1. Sign in to the Google API Console.

2. Open the
   [Credentials page](https://console.developers.google.com/project/_/apiui/credential).
   If prompted, select the project that has the Android Management API enabled.

3. Click **Create credentials** \> **Service account key**.

4. From the dropdown menu, select **New service account**. Enter a name for
   your service account.

5. Select your preferred key type and click **Create**. Your new public/private
   key pair is generated and downloaded to your machine and is the only copy of
   this key. You are responsible for storing it securely.

6. Open the [IAM page](https://console.developers.google.com/iam-admin/iam). If
   prompted, select the project that has the Android Management API enabled.

7. Click **Add**.

8. Add the service account you've just created as member and select the role
   **Android Management User**.

9. Click **Save**.

10. (Optional, but highly recommended) Add additional project owners by
    [granting the Owner role](https://cloud.google.com/iam/docs/managing-policies#access_control_via_console)
    to existing project members.

## Roles and permissions

To access the Android Management API your service account requires the
`androidmanagement.enterprises.manage` permission, which can be granted by the
**Android Management User** role (or `roles/androidmanagement.user`).