Create keywords
Changed onCreate 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." ] } ] }
Request
- Base URLhttps://api.pinterest.com/v5
- AuthOAuth 2Authorization codehttps://www.pinterest.com/oauth/Token URLhttps://api.pinterest.com/v5/oauth/tokenScopesads:write
- TypeScripthttps://skmtc.dev/pinterest/apis/pinterest-rest-api/docs/ad_accounts/:ad_account_id/keywords/post.tsA function with typed inputs. Its response is checked against the schema.
Path parameters
Unique identifier of an ad account.
Request body
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"
}
]
}Changes
- breaking
added to the
//request propertyallOflist - breaking
removed the enum value
BROADof the request property// - breaking
removed the enum value
EXACTof the request property// - breaking
removed the enum value
EXACT_NEGATIVEof the request property// - breaking
removed the enum value
PHRASEof the request property// - breaking
removed the enum value
PHRASE_NEGATIVEof the request property// - breaking
removed the enum value
undefinedof the request property// - breaking
the
//request property type changed fromstringto no type - info
removed the pattern
^((AG)|C)?\d+$from the request property - info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
the response optional property
became read-only for the status - info
removed
subschema #2from the//response propertyallOflist for the response status - info
removed
subschema #2from the/response propertyallOflist for the response status - info
the response property
became required for the status - info
the response property
became required for the status - info
added the required property
///to the response with the status - info
added the required property
///to the response with the status - info
added the required property
///to the response with the status - info
added the required property
///to the response with the status - info
added the required property
//to the response with the status - info
added the required property
//to the response with the status - info
added the required property
//to the response with the status - info
added the required property
//to the response with the status - info
added the success response with the status
- breaking
- warning
removed the optional property
///from the response with the status - warning
removed the optional property
///from the response with the status - warning
removed the optional property
///from the response with the status - warning
removed the optional property
///from the response with the status - warning
removed the optional property
///from the response with the status - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status
- warning