MMetadata /docs
Docs/Tools/create_audience_from_segment

create_audience_from_segment

Create a dynamic Insights Retargeting audience from a saved Insights (Spotlight) segment: the companies matching the segment inside a lookback window, refreshed automatically as…

Writes audiences

Creates or changes something in the account. Put it behind whatever review your agent uses.

What it does

Create a dynamic Insights Retargeting audience from a saved Insights (Spotlight) segment: the companies matching the segment inside a lookback window, refreshed automatically as the journey data changes.

TWO VARIANTS (audience_type):
- "contacts" (default): Insights Retargeting Contacts, platform type WEBSITE_RETARGETING. Contacts at the matching accounts, matched through the Metadata contact graph; usable on LinkedIn, Facebook, Instagram, X and Reddit.
- "accounts": Insights Retargeting Accounts, platform type WEBSITE_ACCOUNT_RETARGETING. The matching COMPANIES pushed to LinkedIn as a matched company audience; LinkedIn only. The shape for account-level INCLUSION or EXCLUSION on LinkedIn, e.g. suppressing accounts that already received 200+ impressions from a sequenced program.

WHEN: behaviour- or CRM-state-based retargeting and suppression ("retarget accounts that visited pricing", "exclude accounts we already saturated", "high engagement score not in the CRM"). NOT for firmographic / technographic / intent asks (use those audience tools), and NOT for LinkedIn ad-engagement retargeting (create_linkedin_engagement_retargeting_audience works off LinkedIn's own engagement signals; this one works off the Spotlight journey: website visits, impressions, clicks, scores, CRM state).

WORKFLOW (each step is checked and a failure is refused with the reason):
1. list_segments, then get_segment_criteria(segment_id, lookback_window): the segment must exist, be READY, and match at least one account in the window. A segment matching 0 accounts is refused (widen the window, or create_segment with looser criteria).
2. lookback_window in days (1 to 365): the window the segment's metrics are evaluated over ("in the last 90 days" = 90).
3. Call this tool with a descriptive name. The audience appears in the library as "Insights Retargeting Contacts (Dynamic)" or "Insights Retargeting Accounts (Dynamic)".

RETURNS: {success, id, audience_id, audience_name, status, audience_type, platform_audience_type, segment_id, segment_name, lookback_window, accounts_in_window, channels, expectedNumberOfCompanies, expectedNumberOfContacts, criteria}. Member matching is asynchronous: -1 or 0 right after creation means "not matched yet"; check again later with get_deep_audience_details.

USED AS AN EXCLUSION: Ann attaches it through add_and_edit_campaign_elements (`exclude_audiences`) on the campaign that must not reach those accounts.

Arguments

ArgumentTypeNotes
segment_id integer required The id of a READY segment from list_segments / create_segment.
name string required Name for the new audience. Unique and descriptive, e.g. 'Exclude: 200+ LinkedIn impressions, 90d'.
lookback_window integer required Days the segment is evaluated over. Range 1 to 365. 30 for the last month, 90 for the last quarter.
audience_type string contacts (default): people at the matching accounts, multi-channel. accounts: the matching companies as a LinkedIn matched audience, LinkedIn only; use it for account-level LinkedIn exclusions.
one of: contacts, accounts

Request

Request template, not a complete runnable example. Replace placeholders, empty objects, arrays, and zero values with valid account-specific inputs. Read required fields and nested constraints in the full schema. Confirm the account, connected channels, and referenced assets before calling a write tool.

curl
curl -s -X POST https://mcp-server.metadata.io/mcp \
  -H "Authorization: $METADATA_PAT" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"create_audience_from_segment","arguments":{"segment_id":0,"name":"<name>","lookback_window":0}}}'

Response

No recorded response. This tool writes to the account, so it is never executed to build these docs. The request is an illustrative template. Fill required fields and check the current schema before calling it. No response is fabricated.

Other audiences tools:

Browse the tool catalog · machine-readable index