Use this endpoint to update account-level spending caps for multiple ad accounts. Only the organization admin can update the spending cap of ad accounts. The endpoint processes each account individually and returns a result for each account, indicating success or failure with a descriptive message.
Request
End Point https://business.newsbreak.com/business-api/v1/balance/updateAccountsBudget
Method POST
Header
| Field | Required | Data Type | Description |
|---|---|---|---|
| Access-Token | Y | string | Authorized access token. |
Request Parameters
| Field | Required | Data Type | Description |
|---|---|---|---|
| adAccountsBudgetUpdate | Y | object[] | List of account spending cap updates. |
| └── adAccountId | Y | string | Ad Account ID (numeric string). |
| └── budget | Y | long | Account spending cap. New spending cap amount in cents, must be between 0 and 10000000000 cents ($0-$100M). |
Budget Update Rules
- Spending cap must be between 0 and 10,000,000,000 cents ($0-$100M).
- New spending cap must be greater than the current total spending for the account.
- If no spending cap is currently set, this will enable and set the spending cap.
Example
curl --location --request POST 'https://business.newsbreak.com/business-api/v1/balance/updateAccountsBudget' \
-H 'Content-Type: application/json' \
-H 'Access-Token:{{Access-Token}}' \
-d '{
"adAccountsBudgetUpdate": [
{
"adAccountId": "123",
"budget": 500000
},
{
"adAccountId": "234",
"budget": 1000000
}
]
}'
Response
Response Parameters
| Field | Data Type | Description |
|---|---|---|
| code | int | Status code, see Return Codes. |
| errMsg | string | Error message when code!=0. |
| data | object | Response object. |
| .list | object[] | Each row is an account spending cap update result. |
| ..adAccountId | string | Ad Account ID. |
| ..message | string | Success or failure message describing the update result. |
Success Messages
-
"Budget is enabled and set successfully to {budget} cents"- Spending cap was not previously set and is now enabled. -
"Budget updated successfully. From {oldBudget} cents to {newBudget} cents"- Spending cap was successfully updated.
Failure Messages
-
"Update failed. adAccount not found"- The specified ad account does not exist. -
"Update failed. No access to change adAccount budget"- User does not have permission to change adAccount spending cap. -
"Update failed. Budget must be between 0 cents and 10000000000 cents"- Spending cap value is out of valid range. -
"Update failed. New budget must be greater than current spending, current spending: {spending} cents"- Spending cap cannot be less than already spent amount.
Example
{
"code": 0,
"data": {
"list": [
{
"adAccountId": "123",
"message": "Budget updated successfully. From 400000 cents to 500000 cents"
},
{
"adAccountId": "234",
"message": "Update failed. No access to change adAccount budget"
}
]
}
}