import type * as Whop from "../../../../index.mjs"; /** * @example * { * account_id: "biz_xxxxxxxxxxxxxx", * engagement: { * include: [{ * object: "facebook_page", * event: "engaged", * external_account_id: "sacc_xxxxxxxxxxxxxx", * retention_days: 30 * }], * platform: "meta" * }, * name: "Page engagers", * source_type: "engagement" * } */ export interface CreateAudiencesRequest { /** Account ID, prefixed `biz_`. */ account_id: string; /** Audience type. Defaults to `custom`. */ audience_type?: CreateAudiencesRequest.AudienceType; /** Filter audiences only, and set only at creation. `true` (the default) rebuilds membership from the filters twice a day. `false` keeps whoever matched at creation and never rebuilds. */ auto_refresh?: boolean; /** CSV audiences only. Maps supported identity fields to CSV column headers. Map at least one of `email` or `phone`. */ column_mapping?: CreateAudiencesRequest.ColumnMapping; /** Lookalikes only. Number of lookalike audiences to create (1–6). */ count?: number; /** Rules for membership based on social engagement. Requires a connected social account with advertising access. */ engagement?: CreateAudiencesRequest.Engagement; /** CSV audiences only. The uploaded customer CSV — a file id (`file_...`) returned by `POST /files`. */ file_id?: string; /** Filter audiences only. The People filters that define membership, keyed exactly as `GET /people` accepts them — for example `{"os": "iOS", "country": "US"}`. Activity dates `event_from` and `event_to` are inclusive and remain fixed on refresh. Use `event_within_days`, `first_seen_within_days` or `last_seen_within_days` for a rolling window. Source values are canonical source paths (`whop:::`, `ext::...`, `referrer:`, `direct`), exact or with a trailing `:*` wildcard. */ filters?: Record; /** Audience display name. Required for custom audiences; lookalike names are generated from the source audience. */ name?: string; /** Lookalikes only. Total similarity reach as a whole percent (1–20), sliced evenly across `count` — must be divisible by `count`. For example, 3 audiences at 6% creates 0–2%, 2–4%, and 4–6% bands. */ percentage?: number; /** Lookalikes only. The ready custom audience (`adaud_`) to build from; uploaded and People audiences need at least 100 matched people. Meta validates engagement audience eligibility when creating the lookalike. */ source_audience_id?: string; /** Custom audience source. Inferred from `engagement`, then `filters`, otherwise defaults to `csv_upload`. Supply only the fields for the selected source. */ source_type?: CreateAudiencesRequest.SourceType; } export declare namespace CreateAudiencesRequest { /** Audience type. Defaults to `custom`. */ const AudienceType: { readonly Custom: "custom"; readonly Lookalike: "lookalike"; }; type AudienceType = (typeof AudienceType)[keyof typeof AudienceType]; /** * CSV audiences only. Maps supported identity fields to CSV column headers. Map at least one of `email` or `phone`. */ interface ColumnMapping { /** CSV header for ISO 3166-1 alpha-2 country codes, such as `US`. */ country?: string | undefined; /** CSV header for email addresses. */ email?: string | undefined; /** CSV header for first names. */ first_name?: string | undefined; /** CSV header for last names. */ last_name?: string | undefined; /** CSV header for each customer's lifetime value — a non-negative number, currency symbols allowed. When mapped, Meta creates the audience as value-based, so lookalikes built from it favor people similar to the highest-value customers. */ ltv?: string | undefined; /** CSV header for phone numbers. */ phone?: string | undefined; } /** * Rules for membership based on social engagement. Requires a connected social account with advertising access. */ interface Engagement { /** Exclude anyone matching any exclusion rule. Defaults to an empty array. Video audiences do not support exclusions; use a separate audience in ad-group exclusions. */ exclude?: Whop.AudienceEngagementRule[] | undefined; /** Match any inclusion rule. Video rules must share a retention window and cannot be combined with other sources. */ include: Whop.AudienceEngagementRule[]; /** Ad platform that maintains membership. */ platform: Engagement.Platform; } namespace Engagement { /** Ad platform that maintains membership. */ const Platform: { readonly Meta: "meta"; }; type Platform = (typeof Platform)[keyof typeof Platform]; } /** Custom audience source. Inferred from `engagement`, then `filters`, otherwise defaults to `csv_upload`. Supply only the fields for the selected source. */ const SourceType: { readonly CsvUpload: "csv_upload"; readonly PeopleFilter: "people_filter"; readonly Engagement: "engagement"; }; type SourceType = (typeof SourceType)[keyof typeof SourceType]; }