---
title: "POST /userprofiles/{userprofilesId}/dynamicTargetingKeys"
method: POST
path: "/userprofiles/{userprofilesId}/dynamicTargetingKeys"
tags: ["dynamicTargetingKeys"]
---

# POST /userprofiles/{userprofilesId}/dynamicTargetingKeys

`POST /userprofiles/{userprofilesId}/dynamicTargetingKeys`

## Request

- Base URL: `https://dfareporting.googleapis.com/dfareporting/v5`
- URL: `https://dfareporting.googleapis.com/dfareporting/v5/userprofiles/{userprofilesId}/dynamicTargetingKeys`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/dfatrafficking`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/dfatrafficking`
- TypeScript: <https://skmtc.dev/google/apis/dfareporting/docs/userprofiles/:userprofilesId/dynamicTargetingKeys/post.ts> (a function with typed inputs; its response is checked against the schema)

Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement.

## Path parameters

- `userprofilesId` string, required

## Request body

- DynamicTargetingKey: Contains properties of a dynamic targeting key. Dynamic targeting keys are unique, user-friendly labels, created at the advertiser level in DCM, that can be assigned to ads, creatives, and placements and used for targeting with Studio dynamic creatives. Use these labels instead of numeric Campaign Manager IDs (such as placement IDs) to save time and avoid errors in your dynamic feeds.
  - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKey".
  - `name` string: Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase.
  - `objectId` string, int64: ID of the object of this dynamic targeting key. This is a required field.
  - `objectType` 'OBJECT_ADVERTISER' | 'OBJECT_AD' | 'OBJECT_CREATIVE' | 'OBJECT_PLACEMENT': Type of the object of this dynamic targeting key. This is a required field.

## Response `200`

Successful response

- DynamicTargetingKey: Contains properties of a dynamic targeting key. Dynamic targeting keys are unique, user-friendly labels, created at the advertiser level in DCM, that can be assigned to ads, creatives, and placements and used for targeting with Studio dynamic creatives. Use these labels instead of numeric Campaign Manager IDs (such as placement IDs) to save time and avoid errors in your dynamic feeds.
  - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKey".
  - `name` string: Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase.
  - `objectId` string, int64: ID of the object of this dynamic targeting key. This is a required field.
  - `objectType` 'OBJECT_ADVERTISER' | 'OBJECT_AD' | 'OBJECT_CREATIVE' | 'OBJECT_PLACEMENT': Type of the object of this dynamic targeting key. This is a required field.

---

[API](https://skmtc.dev/google/apis/dfareporting.md) - [All operations](https://skmtc.dev/google/apis/dfareporting/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/dfareporting/revisions/be73a9a450de?raw)
