v29

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-06-042661,1122.5 MB
keywords

Create keywords

Create keywords for the following entity types (advertiser, campaign, ad group, or ad). For more information, see Keyword targeting.

Notes:

  • Advertisers and campaigns can only be assigned keywords with excluding (_NEGATIVE).
  • All keyword match types are available for ad groups.

For more information on match types, see match type enums.

Returns:

  • A successful call returns an object containing an array of new keyword objects and an empty errors object array.
  • An unsuccessful call returns an empty keywords array, and instead, inserts the entire object with nulled/negated properties into the errors object array:
    {
      "keywords": [],
      "errors": [
        {
          "data": {
            "archived": null,
            "match_type": "EXACT",
            "parent_type": null,
            "value": "foobar",
            "parent_id": null,
            "type": "keyword",
            "id": null
          },
          "error_messages": [
            "Advertisers and Campaigns only accept excluded targeting attributes."
          ]
        }
      ]
    }
    
post/ad_accounts/{ad_account_id}/keywords

Path parameters

ad_account_idstring required

Unique identifier of an ad account.

Request body

parent_idstring required

Keyword data

Example request

{
  "keywords": [
    {
      "match_type": "BROAD"
    }
  ]
}

Response

The request has succeeded.

Example response

{
  "errors": [
    {
      "data": {
        "id": "383791336903426391",
        "match_type": "BROAD",
        "parent_id": "383791336903426391",
        "parent_type": "campaign",
        "type": "keyword"
      }
    }
  ],
  "keywords": [
    {
      "id": "383791336903426391",
      "match_type": "BROAD",
      "parent_id": "383791336903426391",
      "parent_type": "campaign",
      "type": "keyword"
    }
  ]
}