Performance Marketing
Connect Meta Ads, measure campaign performance, test assets from Universe and approve controlled campaign operations.
The Performance Marketing API connects an organization's Meta ad accounts to Universe. It reads campaign performance, compares existing creatives, imports first-time customer outcomes for CAC, and prepares experiments from your existing asset library. Proposed campaign changes require approval. The analyst explains the saved report; it does not launch or edit ads.
Two separate kinds of spend
The analyst uses Universe credits, charged at start and settled against actual tokens. Meta campaign launch, activation and budget increases can spend the ad account's advertising funds. That external spend is not paid with Universe credits. A saved draft or action proposal does not execute it.
Authentication and identifiers
Send x-api-key: $ACCLARO_API_KEY, using an organization-bound key created in Settings → API keys.
The key acts with its creator's role and does not need an organizationId header. The organization
must have Performance Marketing enabled; the analyst additionally needs Chat access/chat:create.
Session-based webapp requests need their organization header.
Route account/connection/experiment/action/rule IDs are Universe UUIDs. Meta ad account IDs
(act_123456789) and object/page/pixel IDs (decimal strings) are separate values. Never put an
act_… ID in accounts/:id.
Connect Meta and select an account
- Start Meta authorization. Keep
attemptIdandverifierin the initiating browser. Open the returnedurlfor the person's consent. Attempts expire after ten minutes and belong to the initiating member. When sendingOrigin, use an allowed Universe webapp origin; without it the configured central origin receives the callback. - Meta's configured callback validates the one-use state and redirects the consenting browser back with the code. It does not finalize the connection by itself. Do not log the verifier or code.
- Complete Meta authorization with
attemptId, that verifier and the exact callbackcode. The responseidis the connection UUID. - Discover Meta ad accounts, then Select an ad account with its Meta ID. Re-selecting the same account reuses the Universe row.
curl -X POST {{API_BASE_URL}}/v1/galaxy/performance-marketing/accounts \
-H "x-api-key: $ACCLARO_API_KEY" \
-H "content-type: application/json" \
-d '{ "connectionId": "c1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b", "metaAccountId": "act_123456789" }'Set account context and guardrails
before experiment preparation or action approval. This replaces both context and policy.
Choose your goal, market, landing page and business targets, protect sensitive objects and set
allowed budgets/cooldowns. A zero maxDailyBudgetMinor blocks budget growth and launch.
Read performance and CAC
Queue account sync, then poll
Get an ad account until lastSyncAt advances or
syncError explains failure. Repeated sync requests join the same live job. Sync reads Meta;
it does not immediately execute campaign changes. Enabled rules may be evaluated after sync.
curl '{{API_BASE_URL}}/v1/galaxy/performance-marketing/accounts/c1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b/report?days=7' \
-H "x-api-key: $ACCLARO_API_KEY"Get performance report accepts days=7 or 30
and compares with the preceding equal period in the account timezone. Before the first snapshot,
current, previous and snapshotAt are null. Reporting uses 7-day click / 1-day view attribution,
with conversion-date reporting. Snapshot times and conversion delay matter when comparing results.
| Metric | Meaning and limits |
|---|---|
| Spend / revenue | Major units of the account currency. Revenue can be null if purchase values are missing/inconsistent. |
| ROAS | Attributed purchase revenue / spend; null if unavailable. |
| CPA | Spend / conversions for the configured goal. |
| CAC | Spend / first-time customers; requires imported outcomes for every account-local day in the period. |
| CTR / CVR | Percentages; CTR uses all clicks/impressions, CVR uses goal conversions/link clicks. |
| CPC / CPM | Spend per all click / per 1,000 impressions. |
| Reach / frequency | Deduplicated at Meta's reporting grain; null when aggregation cannot preserve that value. |
Record daily CRM/commerce outcomes with Record new-customer outcomes. Purchases are not assumed to be new customers. Missing days produce null CAC, not an invented zero. Explicitly submit zero-customer days when that is the actual known result.
curl -X PUT {{API_BASE_URL}}/v1/galaxy/performance-marketing/accounts/c1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b/outcomes \
-H "x-api-key: $ACCLARO_API_KEY" -H "content-type: application/json" \
-d '{ "date": "2026-10-10", "newCustomers": 5, "source": "CRM daily export" }'Analyze an ad account takes question, days
and optional model. It returns a complete reply, its sessionId, actual credits and report
snapshotAt; allow up to 180 seconds. Failed/incomplete replies are refunded. A completed delivered
reply remains charged if saving chat history fails, in which case sessionId/credits can be null.
The selected model uses the current credit rates.
The account pixel
Each ad account names the Meta pixel its results are counted with.
List the account pixels shows every pixel the ad
account may use and when each last received an event;
Set the account pixel records one (pixelId: null
removes it) and checks it at once. Nothing is written to Meta. The check reads Meta's last seven days
of event stats: health.status is error when the pixel is unavailable, never fired or was silent
all week, and warning when it was quiet for a day, the account goal's event (Purchase, Lead or
PageView) is missing, or under 90% of purchases carry a value or currency. Each entry in
health.checks says which; unknown means Meta did not answer that part. Syncs refresh it, and
Check the account pixel does so on demand. A
pixel Meta will not return is reported in checkError and keeps its previous health.
Experiments from existing assets
Create an experiment saves a draft with 2–5
distinct organization assets. Images are JPEG/PNG under 30 MB; videos are MP4/MOV under 1 GB and
need thumbnailAssetId pointing to an image. Use resources from
List pages and pixels. Standard commercial
eligibility must be affirmed with standardCommercial: true; do not use this flow for Meta special
ad categories. Sales and lead objectives require pixelId; ROAS is only valid for sales.
The plan's dailyBudgetMinor is per variant, using Meta's currency offset, not a decimal amount.
For USD, 2,000 means $20 per variant; three variants have $60/day total delivery budget. Other
currencies can have different offsets. Reports use major currency units, so do not reuse their spend
number as a minor-unit budget without conversion. Duration must be 3–30 days.
The plan also contains testKind (creative or campaign), objective, name, hypothesis,
landingPage, countries, startTime/endTime (offset-aware ISO dates), minConversions,
successMetric, and each variant's name, assetId, headline, message and cta.
The Create an experiment reference contains the
complete request schema and constraints.
- Save the draft and review it with Get an experiment.
- Prepare paused campaign objects requires approval and asset access. It uploads media, writes paused Meta objects and creates the native study. Preparation is a real provider write, though delivery remains paused.
- Review processing/state. Launch a prepared experiment activates delivery after live policy checks and can spend advertising money.
- Pause an experiment in the Universe app: it pauses confirmed campaigns, including a partially launched experiment.
An uncertain provider response is not permission to retry creation blindly. The saved steps record
confirmed IDs and sending/uncertain states. Use
Recover an uncertain creation with the
exact stepKey and a verified Meta object ID. Only uncertain media uploads may be explicitly retried
with retryMedia: true; never duplicate campaign/ad/study creation because a response was lost.
Get experiment efficiency results returns observational ranking, conversion eligibility and maturity. It includes the seven-day post-delivery attribution tail and requires complete retained daily coverage. A leading variant is not a statistically significant winner. Consult Get native Meta study results for Meta's reported high performers; unavailable results are clearly identified.
Move an experiment to a project keeps
processes organized without changing access. Experiment lists are paginated at 50 rows, zero-based;
projectId=none selects unassigned experiments.
Action approval and rules
Propose a campaign change saves exactly one status or daily budget change. Approve and execute an action rechecks live state and guardrails before a Meta write. Rejection is local. Rollback creates a new proposal needing separate approval; it is not an immediate reverse write. For an unconfirmed write, Reconcile action execution reads live state before deciding whether it landed.
New automation rules must be disabled simulations. Preview rule matches
first, then explicitly enable the desired mode. Historical matches are not reconstructed intervention
results. recommend proposes decisions; guarded can execute budget changes only when both rule and
account policy authorize them. Pauses always need human approval. Null metrics never match, and
frequency rules cannot be guarded because deduplicated historical frequency is unavailable.
Errors and integration boundaries
400: invalid input, unsupported plan, missing pixel, stale snapshot or a policy prerequisite.401/403: missing/invalid key, role permissions or disabled organization entitlement.404: wrong-organization resource or an object absent from the complete account snapshot.409: conflicting state, busy execution or an unresolved provider write.402: insufficient Universe credits for the analyst; nothing starts.422: Meta refused the request and said why; the message quotes Meta's reason and code (for example a Page the login no longer shares). Fix it in Meta, then retry.429: key rate limit; followRetry-After.502: Meta did not answer, answered with a server error, or did not confirm a write.503: Meta is not configured or a required capability/migration is absent.
Internal worker callback routes are not customer API endpoints. Flow report/analyze steps run through Flow's API and the existing account permissions; creating new PM Flow steps is currently hidden in the UI while definitions remain available to existing graphs. These docs do not expose Meta credentials or implement a general-purpose Meta Graph proxy.