Method: accounts.adclients.adunits.patch

  • This endpoint updates existing DISPLAY ad units, primarily for AdSense for Platforms publishers.

  • Only specific fields within the ad unit can be modified using the updateMask query parameter in the request.

  • To use this endpoint, your project must have the https://www.googleapis.com/auth/adsense authorization scope.

  • The request should contain an AdUnit object in its body, specifying the desired modifications, and a successful response will also return an updated AdUnit object.

  • The ad unit to update is identified through the adUnit.name path parameter, following a specific format.

Updates an ad unit.

This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact your account manager if you need to use this method.

For now, this method can only be used to update DISPLAY ad units. See: https://support.google.com/adsense/answer/9183566

HTTP request

PATCH https://adsense.googleapis.com/v2/{adUnit.name=accounts/*/adclients/*/adunits/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
adUnit.name

string

Output only. Resource name of the ad unit. Format: accounts/{account}/adclients/{adclient}/adunits/{adunit}

Query parameters

Parameters
updateMask

string (FieldMask format)

The list of fields to update. If empty, a full update is performed.

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

Request body

The request body contains an instance of AdUnit.

Response body

If successful, the response body contains an instance of AdUnit.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/adsense