Documentation

Stop and start ads

Uses the cURL utility

This example shows how to stop serving ads using the Ads.suspend method and restart using the Ads.resume method. For instance, you can stop and start serving ads depending on whether you have a product in stock, to avoid spending your advertising budget when you don't have items available.

To use the examples, specify the OAuth token and ad IDs in the input data. For a request on behalf of an agency, also specify the client login.

Stop
curl \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Client-Login: CLIENT_LOGIN' \
  -d '{ "method": "suspend",
  "params": {
    "SelectionCriteria": {
      "Ids": [ID_1, ID_2, ID_N]
    }
  }
}' https://api.direct.yandex.com/json/v5/ads
Start
curl \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Client-Login: CLIENT_LOGIN' \
  -d '{ "method": "resume",
  "params": {
    "SelectionCriteria": {
      "Ids": [ID_1, ID_2, ID_N]
    }
  }
}' https://api.direct.yandex.com/json/v5/ads
Note. For cURL in Windows, replace all single quotes with double quotes, and escape double quotes in JSON code. For example: -d "{\"method\"...