delete

Restrictions

A maximum of 10,000 ads per method call.

Ads can't be deleted in the following cases:

  • The ad was displayed and it has accumulated statistics.
  • The ad has a status other than DRAFT, and the campaign has at least one ad that is currently being activated or suspended.
  • The ad was accepted after review or rejected after being pre-accepted, although there were funds in the campaign or shared account.

You can use the archive method to archive these types of ads.

Request

Request structure in JSON format:

{
  "method": "delete",
  "params": { /* params */
    "SelectionCriteria": {  /* IdsCriteria */
      "Ids": [(long), ... ] /* required */ 
    } /* required */
  } 
}
ParameterTypeDescriptionRequired
Params structure (for JSON) / DeleteRequest structure (for SOAP)
SelectionCriteriaIdsCriteriaCriteria for selecting ads to delete.Yes
IdsCriteria structure
Idsarray of longIDs of ads to delete (maximum of 10,000).Yes

Response

Response structure in JSON format:

{
  "result": {  /* result */
    "DeleteResults": [{  /* ActionResult */
      "Id": (long),
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
       }, ...
      ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
       }, ...
      ] 
    }, ... ] /* required */
  }
}
ParameterTypeDescription
Result structure (for JSON) / DeleteResponse structure (for SOAP)
DeleteResultsarray of ActionResultResults of deleting ads.
ActionResult structure
IdlongID of the ad that was deleted. Returned if there aren't any errors. See the section Operations on object arrays.
Warningsarray of ExceptionNotification

Warnings that occurred during the operation.

Errorsarray of ExceptionNotification

Errors that occurred during the operation.