import type * as Whop from "../../../../index.mjs"; /** * @example * {} */ export interface CreateAdsRequest { /** The platform returned when you last retrieved the campaign, ad group, or ad. A different current platform rejects the request with campaign_changed; retrieve the resource again before editing. Required after a delivery-platform migration when creating ads or ad groups, or changing fields other than title, status, budget, and account scope. */ "X-Ads-Platform"?: Whop.CreateAdsRequestXAdsPlatform; /** An inline ad group to create (same shape as POST /ad_groups, including ad_campaign_id). Creates the ad group and the ad together. Provide this OR ad_group_id. */ ad_group?: Record; /** The existing ad group to create the ad in. Provide this OR ad_group, not both. */ ad_group_id?: string; /** The call-to-action button shown on the ad. */ call_to_action?: CreateAdsRequest.CallToAction; /** The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Entries with no format become a carousel's ordered cards, sharing the ad's copy — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. */ creatives?: CreateAdsRequest.Creatives.Item[]; /** The description shown on the ad. Entries without a language are the ad's own copy; add one entry per other language on a Meta ad with `translations`. */ descriptions?: CreateAdsRequest.Descriptions.Item[]; /** Promote a post you already published instead of uploading creatives — a Facebook post or Instagram media id. Mutually exclusive with creatives. Pair with post_source. */ existing_post_id?: string; /** The external accounts the ad runs under — a connected Facebook page and, optionally, an Instagram profile. */ external_accounts?: CreateAdsRequest.ExternalAccounts.Item[]; /** The headline shown on the ad. Entries without a language are the ad's own copy; add one entry per other language on a Meta ad with `translations`. */ headlines?: CreateAdsRequest.Headlines.Item[]; /** Instant lead form for the ad. Only allowed when the ad group's conversion_location is an instant-form destination (instant_forms, instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with lead_form_id. */ lead_form?: CreateAdsRequest.LeadForm; /** Use an existing instant form instead of creating one — the form's platform ID, from a form already on the ad's Facebook page. Only allowed when the ad group's conversion_location is an instant-form destination. Mutually exclusive with lead_form. */ lead_form_id?: string; /** Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt (keyword). */ messaging_config?: CreateAdsRequest.MessagingConfig; /** Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. */ multi_advertiser_ads?: boolean; /** The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. */ music?: CreateAdsRequest.Music | null; /** Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. */ post_source?: CreateAdsRequest.PostSource; /** The primary text shown in the ad body. Entries without a language are the ad's own copy (several make text variations); add one entry per other language on a Meta ad with `translations`. */ primary_texts?: CreateAdsRequest.PrimaryTexts.Item[]; /** The display name of the ad. */ title?: string; /** Shows a Meta ad in other languages. Each viewer sees the version for their language; everyone else sees the ad's own copy. Tag every copy and creatives entry with its language: the ad's own with `source_language`, and give every other language a `primary_texts` and `headlines` entry (a `descriptions` entry and a `creatives` entry are optional), or list it in `automatic_languages`. Needs a website destination, one image or video, and exactly one primary text and headline of the ad's own (and at most one description), with no Dynamic Creative or crops. Replaced as a whole when sent, so send `automatic_languages` with `source_language`. null turns translations off and deletes their media. Meta-only. */ translations?: CreateAdsRequest.Translations | null; /** The URL the ad links to. Query parameters are merged into url_parameters, so the stored URL is always bare. */ url?: string; /** Query parameters to append to the destination URL, keyed by parameter name. Merged with any query string on `url`. Whop adds its own click-attribution parameters; those are reserved and rejected if you set them. Which keys are reserved depends on the ad's network — Meta: utm_meta_ad_id, utm_meta_adset_id, utm_meta_campaign_id, utm_source, utm_placement, utm_medium, utm_content, utm_adset, utm_whop, wacid, wasid, waid, tw_source, tw_adid; TikTok: waid, wasid, wacid, ad_id, adset_id, campaign_id, utm_source, utm_medium, utm_placement, utm_whop, tw_source, tw_adid. */ url_parameters?: Record; } export declare namespace CreateAdsRequest { /** The call-to-action button shown on the ad. */ const CallToAction: { readonly ApplyNow: "apply_now"; readonly BookNow: "book_now"; readonly CallNow: "call_now"; readonly ContactUs: "contact_us"; readonly DonateNow: "donate_now"; readonly Download: "download"; readonly GetDirections: "get_directions"; readonly GetOffer: "get_offer"; readonly GetQuote: "get_quote"; readonly LearnMore: "learn_more"; readonly ListenNow: "listen_now"; readonly MessagePage: "message_page"; readonly NoButton: "no_button"; readonly OpenLink: "open_link"; readonly OrderNow: "order_now"; readonly RequestTime: "request_time"; readonly SeeDetails: "see_details"; readonly SeeMenu: "see_menu"; readonly SeeMore: "see_more"; readonly SendUpdates: "send_updates"; readonly ShopNow: "shop_now"; readonly SignUp: "sign_up"; readonly Subscribe: "subscribe"; readonly VisitSite: "visit_site"; readonly WatchMore: "watch_more"; }; type CallToAction = (typeof CallToAction)[keyof typeof CallToAction]; type Creatives = Creatives.Item[]; namespace Creatives { interface Item { /** The saved crop window for this creative, in source image pixels. Omit it for the original asset or for a format that has not been cropped. */ crop?: Item.Crop | undefined; format?: Item.Format | undefined; /** Uploaded file ID, prefixed `file_`. */ id?: string | undefined; /** ISO 639 code of the language this image or video is shown for, such as `es`. Required on every entry of an ad with `translations`, where the ad's own creative uses `translations.source_language`. Another language's creative is the same type as the ad's own, with no format. Leave it out on an ad without translations. */ language?: string | undefined; } namespace Item { /** * The saved crop window for this creative, in source image pixels. Omit it for the original asset or for a format that has not been cropped. */ interface Crop { height?: number | undefined; width?: number | undefined; x?: number | undefined; y?: number | undefined; } const Format: { readonly Square: "square"; readonly Vertical: "vertical"; readonly Horizontal: "horizontal"; }; type Format = (typeof Format)[keyof typeof Format]; } } type Descriptions = Descriptions.Item[]; namespace Descriptions { interface Item { /** ISO 639 code of the language this text is in, such as `es`. Required on every entry of an ad with `translations`, where the ad's own copy uses `translations.source_language`. Leave it out on an ad without translations. */ language?: (string | null) | undefined; /** The text shown to viewers. */ text: string; } } type ExternalAccounts = ExternalAccounts.Item[]; namespace ExternalAccounts { interface Item { /** External account ID, prefixed `sacc_`. */ id?: string | undefined; } } type Headlines = Headlines.Item[]; namespace Headlines { interface Item { /** ISO 639 code of the language this text is in, such as `es`. Required on every entry of an ad with `translations`, where the ad's own copy uses `translations.source_language`. Leave it out on an ad without translations. */ language?: (string | null) | undefined; /** The text shown to viewers. */ text: string; } } /** * Instant lead form for the ad. Only allowed when the ad group's conversion_location is an instant-form destination (instant_forms, instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with lead_form_id. */ interface LeadForm { /** Optional completion screen shown after submission. Its button needs a destination: url for button_type website (the default), phone_number for call, file_url for download. */ completion?: LeadForm.Completion | undefined; /** Optional custom consent disclaimer with checkboxes. */ disclaimer?: LeadForm.Disclaimer | undefined; /** more_volume (default) is quickest to submit; higher_intent adds a confirmation step. */ form_type?: LeadForm.FormType | undefined; /** Optional intro screen shown before the questions. */ intro?: LeadForm.Intro | undefined; /** Internal name for the form. Auto-generated if omitted. */ name?: string | undefined; /** Require SMS verification of the phone number (higher_intent forms). */ phone_verification?: boolean | undefined; /** Your privacy policy. url is required by the ad platform. */ privacy_policy?: LeadForm.PrivacyPolicy | undefined; /** The questions on the form. Standard prefill types need only a type; a custom question needs a label and a format (plus options for multiple_choice). Options carry an optional key and answer-routing logic. */ questions?: LeadForm.Questions.Item[] | undefined; } namespace LeadForm { /** * Optional completion screen shown after submission. Its button needs a destination: url for button_type website (the default), phone_number for call, file_url for download. */ interface Completion { button_text?: string | undefined; button_type?: Completion.ButtonType | undefined; description?: string | undefined; file_url?: string | undefined; headline?: string | undefined; phone_number?: string | undefined; url?: string | undefined; } namespace Completion { const ButtonType: { readonly Website: "website"; readonly Call: "call"; readonly Download: "download"; }; type ButtonType = (typeof ButtonType)[keyof typeof ButtonType]; } /** * Optional custom consent disclaimer with checkboxes. */ interface Disclaimer { body?: string | undefined; checkboxes?: Disclaimer.Checkboxes.Item[] | undefined; title?: string | undefined; } namespace Disclaimer { type Checkboxes = Checkboxes.Item[]; namespace Checkboxes { interface Item { checked_by_default?: boolean | undefined; key?: string | undefined; required?: boolean | undefined; text?: string | undefined; } } } /** more_volume (default) is quickest to submit; higher_intent adds a confirmation step. */ const FormType: { readonly MoreVolume: "more_volume"; readonly HigherIntent: "higher_intent"; }; type FormType = (typeof FormType)[keyof typeof FormType]; /** * Optional intro screen shown before the questions. */ interface Intro { description?: string | undefined; headline?: string | undefined; } /** * Your privacy policy. url is required by the ad platform. */ interface PrivacyPolicy { link_text?: string | undefined; url?: string | undefined; } type Questions = Questions.Item[]; namespace Questions { interface Item { format?: Item.Format | undefined; label?: string | undefined; options?: Item.Options.Item[] | undefined; type?: Item.Type | undefined; } namespace Item { const Format: { readonly ShortAnswer: "short_answer"; readonly MultipleChoice: "multiple_choice"; readonly Appointment: "appointment"; }; type Format = (typeof Format)[keyof typeof Format]; type Options = Options.Item[]; namespace Options { interface Item { key?: string | undefined; logic?: Item.Logic | undefined; value?: string | undefined; } namespace Item { interface Logic { action?: Logic.Action | undefined; target_end_page_index?: number | undefined; target_question_index?: number | undefined; } namespace Logic { const Action: { readonly GoToQuestion: "go_to_question"; readonly SubmitForm: "submit_form"; readonly CloseForm: "close_form"; }; type Action = (typeof Action)[keyof typeof Action]; } } } const Type: { readonly Email: "email"; readonly Phone: "phone"; readonly FullName: "full_name"; readonly FirstName: "first_name"; readonly LastName: "last_name"; readonly City: "city"; readonly State: "state"; readonly Zip: "zip"; readonly Country: "country"; readonly StreetAddress: "street_address"; readonly JobTitle: "job_title"; readonly CompanyName: "company_name"; readonly WorkEmail: "work_email"; readonly WorkPhoneNumber: "work_phone_number"; readonly Dob: "dob"; readonly Gender: "gender"; readonly MaritalStatus: "marital_status"; readonly RelationshipStatus: "relationship_status"; readonly MilitaryStatus: "military_status"; readonly DateTime: "date_time"; readonly Custom: "custom"; }; type Type = (typeof Type)[keyof typeof Type]; } } } /** * Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt (keyword). */ interface MessagingConfig { keyword?: string | undefined; message?: string | undefined; } /** * The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. */ interface Music { /** Uploaded MP3 file ID, prefixed `file_`. */ id: string; } /** Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. */ const PostSource: { readonly Facebook: "facebook"; readonly Instagram: "instagram"; }; type PostSource = (typeof PostSource)[keyof typeof PostSource]; type PrimaryTexts = PrimaryTexts.Item[]; namespace PrimaryTexts { interface Item { /** ISO 639 code of the language this text is in, such as `es`. Required on every entry of an ad with `translations`, where the ad's own copy uses `translations.source_language`. Leave it out on an ad without translations. */ language?: (string | null) | undefined; /** The text shown to viewers. */ text: string; } } /** * Shows a Meta ad in other languages. Each viewer sees the version for their language; everyone else sees the ad's own copy. Tag every copy and creatives entry with its language: the ad's own with `source_language`, and give every other language a `primary_texts` and `headlines` entry (a `descriptions` entry and a `creatives` entry are optional), or list it in `automatic_languages`. Needs a website destination, one image or video, and exactly one primary text and headline of the ad's own (and at most one description), with no Dynamic Creative or crops. Replaced as a whole when sent, so send `automatic_languages` with `source_language`. null turns translations off and deletes their media. Meta-only. */ interface Translations { /** ISO 639 codes Meta translates the ad's own copy into automatically. English copy translates into `es`, `fr`, `de`, `pt`, `it`, `ar`, `nl`, `ms`, `sv`, `id`, `pl`, `hi`, `da`, `tr`, `fil`, and `ro`; `de`, `ar`, `he`, `es`, `ja`, `no`, `fr`, `nl`, and `sv` copy translate into `en`. */ automatic_languages?: string[] | undefined; /** ISO 639 code the ad's own copy is written in, such as `en`. */ source_language: string; } }