Campaigns
Ad campaigns, made and run with AI.
Seven methods are open to an account API key. They work on a campaign that already exists: you make and pay for a campaign in the dashboard, where the card and the terms are, and from code you can write its copy, send it to its networks, pause or resume it and read how it is doing. Creating a campaign and paying for it is not available from code today.
Every call is a POST to https://xuda.ai/cpi/<method> with your key and a data object. Answers come back as { "code": 1, "data": ... }; a negative code is a refusal, with the reason in data.
From a brief to a running campaign
Find your campaigns
get_account_advertising lists the campaigns of your account. Each one has an id: that is the app_id the other methods take.
See which networks are live
get_advertise_platforms returns each network and its status, pending, processing or active. Credentials are never part of the answer.
Write or rewrite the copy
generate_ad_creative writes a headline, primary text, description and button for a campaign and a network, in a tone you choose: Professional, Friendly, Bold, Playful, Urgent or Luxury (Friendly if you leave it out). It runs on your AI credits. When there are none left, or the page cannot be read, you get a generic draft instead and the answer says which. Google Ads has its own template; the other networks share a feed template.
Send it to a network
launch_ad_campaign creates the campaign on a network, always paused. slug is google-ads or meta; with none it is google-ads, and any other value is refused. A second call for the same network updates the campaign that is there, so it is safe to repeat. On Google, an account with no Google Ads client account gets one created under Xuda's manager account the first time.
Switch it on or off
set_ad_network_status pauses or resumes the live campaigns on every network the campaign was sent to. It is what the Active switch in the dashboard does for the networks. Pass status as active or paused.
Read how it is doing
get_ad_campaign_report pulls the daily numbers from each network the campaign was sent to, for the last 1 to 30 days (14 if you leave it out).
A campaign runs on Google Ads, Meta Ads or both. The other networks the builder lists are marked as coming soon and cannot be launched to.
The campaign is now on the network and paused. Call set_ad_network_status with "status": "active" to start it.
These are the figures the Overview draws, and they are your own campaign's only: a call for a campaign that is not yours is refused.
Methods
get_account_advertising, which lists the account's campaigns, belongs to the Account microservice. See Static Websites for the Account table it sits beside.