Skip to content

Campaigns

Ad campaigns, made and run with AI.

Open Campaigns
Checked against the dashboard on November 18, 2026

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).

Only Google Ads and Meta Ads are wired

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.

curl -s https://xuda.ai/cpi/launch_ad_campaign \
  -H 'content-type: application/json' \
  -d '{"api_key":"YOUR_API_KEY","data":{"app_id":"YOUR_CAMPAIGN_APP_ID","slug":"google-ads"}}'
const res = await fetch('https://xuda.ai/cpi/launch_ad_campaign', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: { app_id: 'YOUR_CAMPAIGN_APP_ID', slug: 'google-ads' },
  }),
});
const { code, data } = await res.json();
import requests

res = requests.post(
    'https://xuda.ai/cpi/launch_ad_campaign',
    json={'api_key': 'YOUR_API_KEY', 'data': {'app_id': 'YOUR_CAMPAIGN_APP_ID', 'slug': 'google-ads'}},
)

The campaign is now on the network and paused. Call set_ad_network_status with "status": "active" to start it.

curl -s https://xuda.ai/cpi/get_ad_campaign_report \
  -H 'content-type: application/json' \
  -d '{"api_key":"YOUR_API_KEY","data":{"app_id":"YOUR_CAMPAIGN_APP_ID","days":7}}'
const res = await fetch('https://xuda.ai/cpi/get_ad_campaign_report', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ api_key: 'YOUR_API_KEY', data: { app_id: 'YOUR_CAMPAIGN_APP_ID', days: 7 } }),
});
const { data } = await res.json();
import requests

res = requests.post(
    'https://xuda.ai/cpi/get_ad_campaign_report',
    json={'api_key': 'YOUR_API_KEY', 'data': {'app_id': 'YOUR_CAMPAIGN_APP_ID', 'days': 7}},
)

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.

How is this guide?

Last updated on November 12, 2026