Mediago API
en
  • en
  • zh
  1. Campaign Management
Mediago API
en
  • en
  • zh
  • Authentication
    • Get Access Token
      POST
  • Account Management
    • Get Authorized Account List
      GET
  • Campaign Management
    • Get Authorized Campaign List
      GET
    • Get Campaigns Detail
      GET
    • Create Campaign
      POST
    • Update Campaign
      POST
    • Batch Update Campaigns
      POST
    • Batch Active/Pause Campaigns
      POST
    • Batch Archive Campaigns
      POST
  • Ad Management
    • Get Authorized Ad List
      GET
    • Batch Active/Pause Ads
      POST
  • Sites Block Management
    • Get Account Block List
      GET
    • Block/Unblock Sites at Account
      POST
    • Get Campaign Block List
      GET
    • Block/Unblock Sites at Campaign
      POST
  • Report APIs
    • Get Daily Summary Data of All Campaign
      GET
    • Get Daily Report in Campaign Dimension
      GET
    • Get Daily Report in Ad Dimension
      GET
    • Get Hourly Realtime Data in Campaign or Ad Dimension
      GET
    • Get Account Daily Report in Site Dimension
      GET
    • Get Daily Report in Site Dimension
      GET
  1. Campaign Management

Batch Update Campaigns

POST
https://api.mediago.io/manage/v2/campaign/bulk-update
Last modified:2025-10-13 07:21:33
Tips:
The API supports concurrent processing of up to 10 campaigns simultaneously
Maximum 10 campaigns per request
Response time typically within 5 seconds
Each campaign is processed in its own transaction for data consistency
QPS limit: 60, IP limit: 15
Request Parameters:
field nametypedescriptionrequired
campaign_idsarraythe campaign to be updatedYes
charge_typestringBidding Strategy, historical values by default. The allowed value contains: cpc, smart_bid, max_cvNo
statusintthe active/pause status of the campaign, while 0 represents pause, 1 represents activeNo
day_parting[][]intan 7*24 array indicating the certain times of day or certain days of the week that you open your campaign, where index 0-6 in first dimension means Monday to Sunday, index 0-23 in second dimension means hours in a day, value 1 means selected, 0 means unselected
e.g.
[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]
means campaign will run from 3am to 2pm every Friday
No
dp_timezonestringBy default your account time zone is selected. We'll schedule your campaign to run based on the selected time zone.

The allowed value contains:
EST
UTC-12
UTC-11
UTC-10
UTC-9
UTC-8
UTC-7
UTC-6
UTC-5
UTC-4
UTC-3
UTC-2
UTC-1
UTC
UTC+1
UTC+2
UTC+3
UTC+4
UTC+5
UTC+6
UTC+7
UTC+8
UTC+9
UTC+10
UTC+11
UTC+12
UTC+13
UTC+14
No
start_timestringthe exactly start time for the campaign, format yyyy-mm-dd hh:mm:ss, it can not before very day manage-api calledNo
end_timestringthe exactly end time for the campaign, format yyyy-mm-dd hh:mm:ss, it can neither before start_time nor after year 2030No
daily_capdoublecpc cost as most everyday, minimum daily_cap cap is $20/day, daily_cap/cpc can not be less than 30No
cpcdoublebudget for a click(unit: USD), cpc can not be higher than $5, daily_cap/cpc can not be less than 30When charge_type is set to cpc or smart_bid, cpc is required. When charge_type is set to maxcv, cpc is not required.
objectivestringobjective of your campaign. Note: Please choose ONE Objective. The allowed value contains: "lead" means Lead Generation, "conversions" means Online Purchases, "awareness" means Website EngagementNo
target_cpadoubletarget CPA of your campaign.(unit: USD)When Marketing Objective selects Lead Generation or Online Purchases, target CPA is required; when Website Engagement is selected, target CPA is not required.
optimization_typestringconversion goal of your campaign. Note: Please fill in ONE conversion goal. The conversion goal is the type of pixel important conversion embedded in the account. If the pixel important conversion has not installed, please choose '-1' as the value. The allowed value contains: "1" means View Content, "2" means App Install, "3" means Complete Registration, "4" means Add to Cart, "5" means Add Payment Info, "6" means Search, "7" means Start Checkout, "8" means Purchase, "9" means Add to Wishlist, "10" means Lead, "-1" means Default OptimizationWhen Marketing Objective selects Lead Generation or Online Purchases, optimization_type is required;when Website Engagement is selected, optimization_type is not required.
The optimization_type is the type of pixel important conversion embedded in the account. If the pixel important conversion has not been installed, you can choose Default Optimization, which will optimize for important conversions that are passed back by default.

