Create or delete a partner link

Here's how to create or delete a PartnerLink resource. The Data Manager API supports creating partner links for the following account types:

  • Google Ads accounts
  • Display & Video 360 partner or Display & Video 360 advertiser accounts

Create a PartnerLink by sending a CreatePartnerLinkRequest.

Construct the request body

Create a PartnerLink resource. Here are the fields to set.

owning_account

Identifies the advertiser account that owns the link. Set to a ProductAccount object.

Set the account_type to the AccountType of the advertiser account.

Set the account_id to the ID of the advertiser account.

Consult the destinations and headers guide for instructions on the ID to use for each type of advertiser.

partner_account

Identifies the partner account. Set to a ProductAccount object.

Set the account_type to the AccountType of the partner account. For example, if the link is from an advertiser account to a data partner account, set this field to DATA_PARTNER.

Set the account_id to the ID of the partner account.

Construct the request

To create a partner link, construct a CreatePartnerLinkRequest.

  1. Set the parent to the resource name of the advertiser account. Use the format:

    accountTypes/{account_type}/accounts/{account}
    
  2. Set the partner_link to the PartnerLink resource you constructed.

  3. If your credentials are for a Google Account with access to a parent account of the advertiser account, such as a Google Ads manager account or a Display & Video 360 Partner account, set the login-account header as described in Configure destinations and headers.

Here are sample requests in JSON to create a link to a data partner account in different types of advertiser accounts.

{
    "parent": "accountTypes/GOOGLE_ADS/accounts/INSERT_GOOGLE_ADS_CUSTOMER_ID",
    "partner_link": {
        "owning_account": {
            "accountType": "GOOGLE_ADS",
            "accountId": "INSERT_GOOGLE_ADS_CUSTOMER_ID"
        },
        "partner_account": {
            "accountType": "DATA_PARTNER",
            "accountId": "INSERT_DATA_PARTNER_ACCOUNT_ID"
        }
    }
}

DV360 advertiser

{
    "parent": "accountTypes/DISPLAY_VIDEO_ADVERTISER/accounts/INSERT_DISPLAY_VIDEO_ADVERTISER_ID",
    "partner_link": {
        "owning_account": {
            "accountType": "DISPLAY_VIDEO_ADVERTISER",
            "accountId": "INSERT_DISPLAY_VIDEO_ADVERTISER_ID"
        },
        "partner_account": {
            "accountType": "DATA_PARTNER",
            "accountId": "INSERT_DATA_PARTNER_ACCOUNT_ID"
        }
    }
}

DV360 partner

{
    "parent": "accountTypes/DISPLAY_VIDEO_PARTNER/accounts/INSERT_DISPLAY_VIDEO_PARTNER_ID",
    "partner_link": {
        "owning_account": {
            "accountType": "DISPLAY_VIDEO_PARTNER",
            "accountId": "INSERT_DISPLAY_VIDEO_PARTNER_ID"
        },
        "partner_account": {
            "accountType": "DATA_PARTNER",
            "accountId": "INSERT_DATA_PARTNER_ACCOUNT_ID"
        }
    }
}

Send the request

Send the request and, if required, include request headers. Use credentials for a Google Account with access to the owning_account.

If the request succeeds, the response contains the created PartnerLink with the id and name populated.

If the request fails, inspect the errors to determine the cause of the failure, update the request and headers to fix any issues, and then send the updated request and headers.

To delete a PartnerLink, send a DeletePartnerLinkRequest with the name set to the resource name. Set headers if required.