# AdSense Management API

The AdSense Management API allows publishers to access their inventory and run earnings and performance reports.

- [REST Resource: v2.accounts](https://developers.google.com/adsense/management/reference/rest#v2.accounts)
- [REST Resource: v2.accounts.adclients](https://developers.google.com/adsense/management/reference/rest#v2.accounts.adclients)
- [REST Resource: v2.accounts.adclients.adunits](https://developers.google.com/adsense/management/reference/rest#v2.accounts.adclients.adunits)
- [REST Resource: v2.accounts.adclients.customchannels](https://developers.google.com/adsense/management/reference/rest#v2.accounts.adclients.customchannels)
- [REST Resource: v2.accounts.adclients.urlchannels](https://developers.google.com/adsense/management/reference/rest#v2.accounts.adclients.urlchannels)
- [REST Resource: v2.accounts.alerts](https://developers.google.com/adsense/management/reference/rest#v2.accounts.alerts)
- [REST Resource: v2.accounts.payments](https://developers.google.com/adsense/management/reference/rest#v2.accounts.payments)
- [REST Resource: v2.accounts.policyIssues](https://developers.google.com/adsense/management/reference/rest#v2.accounts.policyIssues)
- [REST Resource: v2.accounts.reports](https://developers.google.com/adsense/management/reference/rest#v2.accounts.reports)
- [REST Resource: v2.accounts.reports.saved](https://developers.google.com/adsense/management/reference/rest#v2.accounts.reports.saved)
- [REST Resource: v2.accounts.sites](https://developers.google.com/adsense/management/reference/rest#v2.accounts.sites)

## Service: adsense.googleapis.com

To call this service, we recommend that you use the Google-provided [client libraries](https://cloud.google.com/apis/docs/client-libraries-explained). If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

### Discovery document

A [Discovery Document](https://developers.google.com/discovery/v1/reference/apis) is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:

- <https://adsense.googleapis.com/$discovery/rest?version=v2>

### Service endpoint

A [service endpoint](https://cloud.google.com/apis/design/glossary#api_service_endpoint) is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

- `https://adsense.googleapis.com`

## REST Resource: [v2.accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts/get` | `GET /v2/{name=accounts/*}` Gets information about the selected AdSense account. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts/getAdBlockingRecoveryTag` | `GET /v2/{name=accounts/*}/adBlockingRecoveryTag` Gets the ad blocking recovery tag of an account. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts/list` | `GET /v2/accounts` Lists all accounts available to this user. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts/listChildAccounts` | `GET /v2/{parent=accounts/*}:listChildAccounts` Lists all accounts directly managed by the given AdSense account. |

## REST Resource: [v2.accounts.adclients](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients/get` | `GET /v2/{name=accounts/*/adclients/*}` Gets the ad client from the given resource name. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients/getAdcode` | `GET /v2/{name=accounts/*/adclients/*}/adcode` Gets the AdSense code for a given ad client. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients/list` | `GET /v2/{parent=accounts/*}/adclients` Lists all the ad clients available in an account. |

## REST Resource: [v2.accounts.adclients.adunits](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/create` | `POST /v2/{parent=accounts/*/adclients/*}/adunits` Creates an ad unit. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/get` | `GET /v2/{name=accounts/*/adclients/*/adunits/*}` Gets an ad unit from a specified account and ad client. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/getAdcode` | `GET /v2/{name=accounts/*/adclients/*/adunits/*}/adcode` Gets the ad unit code for a given ad unit. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/list` | `GET /v2/{parent=accounts/*/adclients/*}/adunits` Lists all ad units under a specified account and ad client. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/listLinkedCustomChannels` | `GET /v2/{parent=accounts/*/adclients/*/adunits/*}:listLinkedCustomChannels` Lists all the custom channels available for an ad unit. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/patch` | `PATCH /v2/{adUnit.name=accounts/*/adclients/*/adunits/*}` Updates an ad unit. |

## REST Resource: [v2.accounts.adclients.customchannels](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.customchannels)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.customchannels/create` | `POST /v2/{parent=accounts/*/adclients/*}/customchannels` Creates a custom channel. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.customchannels/delete` | `DELETE /v2/{name=accounts/*/adclients/*/customchannels/*}` Deletes a custom channel. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.customchannels/get` | `GET /v2/{name=accounts/*/adclients/*/customchannels/*}` Gets information about the selected custom channel. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.customchannels/list` | `GET /v2/{parent=accounts/*/adclients/*}/customchannels` Lists all the custom channels available in an ad client. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.customchannels/listLinkedAdUnits` | `GET /v2/{parent=accounts/*/adclients/*/customchannels/*}:listLinkedAdUnits` Lists all the ad units available for a custom channel. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.customchannels/patch` | `PATCH /v2/{customChannel.name=accounts/*/adclients/*/customchannels/*}` Updates a custom channel. |

## REST Resource: [v2.accounts.adclients.urlchannels](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.urlchannels)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.urlchannels/get` | `GET /v2/{name=accounts/*/adclients/*/urlchannels/*}` Gets information about the selected url channel. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.urlchannels/list` | `GET /v2/{parent=accounts/*/adclients/*}/urlchannels` Lists active url channels. |

## REST Resource: [v2.accounts.alerts](https://developers.google.com/adsense/management/reference/rest/v2/accounts.alerts)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.alerts/list` | `GET /v2/{parent=accounts/*}/alerts` Lists all the alerts available in an account. |

## REST Resource: [v2.accounts.payments](https://developers.google.com/adsense/management/reference/rest/v2/accounts.payments)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.payments/list` | `GET /v2/{parent=accounts/*}/payments` Lists all the payments available for an account. |

## REST Resource: [v2.accounts.policyIssues](https://developers.google.com/adsense/management/reference/rest/v2/accounts.policyIssues)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.policyIssues/get` | `GET /v2/{name=accounts/*/policyIssues/*}` Gets information about the selected policy issue. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.policyIssues/list` | `GET /v2/{parent=accounts/*}/policyIssues` Lists all the policy issues where the specified account is involved, both directly and through any AFP child accounts. |

## REST Resource: [v2.accounts.reports](https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports/generate` | `GET /v2/{account=accounts/*}/reports:generate` Generates an ad hoc report. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports/generateCsv` | `GET /v2/{account=accounts/*}/reports:generateCsv` Generates a csv formatted ad hoc report. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports/getSaved` | `GET /v2/{name=accounts/*/reports/*}/saved` Gets the saved report from the given resource name. |

## REST Resource: [v2.accounts.reports.saved](https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports.saved)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports.saved/generate` | `GET /v2/{name=accounts/*/reports/*}/saved:generate` Generates a saved report. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports.saved/generateCsv` | `GET /v2/{name=accounts/*/reports/*}/saved:generateCsv` Generates a csv formatted saved report. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.reports.saved/list` | `GET /v2/{parent=accounts/*}/reports/saved` Lists saved reports. |

## REST Resource: [v2.accounts.sites](https://developers.google.com/adsense/management/reference/rest/v2/accounts.sites)

| Methods ||
|---|---|
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.sites/get` | `GET /v2/{name=accounts/*/sites/*}` Gets information about the selected site. |
| `https://developers.google.com/adsense/management/reference/rest/v2/accounts.sites/list` | `GET /v2/{parent=accounts/*}/sites` Lists all the sites available in an account. |