Frequently Asked Questions (FAQ)#

Q1: Why did my CPC setting fail?#

A: CPC setting failures usually occur for the following reasons:
Below minimum value: Different currencies have different minimum CPC requirements, please refer to the currency limits table
Precision issues: CPC supports maximum 3 decimal places, e.g., 0.123
Exceeds upper limit: CPC cannot exceed 5 USD and cannot exceed 1/30 of daily budget
Greater than daily budget: CPC cannot be greater than the current daily budget setting

Q2: What are the daily budget limits for MaxCV mode?#

A: MaxCV mode has special daily budget limits:
Regular MaxCV: Daily budget cannot exceed 20000
MaxCV Plus: Daily budget cannot exceed 30000
Change limits: Daily budget changes cannot exceed 10x the original value, requires gradual adjustment

Q3: What are the requirements for day parting settings?#

A: Day parting setting requirements:
Matrix format: Must be a 7×24 two-dimensional array representing 7 days × 24 hours
Value limits: Each time slot can only be 0 (off) or 1 (on)
At least one: At least one time slot must be set to 1
Timezone conversion: System will automatically perform timezone conversion based on dp_timezone

Q4: Why does campaign update fail with "no valid ads" message?#

A: This is because:
Campaign must contain valid ads to be editable
Ads may have been deleted or failed audit
Solution: Add valid ads to the campaign before updating

Q5: How to handle partial campaign update failures?#

A: The API supports partial success:
Successful campaigns: Returned in success_campaign_ids
Failed campaigns: Returned in failed_campaign_ids
Detailed errors: Check specific error reasons and field information in validation_errors
Retry strategy: Correct parameters for failed campaigns and resubmit

Q6: How are currency limits determined?#

A: Currency limits are based on the following principles:
Minimum CPC: Ensures minimum bid for effective ad competition
Minimum daily budget: Ensures campaigns have sufficient budget for delivery
Exchange rate considerations: Set based on purchasing power and market conditions of each currency

Q7: What are the special requirements for time format?#

A: Time format requirements:
Strict format: Must use YYYY-MM-DD HH:MM:SS format
Timezone handling: Time will be processed according to account timezone
Logic validation: Start time must be earlier than end time
Example: 2024-01-01 00:00:00

Q8: How to understand the relationship between CPC and daily budget?#

A: CPC and daily budget have the following relationship:
Basic principle: CPC cannot be greater than daily budget
Efficiency consideration: CPC should not exceed 1/30 of daily budget to ensure sufficient click opportunities
Upper limit control: CPC maximum does not exceed 5 USD (equivalent in other currencies)

Request

Header Params

Body Params application/json

Example
{
  "campaign_ids": [
    123456,
    789012
  ],
  "status": 1,
  "cpc": 0.25,
  "daily_cap": 100.0,
  "start_time": "2024-01-01 00:00:00",
  "end_time": "2024-12-31 23:59:59",
  "charge_type": "cpc",
  "target_cpa": 5.0,
  "objective": "lead_generation",
  "optimization_type": "cpa",
  "day_parting": [
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0]
  ],
  "dp_timezone": "Asia/Shanghai"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mediago.io/manage/v2/campaign/bulk-update' \
--header 'Authorization: Bearer your_access_token_here' \
--header 'Content-Type: application/json' \
--data-raw '{
  "campaign_ids": [
    123456,
    789012
  ],
  "status": 1,
  "cpc": 0.25,
  "daily_cap": 100.0,
  "start_time": "2024-01-01 00:00:00",
  "end_time": "2024-12-31 23:59:59",
  "charge_type": "cpc",
  "target_cpa": 5.0,
  "objective": "lead_generation",
  "optimization_type": "cpa",
  "day_parting": [
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
    [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0]
  ],
  "dp_timezone": "Asia/Shanghai"
}'

Responses

🟢200Success Response
application/json
Body

Example
{
    "code": 0,
    "msg": "Bulk update completed",
    "data": {
        "success_campaign_ids": [123, 456],
        "failed_campaign_ids": [789],
        "failed_reasons": [
            "Campaign 789: no permission to operate"
        ],
        "validation_errors": [
            {
                "campaign_id": 789,
                "field": "cpc",
                "value": "0.15",
                "message": "CPC 0.150 is below minimum value 0.200"
            }
        ]
    }
}
🟠400Error Response - Invalid Parameters
Modified at 2025-10-13 07:21:33
Previous
Update Campaign
Next
Batch Active/Pause Campaigns
Built with