# REST Resource: accounts.adclients.adunits

- [Resource: AdUnit](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#AdUnit)
  - [JSON representation](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#AdUnit.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#State)
- [ContentAdsSettings](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#ContentAdsSettings)
  - [JSON representation](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#ContentAdsSettings.SCHEMA_REPRESENTATION)
- [Type](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#Type)
- [Methods](https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#METHODS_SUMMARY)

## Resource: AdUnit

Representation of an ad unit. An ad unit represents a saved ad unit with a specific set of ad settings that have been customized within an account.

| JSON representation |
|---|
| ``` { "name": string, "reportingDimensionId": string, "displayName": string, "state": enum (`https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#State`), "contentAdsSettings": { object (`https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#ContentAdsSettings`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Resource name of the ad unit. Format: accounts/{account}/adclients/{adclient}/adunits/{adunit} |
| `reportingDimensionId` | `string` Output only. Unique ID of the ad unit as used in the `AD_UNIT_ID` reporting dimension. |
| `displayName` | `string` Required. Display name of the ad unit, as provided when the ad unit was created. |
| `state` | ``enum (`https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#State`)`` Required. State of the ad unit. |
| `contentAdsSettings` | ``object (`https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#ContentAdsSettings`)`` Required. Settings specific to content ads (AFC). |

## State

State of an ad unit.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | State unspecified. |
| `ACTIVE` | Ad unit has been activated by the user. |
| `ARCHIVED` | Ad unit has been archived by the user. Note that archived ad units are only removed from the default view in the UI. Archived ad units can still serve ads. |

## ContentAdsSettings

Settings specific to content ads (AFC).

| JSON representation |
|---|
| ``` { "size": string, "type": enum (`https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#Type`) } ``` |

| Fields ||
|---|---|
| `size` | `string` Required. Size of the ad unit. e.g. "728x90", "1x3" (for responsive ad units). |
| `type` | ``enum (`https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits#Type`)`` Required. Type of the ad unit. |

## Type

Content ads settings types supported by the api.

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Unspecified ad unit type. |
| `DISPLAY` | Display ad unit. |
| `FEED` | In-feed ad unit. |
| `ARTICLE` | In-article ad unit. |
| `MATCHED_CONTENT` | Matched content unit. |
| `LINK` | Link ad unit. Note that link ad units have now been retired, see <https://support.google.com/adsense/answer/9987221>. > [!WARNING] > This item is deprecated! |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/create` | Creates an ad unit. |
| ### `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/get` | Gets an ad unit from a specified account and ad client. |
| ### `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/getAdcode` | Gets the ad unit code for a given ad unit. |
| ### `https://developers.google.com/adsense/management/reference/rest/v2/accounts.adclients.adunits/list` | Lists all ad units under a specified account and ad client. |
| ### `https://developers.google.com/adsense/management/reference/rest/v2/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` | Updates an ad unit. |