curl --request POST \
--url https://app.adstellar.ai/api/v1/tools/build_campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"adAccountId": "<string>",
"dailyBudget": 50000.5,
"destinationUrl": "<string>",
"conversionEvent": "<string>",
"pixelId": "<string>",
"pageId": "<string>",
"appId": "<string>",
"welcomeMessage": "<string>",
"campaignName": "<string>",
"creativeAssetIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"approvedCopy": [
{
"headline": "<string>",
"primaryText": "<string>",
"description": "<string>",
"cta": "<string>"
}
],
"geos": [
"<string>"
],
"languages": [
"<string>"
],
"instructions": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.adstellar.ai/api/v1/tools/build_campaign"
payload = {
"adAccountId": "<string>",
"dailyBudget": 50000.5,
"destinationUrl": "<string>",
"conversionEvent": "<string>",
"pixelId": "<string>",
"pageId": "<string>",
"appId": "<string>",
"welcomeMessage": "<string>",
"campaignName": "<string>",
"creativeAssetIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"approvedCopy": [
{
"headline": "<string>",
"primaryText": "<string>",
"description": "<string>",
"cta": "<string>"
}
],
"geos": ["<string>"],
"languages": ["<string>"],
"instructions": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
adAccountId: '<string>',
dailyBudget: 50000.5,
destinationUrl: '<string>',
conversionEvent: '<string>',
pixelId: '<string>',
pageId: '<string>',
appId: '<string>',
welcomeMessage: '<string>',
campaignName: '<string>',
creativeAssetIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
approvedCopy: [
{
headline: '<string>',
primaryText: '<string>',
description: '<string>',
cta: '<string>'
}
],
geos: ['<string>'],
languages: ['<string>'],
instructions: '<string>',
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.adstellar.ai/api/v1/tools/build_campaign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.adstellar.ai/api/v1/tools/build_campaign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'adAccountId' => '<string>',
'dailyBudget' => 50000.5,
'destinationUrl' => '<string>',
'conversionEvent' => '<string>',
'pixelId' => '<string>',
'pageId' => '<string>',
'appId' => '<string>',
'welcomeMessage' => '<string>',
'campaignName' => '<string>',
'creativeAssetIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'approvedCopy' => [
[
'headline' => '<string>',
'primaryText' => '<string>',
'description' => '<string>',
'cta' => '<string>'
]
],
'geos' => [
'<string>'
],
'languages' => [
'<string>'
],
'instructions' => '<string>',
'workspaceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.adstellar.ai/api/v1/tools/build_campaign"
payload := strings.NewReader("{\n \"adAccountId\": \"<string>\",\n \"dailyBudget\": 50000.5,\n \"destinationUrl\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"appId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"campaignName\": \"<string>\",\n \"creativeAssetIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"approvedCopy\": [\n {\n \"headline\": \"<string>\",\n \"primaryText\": \"<string>\",\n \"description\": \"<string>\",\n \"cta\": \"<string>\"\n }\n ],\n \"geos\": [\n \"<string>\"\n ],\n \"languages\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.adstellar.ai/api/v1/tools/build_campaign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"adAccountId\": \"<string>\",\n \"dailyBudget\": 50000.5,\n \"destinationUrl\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"appId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"campaignName\": \"<string>\",\n \"creativeAssetIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"approvedCopy\": [\n {\n \"headline\": \"<string>\",\n \"primaryText\": \"<string>\",\n \"description\": \"<string>\",\n \"cta\": \"<string>\"\n }\n ],\n \"geos\": [\n \"<string>\"\n ],\n \"languages\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.adstellar.ai/api/v1/tools/build_campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"adAccountId\": \"<string>\",\n \"dailyBudget\": 50000.5,\n \"destinationUrl\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"appId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"campaignName\": \"<string>\",\n \"creativeAssetIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"approvedCopy\": [\n {\n \"headline\": \"<string>\",\n \"primaryText\": \"<string>\",\n \"description\": \"<string>\",\n \"cta\": \"<string>\"\n }\n ],\n \"geos\": [\n \"<string>\"\n ],\n \"languages\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyHave the AI Campaign Builder assemble a complete Meta campaign (audiences, ad sets, ads, copy, creatives) as a reviewable draft. FREE and publishes nothing. Returns a jobId; poll get_campaign_build until phase is preview_ready, show the preview to the user, then call launch_campaign. Use get_launch_options first for pixel/Page ids.
Have the AI Campaign Builder assemble a complete Meta campaign (audiences, ad sets, ads, copy, creatives) as a reviewable draft. FREE and publishes nothing. Returns a jobId; poll get_campaign_build until phase is preview_ready, show the preview to the user, then call launch_campaign. Use get_launch_options first for pixel/Page ids.
curl --request POST \
--url https://app.adstellar.ai/api/v1/tools/build_campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"adAccountId": "<string>",
"dailyBudget": 50000.5,
"destinationUrl": "<string>",
"conversionEvent": "<string>",
"pixelId": "<string>",
"pageId": "<string>",
"appId": "<string>",
"welcomeMessage": "<string>",
"campaignName": "<string>",
"creativeAssetIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"approvedCopy": [
{
"headline": "<string>",
"primaryText": "<string>",
"description": "<string>",
"cta": "<string>"
}
],
"geos": [
"<string>"
],
"languages": [
"<string>"
],
"instructions": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.adstellar.ai/api/v1/tools/build_campaign"
payload = {
"adAccountId": "<string>",
"dailyBudget": 50000.5,
"destinationUrl": "<string>",
"conversionEvent": "<string>",
"pixelId": "<string>",
"pageId": "<string>",
"appId": "<string>",
"welcomeMessage": "<string>",
"campaignName": "<string>",
"creativeAssetIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"approvedCopy": [
{
"headline": "<string>",
"primaryText": "<string>",
"description": "<string>",
"cta": "<string>"
}
],
"geos": ["<string>"],
"languages": ["<string>"],
"instructions": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
adAccountId: '<string>',
dailyBudget: 50000.5,
destinationUrl: '<string>',
conversionEvent: '<string>',
pixelId: '<string>',
pageId: '<string>',
appId: '<string>',
welcomeMessage: '<string>',
campaignName: '<string>',
creativeAssetIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
approvedCopy: [
{
headline: '<string>',
primaryText: '<string>',
description: '<string>',
cta: '<string>'
}
],
geos: ['<string>'],
languages: ['<string>'],
instructions: '<string>',
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.adstellar.ai/api/v1/tools/build_campaign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.adstellar.ai/api/v1/tools/build_campaign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'adAccountId' => '<string>',
'dailyBudget' => 50000.5,
'destinationUrl' => '<string>',
'conversionEvent' => '<string>',
'pixelId' => '<string>',
'pageId' => '<string>',
'appId' => '<string>',
'welcomeMessage' => '<string>',
'campaignName' => '<string>',
'creativeAssetIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'approvedCopy' => [
[
'headline' => '<string>',
'primaryText' => '<string>',
'description' => '<string>',
'cta' => '<string>'
]
],
'geos' => [
'<string>'
],
'languages' => [
'<string>'
],
'instructions' => '<string>',
'workspaceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.adstellar.ai/api/v1/tools/build_campaign"
payload := strings.NewReader("{\n \"adAccountId\": \"<string>\",\n \"dailyBudget\": 50000.5,\n \"destinationUrl\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"appId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"campaignName\": \"<string>\",\n \"creativeAssetIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"approvedCopy\": [\n {\n \"headline\": \"<string>\",\n \"primaryText\": \"<string>\",\n \"description\": \"<string>\",\n \"cta\": \"<string>\"\n }\n ],\n \"geos\": [\n \"<string>\"\n ],\n \"languages\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.adstellar.ai/api/v1/tools/build_campaign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"adAccountId\": \"<string>\",\n \"dailyBudget\": 50000.5,\n \"destinationUrl\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"appId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"campaignName\": \"<string>\",\n \"creativeAssetIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"approvedCopy\": [\n {\n \"headline\": \"<string>\",\n \"primaryText\": \"<string>\",\n \"description\": \"<string>\",\n \"cta\": \"<string>\"\n }\n ],\n \"geos\": [\n \"<string>\"\n ],\n \"languages\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.adstellar.ai/api/v1/tools/build_campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"adAccountId\": \"<string>\",\n \"dailyBudget\": 50000.5,\n \"destinationUrl\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"appId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"campaignName\": \"<string>\",\n \"creativeAssetIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"approvedCopy\": [\n {\n \"headline\": \"<string>\",\n \"primaryText\": \"<string>\",\n \"description\": \"<string>\",\n \"cta\": \"<string>\"\n }\n ],\n \"geos\": [\n \"<string>\"\n ],\n \"languages\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
AdStellar API key (ast_live_...)
Body
Meta ad account id from list_ad_accounts.
1Campaign objective.
OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC, OUTCOME_AWARENESS, OUTCOME_ENGAGEMENT, OUTCOME_APP_PROMOTION Daily budget in the ad account's currency (major units).
1 <= x <= 100000Landing page of the product being advertised, from the user or list_products; never an app or Page URL from get_launch_options. Required for website / instant_form campaigns; recommended for all because the copywriter writes every ad from this page.
Where ads send people. Defaults to the objective's default (website, or app for App Promotion).
website, instant_form, app, whatsapp, messenger, instagram_direct, messenger_instagram Leads only: WEBSITE (pixel + landing page) or INSTANT_FORMS (no pixel). Default WEBSITE.
WEBSITE, INSTANT_FORMS Pixel event to optimise for on Sales/Leads, e.g. "Purchase", "Lead", "StartTrial". Default follows the objective.
60Pixel id or exact name from get_launch_options. Auto-selected when the account has exactly one.
Facebook Page id or exact name from get_launch_options. Auto-selected when the account has exactly one.
App Promotion only: app id from get_launch_options.
Messaging destinations only: greeting shown when the conversation opens.
500Campaign name. Omit to let the builder name it.
200Up to 10 media asset ids (from search_assets or get_generation_status) to use as the ad creatives. Omit to let the builder pick from the library.
10^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Up to 5 ad copy variants the user already approved (e.g. from generate_ad_copy). Used verbatim.
5Show child attributes
Show child attributes
Countries to target (names or ISO codes). Omit for the builder default.
2560Audience languages, e.g. ["English"]. Omit for all languages.
1060Free-text guidance for the builder: audience angle, offer, tone, exclusions.
2000Workspace to act in (must be granted to this credential). Omit for the primary workspace.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
Tool result