Skip to main content
These examples show how an AI agent orchestrates multiple tools in sequence to answer questions that would otherwise require several API calls and manual correlation. Each example includes the prompt you’d send and what the agent does behind the scenes.
Most of these workflows are also packaged as auto-activating Agent Skills — install those and the agent runs them with built-in judgment, without you copy-pasting prompts.

Diagnose a traffic drop

A partner reports that their click volume dropped sharply yesterday. You want to know whether it’s a tracking issue, a cap being hit, or a real traffic problem. Prompt:
“Affiliate 142 had significantly fewer clicks yesterday compared to the day before. Can you figure out what happened?”
What the agent does:
  1. Calls run_performance_report with dimensions=date, filters=affiliate:142, from the day before yesterday and to yesterday, which returns one row per day (or dimensions=affiliate with comparison=previous_period and sort_by=revenue_delta for a single ranked delta, since comparison mode refuses a call without sort_by; comparison mode cannot be combined with a date dimension)
  2. Calls get_affiliate with include=activity to check portal login recency and API usage
  3. Calls get_offer with include=caps for the affiliate’s top offer to check whether a daily click cap is at its limit (current against limit, dated by usage_as_of)
  4. Summarizes the findings: volume drop confirmed, daily click cap reached (current equals limit as of the usage snapshot date), suggests raising the cap or splitting traffic across offers

Partner health check

You want a quick health summary for your top 5 affiliates before a weekly review call. Prompt:
“Give me a health summary for my top 5 affiliates by revenue this month. Flag anyone with declining performance or low portal activity.”
What the agent does:
  1. Calls run_performance_report with dimensions=affiliate, date range = current month, comparison=previous_period (the equal-length window just before the range; pass compare_from/compare_to for the whole of last month), sort_by=revenue, page_size=5 — one call returns the top 5 affiliates by revenue, each metric carrying { current, prior, delta, pct_change } vs. the prior window
  2. For each affiliate, calls get_affiliate with include=activity to fetch last login date, login frequency, and API call volume
  3. Returns a table: affiliate name, revenue.current vs. revenue.prior, revenue.pct_change, last login date — flagging any with a revenue decline over 20% (revenue.pct_change < -20) or no login in 14+ days

Compare a specific set of offers

You want a side-by-side performance comparison of a handful of specific offers — not your whole account. Prompt:
“Compare clicks, conversions, and revenue for offers 12, 45, and 78 this month.”
What the agent does:
  1. Calls run_performance_report once with dimensions=offer and filters=offer:12|45|78 — the pipe-separated values match all three offers in a single query
  2. Returns a per-offer table of clicks, conversions, and revenue
Using one multi-value filter (offer:12|45|78) keeps this to a single call. Without it, the agent would run a separate report per offer and stitch the results together. The same works for any ID filter — e.g. affiliate:7|14 or advertiser:13|26.

Investigate a disputed conversion

An advertiser disputes a conversion and claims the order was never placed. You need to trace the full event chain. Prompt:
“Advertiser says conversion a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 is fraudulent. Can you pull the full picture?”
What the agent does:
  1. Calls get_entity with type="conversion", id=a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 — retrieves payout, affiliate, sub parameters, adv parameters, geo, device, order ID, and the originating transaction ID
  2. Calls get_entity with type="transaction" and the transaction ID from step 1 — pulls the whole chain in one call: the originating click (IP, device, referrer, timestamp, unique flag), sibling conversions with their attribution_method, pixel-fire logs, and any on-hold conversions
  3. Calls search_activity with type="conversion" filtered to the same affiliate and order ID to check for duplicate conversions on the same order
  4. Returns a consolidated timeline: click at 09:14 UTC from IP 203.x.x.x (US, Chrome/iOS), conversion fired 4 minutes later, no duplicate order IDs found, no is_scrub flag on the conversion — suggests legitimate attribution

Payout audit for a period

Finance needs to reconcile affiliate payouts for last month before processing invoices. Prompt:
“Summarize total payouts by affiliate for March 2026, and flag anyone whose payout exceeded $10,000.”
What the agent does:
  1. Calls run_performance_report with dimensions=affiliate, date range = March 2026, sorted by payout descending
  2. Flags affiliates where payout > 10000 (the agent can also pass metric_filters="payout>10000" to the report)
  3. For each flagged affiliate, calls get_affiliate to retrieve their name and account manager, and list_affiliates for their tier
  4. Returns a ranked table with affiliate name, total payout, account manager, and a flag indicator — ready to paste into a finance report

Offer readiness check

You’re about to launch a new offer and want to verify that caps, targeting, and at least one affiliate are properly configured before going live. Prompt:
“Is offer 88 ready to launch? Check caps, targeting, and whether any affiliates are set up to run it.”
What the agent does:
  1. Calls get_offer with include=caps,targeting,payout,affiliates for offer 88
  2. Checks: at least one payout event in payout, global click cap is set, at least one country is targeted, and, for a require_approval or private offer, at least one entry in affiliates (for a public offer that list holds only blocked partners, so count active partners with count_entities type="affiliate" filters={"status":"active"} and subtract the blocked total)
  3. Calls get_affiliate on the first approved affiliate with include=activity to confirm they’re an active partner
  4. Returns a readiness checklist: payout configured ✓, targeting set to US/CA ✓, 3 approved affiliates ✓, primary affiliate last active 2 days ago ✓ — offer is ready to activate

Full trace: diagnose a blocked click

The examples above describe agent behavior in prose. This example shows the actual tool calls and abbreviated responses at each step, so you can see exactly what parameters are passed and what the agent works with. Prompt:
“Transaction abc123def456abc123def456abc123de is showing error code 1004 for affiliate 142. What happened?”
1

Look up the click

Tool: get_entity (type="click")
Key fields from the response:
2

Resolve the error code

Tool: get_entity
Response confirms: error 1004 (“Affiliate Not Approved”) — the click was blocked because the affiliate has not been approved to run this offer. (Note: codes 4–31 are mostly targeting and traffic control blocks; 1001–1005 are affiliate eligibility, 1006–1015 offer, advertiser and Smart Link lookups, and 1016–1021 further checks, most of them fraud checks; look any code up with list_entities(type="click_error_code").)
3

Check the affiliate's approval status on the offer

Tool: get_offer
Key fields from the response:
Agent summary: Affiliate 142 (MediaPartner Inc.) sent traffic to offer 88 while their approval was still pending. Offer 88 uses require_approval visibility — all affiliates need explicit approval before traffic is accepted. To resolve: approve affiliate 142 for offer 88 in Control Center → Offers → [Offer 88] → Affiliates.