Building Campaigns with the Campaign Agent

Creating and Managing Campaigns assumes you already know who you're targeting and what you want to say. The campaign agent is a different way in: describe the business outcome you want, and it works out the rest - the audience, the copy, the artwork, and what the opportunity's worth.

Start a run

POST /drive-api/v1/campaigns/agent

This starts a run and returns immediately with a generation_id - the agent then finds the matching audience, writes the campaign copy, generates the artwork, and estimates the value of the opportunity, all in the background.

Inputs

FieldRequiredWhat it does
campaign_goalYesThe business goal the campaign should serve, in plain language - e.g. "win back customers who've started paying a competitor credit card." This is the one input you'll set on every request.
contextNoOverrides your organization's configured context for this run only.
tone_of_voiceNoOverrides your organization's configured tone of voice for this run only.
brandingNoOverrides your organization's configured branding for this run only.
image_styleNoOverrides your organization's configured image style for this run only.
extra_contextNoAdds extra context for this run only, on top of what's configured.

campaign_goal is the main thing you'll change from request to request - everything else, the agent already knows. Your organization's context, tone of voice, branding, and image style are configured by Bud on your behalf, so most requests send nothing but the goal.

That said, it's worth checking what's actually configured for your organization before relying on it. Getting the goal right but the tone, branding, or image style wrong still produces a campaign you can't ship as-is - these five fields shape everything the agent writes and generates, not just the audience it finds.

How overrides work:

  • Leave a field out entirely → the agent uses what's configured for your organization.
  • Send a value → overrides the configured value, for this run only. Nothing sent here is saved against your organization.
  • Send an empty string → drops that field for this run, even if something's configured.
{
  "campaign_goal": "Promote our new savings account to renters with stable income",
  "tone_of_voice": "Warm and encouraging, avoid jargon"
}

Poll for the result

GET /drive-api/v1/campaigns/agent/{generation_id}

Runs take minutes rather than seconds, so poll every 10-15 seconds until status is completed - result stays null until then.

failed isn't necessarily the end of the road. A failed run can retry automatically, so a later poll can flip back to running. Treat completed as the only real stop condition, not failed.

Turn it into a live campaign

Once a run completes, pass result.template_id to Creating and Managing Campaigns as template_id, the same as any other template, to turn what the agent drafted into a live campaign.

This is different from the templates that show up in Campaign Agent Templates without you asking - those are proactively generated from your organization's context and data. Calling this endpoint is for when you already have a specific goal in mind, rather than waiting for the agent to surface one.

A run belongs to the organization that created it - request another organization's run and you'll get a not-found, not a forbidden, so don't rely on that distinction to tell the two apart.


Did this page help you?