In this article, we'll guide you through how to create a Google Service Account JSON file in 5 steps.
Step 1. Create a project
- Log in to the Google Cloud console. Click on the menu icon > IAM & Admin > Create a Project.

- In the Project name field, enter the name of the project.
- To add the project to a folder, next to the Location field, click on BROWSE, find the folder, and click on Select.

- Finally, click on CREATE.
You've created a project! Now let's create a service account.
Step 2. Create a service account
- Go to the API & Services > Credentials section.

- Then, click on CREATE CREDENTIALS > Service account.

- Enter the account name in the Service account name field, describe the service account (optional), and click on CREATE AND CONTINUE.

- By default, only the creator can manage the project. To allow other users to manage the project, give them an owner role. This can be useful if the creator leaves the organization.

- Click on Done.
You've created a service account!
Step 3. Create a JSON key
- Go to the service key settings.

- Under the KEYS tab, click ADD KEY > Create new key.

- Select the JSON key type and click on Create to download the JSON file.

Done! You've downloaded the JSON private key for the service account to your computer.
Step 4. Connect the Google Drive API
- Click on the menu icon > APIs & Services > Enabled APIs & services.

- Next, click on ENABLE APIS AND SERVICES.

- Type Google Drive API in the search bar and click on it.

- Click on ENABLE.

And finally, give the service account access rights to the file.
Step 5. Give the service account access to the file
- Go to the APIs & Services > Enabled APIs & services section.

- Select Google Drive API.

- In the CREDENTIALS tab, copy the account email.

- Then, go to Google Sheets and give access to the email you’ve copied.
Great! You've created a Google Service Account JSON.