Interested in sharing your feedback about the Google Ads API?
Sign up to be invited to participate in user research!
OAuth Service Account Flow
This guide will walk you through how to setup OAuth2 for API access using your
own credentials using service accounts.
These steps only need to be done once, unless you revoke or delete your OAuth2
credentials.
Create OAuth2 credentials
Generate a service account ID and a *.JSON
file by
following the linked instructions, then come back to this page.
Set up client library
Set the private key JSON file path and delegate account ID in your
configuration. If you're using an ads.properties
file, add the following:
api.googleads.serviceAccountSecretsPath=PRIVATE_KEY_FILE_PATH
api.googleads.serviceAccountUser=DELEGATE_ACCOUNT
See the configuration guide for
additional details.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-28 UTC.
[null,null,["Last updated 2025-01-28 UTC."],[[["This guide explains how to set up OAuth2 for API access using service accounts with your own credentials."],["The setup process involves generating a service account ID and a JSON file, and then configuring your client library with the necessary credentials."],["This setup needs to be done only once and requires a Google Workspace domain with domain-wide delegation access granted to the service account."]]],[]]