Cada novo item de linha precisa declarar se vai veicular anúncios políticos da União Europeia (UE). As APIs do Display & Video 360 e os uploads de SDF que não fornecem declarações vão falhar. Consulte nossa página de descontinuações para mais detalhes.
Cria um item de linha com configurações (incluindo segmentação) herdadas do pedido de inserção e um ENTITY_STATUS_DRAFTentityStatus. Retorna o item de linha recém-criado se a operação for bem-sucedida. Há valores padrão com base nos três campos:
Se este item de linha vai veicular anúncios políticos da União Europeia.
Se containsEuPoliticalAds tiver sido definido como DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING no anunciante principal, este campo será atribuído como DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING, a menos que seja especificado de outra forma. Esse campo pode ser atualizado usando a interface, a API ou arquivos de dados estruturados.
Esse campo precisa ser atribuído ao criar um item de linha. Caso contrário, a solicitação advertisers.lineItems.create vai falhar.
Corpo da resposta
Se a solicitação for bem-sucedida, o corpo da resposta conterá uma instância de LineItem.
[null,null,["Última atualização 2025-09-09 UTC."],[[["\u003cp\u003eCreates a new line item with settings inherited from the insertion order and an \u003ccode\u003eENTITY_STATUS_DRAFT\u003c/code\u003e entity status.\u003c/p\u003e\n"],["\u003cp\u003eYouTube & Partners line items cannot be created or updated using the API.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires specifying the advertiser ID, insertion order ID, display name, and line item type.\u003c/p\u003e\n"],["\u003cp\u003eA successful response returns the created line item.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/display-video\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This outlines how to create a new line item by sending a POST request to `https://displayvideo.googleapis.com/v3/advertisers/{advertiserId}/lineItems:generateDefault`. The request body requires the `insertionOrderId`, `displayName`, and `lineItemType`. The advertiser ID is specified in the path. Optionally `mobileApp` object can be included. Default settings are derived from the insertion order's type and automation type and specified `lineItemType`. The response returns the newly created line item, with `ENTITY_STATUS_DRAFT`, upon success.\n"],null,["| Display \\& Video 360 API v3 is deprecated and will sunset on **October 7, 2025** . Migrate to [Display \\& Video 360 API v4](/display-video/api/reference/rest/v4) before sunset to avoid an interruption in service.\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a new line item with settings (including targeting) inherited from the insertion order and an `ENTITY_STATUS_DRAFT` [entityStatus](/display-video/api/reference/rest/v3/advertisers.lineItems#LineItem.FIELDS.entity_status). Returns the newly created line item if successful. There are default values based on the three fields:\n\n- The insertion order's [insertionOrderType](/display-video/api/reference/rest/v3/advertisers.insertionOrders#InsertionOrder.FIELDS.insertion_order_type)\n- The insertion order's [automationType](/display-video/api/reference/rest/v3/advertisers.insertionOrders#InsertionOrderBudget.FIELDS.automation_type)\n- The given [lineItemType](/display-video/api/reference/rest/v3/advertisers.lineItems/generateDefault#body.request_body.FIELDS.line_item_type)\n\nYouTube \\& Partners line items cannot be created or updated using the API.\n\nHTTP request\n\n`POST https://displayvideo.googleapis.com/v3/advertisers/{advertiserId}/lineItems:generateDefault`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| `advertiserId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. The ID of the advertiser this line item belongs to. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"insertionOrderId\": string, \"displayName\": string, \"lineItemType\": enum (/display-video/api/reference/rest/v3/advertisers.lineItems#LineItemType), \"mobileApp\": { object (/display-video/api/reference/rest/v3/advertisers.lineItems#MobileApp) }, \"containsEuPoliticalAds\": enum (/display-video/api/reference/rest/v3/EuPoliticalAdvertisingStatus) } ``` |\n\n| Fields ||\n|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `insertionOrderId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. The unique ID of the insertion order that the line item belongs to. |\n| `displayName` | `string` Required. The display name of the line item. Must be UTF-8 encoded with a maximum size of 240 bytes. |\n| `lineItemType` | `enum (`[LineItemType](/display-video/api/reference/rest/v3/advertisers.lineItems#LineItemType)`)` Required. The type of the line item. |\n| `mobileApp` | `object (`[MobileApp](/display-video/api/reference/rest/v3/advertisers.lineItems#MobileApp)`)` The mobile app promoted by the line item. This is applicable only when [lineItemType](/display-video/api/reference/rest/v3/advertisers.lineItems/generateDefault#body.request_body.FIELDS.line_item_type) is either `LINE_ITEM_TYPE_DISPLAY_MOBILE_APP_INSTALL` or `LINE_ITEM_TYPE_VIDEO_MOBILE_APP_INSTALL`. |\n| `containsEuPoliticalAds` | `enum (`[EuPoliticalAdvertisingStatus](/display-video/api/reference/rest/v3/EuPoliticalAdvertisingStatus)`)` Whether this line item will serve European Union political ads. If [containsEuPoliticalAds](/display-video/api/reference/rest/v3/advertisers#Advertiser.FIELDS.contains_eu_political_ads) has been set to `DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING` in the parent advertiser, then this field will be assigned `DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING` if not otherwise specified. This field can then be updated using the UI, API, or Structured Data Files. This field must be assigned when creating a new line item. Otherwise, **the `advertisers.lineItems.create` request will fail**. |\n\nResponse body\n\nIf successful, the response body contains an instance of [LineItem](/display-video/api/reference/rest/v3/advertisers.lineItems#LineItem).\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/display-video`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]