Update

Changes settings for shared accounts.

Restrictions

The daily budget settings can be changed a maximum of 3 times a day.

Input data

The input data structure in JSON is shown below.

Attention. Values of omitted parameters are not changed.
{
   "method": "AccountManagement",
   "param": {
      /* AccountManagementRequest */
      "Action": (string),
      "Accounts": [
         {  /* Account */
            "AccountID": (int),
            "AccountDayBudget": {
               /* AccountDayBudgetInfo */
               "Amount": (float), 
               "SpendMode": (string)
            },
            "SmsNotification": {
               /* SmsNotificationInfo */
               "MoneyInSms": (string),
               "MoneyOutSms": (string),
               "PausedByDayBudgetSms": (string),
               "SmsTimeFrom": (string),
               "SmsTimeTo": (string)
            },
            "EmailNotification": {
               /* EmailNotificationInfo */
               "Email": (string),
               "MoneyWarningValue": (int),
               "PausedByDayBudget": (string)
            }
         }
         ...
      ]
   }
}

Parameters are described below.

Parameter Description Required
AccountManagementRequest object
Action Action: Update. Yes
Accounts Array of Account objects. Each object contains information about settings for a shared account. No
Account object
AccountID ID of the shared account to change settings for. Yes
AccountDayBudget

The AccountDayBudgetInfo object with parameters for the daily limit on the shared account.

No
SmsNotification

The SmsNotificationInfo object with parameters for sending SMS notifications.

To get notifications, you must subscribe to them (see the Help section Subscribe to SMS notifications). The phone number to send notifications to is taken from the user data (see the Help section Mobile numbers).

No
EmailNotification

The EmailNotificationInfo object with parameters for sending notifications by email.

No
AccountDayBudgetInfo object
Amount

The daily budget for the shared account (in the shared account currency).

To get the minimum acceptable value, use the Dictionaries.get method for version 5 of the API and specify the dictionary name Currencies in the request.

A value of 0 nullifies the daily budget.

Yes
SpendMode

Mode for displaying ads:

  • Default — Standard mode.

  • Stretched — Distributed mode.

See Daily budget under “Shared account” in the Help for Yandex.Direct.

The mode applies to all campaigns, and the corresponding setting on the campaign level is ignored.

Yes
SmsNotificationInfo object
MoneyInSms Notify when funds are credited to the shared account — Yes/No. The predefined value is No. No
MoneyOutSms Notify when funds are debited from the shared account — Yes/No. The predefined value is No. No
PausedByDayBudgetSms Notify when campaigns are stopped because of reaching the daily limit on the shared account— Yes/No. The predefined value is Yes. No
SmsTimeFrom The allowed starting time for sending SMS notifications related to the shared account. Specified in the format HH:MM; minutes are set in multiples of 15 (0, 15, 30, 45). For example, “19:45”. No
SmsTimeTo The ending time for sending SMS notifications related to the shared account. Specified in the format HH:MM; minutes are set in multiples of 15 (0, 15, 30, 45). For example, “19:45”. No
EmailNotificationInfo object
Email The email address for sending notifications of events related to the shared account. No
MoneyWarningValue The minimal balance; notification is sent when the account balance is reduced to this amount. Set as a percentage of the amount of the last payment. The predefined value is 20. No
PausedByDayBudget Notify when campaigns are stopped because of reaching the daily limit on the shared account— Yes/No. The predefined value is Yes. No

Output data

Attention. An error when changing settings for one of the shared accounts does not cause the entire operation to be canceled, and does not affect the success of changing settings for the other shared accounts.

The output data structure in JSON is shown below.

{
   "data": {
      /* AccountManagementResponse */
      "ActionsResult": [
         {  /* AccountActionResult */
            "AccountID": (int),            
            "Errors": [
               {  /* Error */
                  "FaultCode": (int),
                  "FaultString": (string),
                  "FaultDetail": (string)
               }
               ...
            ]
         }
         ...
      ]
   }
}

Parameters are described below.

Parameter Description
AccountManagementResponse object
ActionsResult

Array of AccountActionResult objects Each object corresponds to an item in the Accounts input array and contains:

  • The ID of the shared account, if the settings were changed successfully.
  • The Errors array, if an error occurred.

The items in the array are in the same order as the objects in the Accounts input array.

AccountActionResult object
AccountID ID of the shared account that settings were successfully changed for.
Errors Array of Error objects with errors that occurred while transferring funds.
Error object
FaultCode Error code.
FaultString Textual message about the error.
FaultDetail Detailed description of the reason for the error.

Examples of input data

Python

{
   'Action': 'Update',
   'Accounts': [
      {
         'AccountID': 1327944,
         'SmsNotification': {
            'MoneyInSms': 'Yes',
            'MoneyOutSms': 'Yes'
         },
         'EmailNotification': {
            'Email': 'agrom@yandex.ru',
            'MoneyWarningValue': 25
         }
      }
   ]
}

PHP

array(
   'Action' => 'Update',
   'Accounts' => array(
      array(
         'AccountID' => 1327944,
         'SmsNotification' => array(
            'MoneyInSms' => 'Yes',
            'MoneyOutSms' => 'Yes'
         ),
         'EmailNotification' => array(
            'Email' => 'agrom@yandex.ru',
            'MoneyWarningValue' => 25
         )
      )
   )
)

Perl

{
   'Action' => 'Update',
   'Accounts' => [
      {
         'AccountID' => 1327944,
         'SmsNotification' => {
            'MoneyInSms' => 'Yes',
            'MoneyOutSms' => 'Yes'
         },
         'EmailNotification' => {
            'Email' => 'agrom@yandex.ru',
            'MoneyWarningValue' => 25
         }
      }
   ]
}