// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import * as DeliverablesAPI from './deliverables'; import { DeliverableAcceptParams, DeliverableAcceptResponse, DeliverableListResponse, DeliverableRejectParams, DeliverableRejectResponse, Deliverables, } from './deliverables'; import * as LeadsAPI from './leads'; import { LeadListResponse, LeadOverviewParams, LeadOverviewResponse, Leads } from './leads'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; export class Campaigns extends APIResource { deliverables: DeliverablesAPI.Deliverables = new DeliverablesAPI.Deliverables(this._client); leads: LeadsAPI.Leads = new LeadsAPI.Leads(this._client); /** * Create a new influencer marketing campaign with enhanced targeting criteria, * budget allocation, and product associations. Campaigns connect brands with * influencers to promote specific products. Required targeting fields include * languages (ISO 639-1 codes), interests, and keywords for precise audience * matching. * * @example * ```ts * const campaign = await client.campaigns.create({ * additionalRequests: * 'Please include our brand hashtag #SummerVibes and tag our official account @brandname. Focus on outdoor lifestyle shots and authentic product integration.', * ageRange: [18, 35], * autoApproveDeliverables: false, * budget: { amount: 500000, type: 'monthly' }, * country: ['US', 'CA', 'AF'], * gender: ['female', 'male'], * goal: 'sales', * interests: ['fitness', 'fashion', 'travel', 'technology'], * keywords: [ * 'summer', * 'vacation', * 'lifestyle', * 'authentic', * ], * languages: ['en', 'es', 'fr'], * name: 'Summer Product Launch Campaign', * platform: ['instagram', 'tiktok', 'youtube'], * productIds: [ * '123e4567-e89b-12d3-a456-426614174000', * '987fcdeb-51a2-43d1-9c87-654321098765', * ], * startDate: '2024-01-01T00:00:00Z', * type: 'custom', * }); * ``` */ create(body: CampaignCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/campaigns', { body, ...options }); } /** * Retrieve complete details for a specific campaign including targeting * information, associated products, performance metrics, and influencer * applications. * * @example * ```ts * const campaign = await client.campaigns.retrieve( * '123e4567-e89b-12d3-a456-426614174000', * ); * ``` */ retrieve( id: string, query: CampaignRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/campaigns/${id}`, { query, ...options }); } /** * Update campaign information including targeting criteria, budget, requirements, * and status. You can pause/unpause campaigns by setting status to * "inactive"/"active". Note: Pending approval campaigns cannot be activated, and * when campaigns are paused, all pending leads are automatically rejected. * * @example * ```ts * const campaign = await client.campaigns.update( * '123e4567-e89b-12d3-a456-426614174000', * ); * ``` */ update( id: string, body: CampaignUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.put(path`/campaigns/${id}`, { body, ...options }); } /** * Retrieve a paginated list of campaigns for the authenticated brand. Supports * filtering by date range and includes campaign performance metrics and status * information. * * @example * ```ts * const campaigns = await client.campaigns.list(); * ``` */ list( query: CampaignListParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get('/campaigns', { query, ...options }); } /** * Delete a campaign permanently. Campaigns with active influencer applications * cannot be deleted. This action cannot be undone and will refund any unused * budget. * * @example * ```ts * const campaign = await client.campaigns.delete( * '123e4567-e89b-12d3-a456-426614174000', * ); * ``` */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/campaigns/${id}`, options); } /** * Cancel an active campaign. This will stop accepting new influencer applications * and refund unused budget. Existing approved applications will be honored. * * @example * ```ts * const response = await client.campaigns.cancel( * '123e4567-e89b-12d3-a456-426614174000', * ); * ``` */ cancel(id: string, options?: RequestOptions): APIPromise { return this._client.post(path`/campaigns/${id}/cancel`, options); } /** * Retrieve all products associated with a specific campaign. This includes product * details, pricing, and marketing guidelines that influencers will use for content * creation. * * @example * ```ts * const response = await client.campaigns.retrieveProducts( * '123e4567-e89b-12d3-a456-426614174000', * ); * ``` */ retrieveProducts(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/campaigns/${id}/products`, options); } /** * Toggle campaign status between active and inactive. Only campaigns with 'active' * or 'inactive' status can be toggled. This endpoint allows brands to pause/resume * their campaigns. * * @example * ```ts * const response = await client.campaigns.toggle( * '123e4567-e89b-12d3-a456-426614174000', * ); * ``` */ toggle( id: string, body?: CampaignToggleParams | null | undefined, options?: RequestOptions, ): APIPromise { return this._client.post(path`/campaigns/${id}/toggle`, { body, ...options }); } } /** * Response schema for creating a new campaign */ export interface CampaignCreateResponse { /** * Unique identifier for the campaign */ id: string; /** * Additional requirements for influencers */ additionalRequests: string; /** * Whether deliverables are automatically approved */ autoApproveDeliverables: boolean; /** * Unique identifier of the brand that owns the campaign */ brandId: string; /** * Campaign budget configuration */ budget: CampaignCreateResponse.Budget; /** * ISO 8601 timestamp of when the campaign was created */ createdAt: string; /** * Unique identifier of the user who created the campaign */ createdBy: string; /** * Campaign deadline (ISO 8601 format) */ deadline: string | null; /** * Campaign description */ description: string | null; /** * Campaign goal */ goal: string; /** * Growth period for selecting an influencer */ growthPeriod: 'day' | 'week' | 'month' | 'year'; /** * URLs of similar content or competitors for reference */ lookALikeUrls: Array; /** * Campaign name */ name: string; /** * Products associated with the campaign */ productIds: Array; /** * Reference URLs for inspiration */ referenceUrls: Array; /** * Current campaign status */ status: string; /** * Campaign targeting configuration with enhanced targeting options */ targeting: CampaignCreateResponse.Targeting; /** * Campaign type */ type: string; /** * ISO 8601 timestamp of when the campaign was last updated */ updatedAt: string; /** * Average views per post range [from, to] */ avgViews?: Array; /** * Average engagement rate per post */ engagementRate?: number; /** * Follower count range for influencer targeting [from, to] */ followerSegmentation?: Array; /** * Average growth rate per post */ growthRate?: number; } export namespace CampaignCreateResponse { /** * Campaign budget configuration */ export interface Budget { /** * Budget amount in smallest currency unit (e.g., cents) */ amount: number; /** * Budget type: monthly or lifetime */ type: string; /** * Whether the budget renews automatically (monthly budgets only) */ renewAutomatically?: boolean; } /** * Campaign targeting configuration with enhanced targeting options */ export interface Targeting { /** * Target age range [min, max] */ ageRange: Array; /** * Target countries (ISO 3166-1 alpha-2 codes) */ country: Array; /** * Target gender demographics */ gender: Array; /** * Target interests for audience */ interests: Array; /** * Target keywords for content creation */ keywords: Array; /** * Target languages (ISO 639-1 codes) */ languages: Array; /** * Target social media platforms */ platform: Array; } } /** * Response schema for retrieving a single campaign's complete details */ export interface CampaignRetrieveResponse { /** * Unique identifier for the campaign */ id: string; /** * Additional requirements for influencers */ additionalRequests: string; /** * Target age range [min, max] */ ageRange: Array; /** * Whether deliverables are automatically approved */ autoApproveDeliverables: boolean; /** * Unique identifier of the brand that owns the campaign */ brandId: string; /** * Campaign budget configuration */ budget: CampaignRetrieveResponse.Budget; /** * Target countries (ISO 3166-1 alpha-2 codes) */ country: Array; /** * ISO 8601 timestamp of when the campaign was created */ createdAt: string; /** * Unique identifier of the user who created the campaign */ createdBy: string; /** * Campaign deadline */ deadline: string; /** * Campaign end date */ endDate: string | null; /** * Follower count range for influencer targeting [from, to] */ followerSegmentation: Array | null; /** * Target gender demographics */ gender: Array; /** * Campaign goal */ goal: string; /** * URLs of similar content or competitors for reference */ lookALikeUrls: Array; /** * Campaign metrics data */ metrics: CampaignRetrieveResponse.Metrics; /** * Campaign name */ name: string; /** * Target social media platforms */ platform: Array; /** * Products associated with the campaign */ productIds: Array; /** * Reference URLs for inspiration */ referenceUrls: Array; /** * Campaign start date */ startDate: string; /** * Current campaign status */ status: string; /** * Total number of leads accepted */ totalLeadsAccepted: number; /** * Total number of leads invited */ totalLeadsInvited: number; /** * Total number of leads rejected */ totalLeadsRejected: number; /** * Campaign type */ type: string; } export namespace CampaignRetrieveResponse { /** * Campaign budget configuration */ export interface Budget { /** * Budget amount in smallest currency unit (e.g., cents) */ amount: number; /** * Whether the budget renews automatically (monthly budgets only) */ renewAutomatically: boolean; /** * Budget type: monthly or lifetime */ type: string; } /** * Campaign metrics data */ export interface Metrics { /** * Whether the campaign has expired */ isExpired: boolean; /** * Campaign performance metrics */ performance: Metrics.Performance; /** * Campaign targeting metrics */ targeting: Metrics.Targeting; } export namespace Metrics { /** * Campaign performance metrics */ export interface Performance { /** * Total clicks */ clicks: number; /** * Cost per thousand impressions */ cpm: number | null; /** * Total spend */ spend: number; /** * Total views */ views: number; /** * Campaign engagement rate */ engagementRate?: number; } /** * Campaign targeting metrics */ export interface Targeting { /** * Target age range [min, max] */ ageRange: Array; /** * Number of target countries */ countryCount: number; /** * Number of target genders */ genderCount: number; /** * Number of target platforms */ platformCount: number; } } } /** * Response schema for updating a campaign */ export interface CampaignUpdateResponse { /** * Unique identifier for the campaign */ id: string; /** * Additional requirements for influencers */ additionalRequests: string; /** * Whether deliverables are automatically approved */ autoApproveDeliverables: boolean; /** * Unique identifier of the brand that owns the campaign */ brandId: string; /** * Campaign budget configuration */ budget: CampaignUpdateResponse.Budget; /** * ISO 8601 timestamp of when the campaign was created */ createdAt: string; /** * Unique identifier of the user who created the campaign */ createdBy: string; /** * Campaign deadline (ISO 8601 format) */ deadline: string | null; /** * Campaign description */ description: string | null; /** * Campaign goal */ goal: string; /** * Growth period for selecting an influencer */ growthPeriod: 'day' | 'week' | 'month' | 'year'; /** * URLs of similar content or competitors for reference */ lookALikeUrls: Array; /** * Campaign name */ name: string; /** * Products associated with the campaign */ productIds: Array; /** * Reference URLs for inspiration */ referenceUrls: Array; /** * Current campaign status */ status: string; /** * Campaign targeting configuration with enhanced targeting options */ targeting: CampaignUpdateResponse.Targeting; /** * Campaign type */ type: string; /** * ISO 8601 timestamp of when the campaign was last updated */ updatedAt: string; /** * Average views per post range [from, to] */ avgViews?: Array; /** * Average engagement rate per post */ engagementRate?: number; /** * Follower count range for influencer targeting [from, to] */ followerSegmentation?: Array; /** * Average growth rate per post */ growthRate?: number; } export namespace CampaignUpdateResponse { /** * Campaign budget configuration */ export interface Budget { /** * Budget amount in smallest currency unit (e.g., cents) */ amount: number; /** * Budget type: monthly or lifetime */ type: string; /** * Whether the budget renews automatically (monthly budgets only) */ renewAutomatically?: boolean; } /** * Campaign targeting configuration with enhanced targeting options */ export interface Targeting { /** * Target age range [min, max] */ ageRange: Array; /** * Target countries (ISO 3166-1 alpha-2 codes) */ country: Array; /** * Target gender demographics */ gender: Array; /** * Target interests for audience */ interests: Array; /** * Target keywords for content creation */ keywords: Array; /** * Target languages (ISO 639-1 codes) */ languages: Array; /** * Target social media platforms */ platform: Array; } } /** * Response schema for retrieving a list of campaigns with pagination and filters */ export type CampaignListResponse = Array; export namespace CampaignListResponse { /** * Summarized campaign information for list views */ export interface CampaignListResponseItem { /** * Unique identifier for the campaign */ id: string; /** * Additional requirements for influencers */ additionalRequests: string; /** * Whether deliverables are automatically approved */ autoApproveDeliverables: boolean; /** * Unique identifier of the brand that owns the campaign */ brandId: string; /** * Campaign budget configuration */ budget: CampaignListResponseItem.Budget; /** * ISO 8601 timestamp of when the campaign was created */ createdAt: string; /** * Unique identifier of the user who created the campaign */ createdBy: string; /** * Campaign deadline (ISO 8601 format) */ deadline: string | null; /** * Campaign description */ description: string | null; /** * Follower count range for influencer targeting [from, to] */ followerSegmentation: Array | null; /** * Campaign goal */ goal: string; /** * URLs of similar content or competitors for reference */ lookALikeUrls: Array; /** * Campaign name */ name: string; /** * Campaign performance metrics */ performance: CampaignListResponseItem.Performance; /** * Products associated with the campaign */ productIds: Array; /** * Reference URLs for inspiration */ referenceUrls: Array; /** * Current campaign status */ status: string; /** * Campaign targeting configuration with enhanced targeting options */ targeting: CampaignListResponseItem.Targeting; /** * Campaign type */ type: string; /** * ISO 8601 timestamp of when the campaign was last updated */ updatedAt: string; /** * Average views per post range [from, to] */ avgViews?: Array; /** * Average engagement rate per post */ engagementRate?: number; /** * Growth period for selecting an influencer */ growthPeriod?: 'day' | 'week' | 'month' | 'year'; /** * Average growth rate per post */ growthRate?: number; } export namespace CampaignListResponseItem { /** * Campaign budget configuration */ export interface Budget { /** * Budget amount in smallest currency unit (e.g., cents) */ amount: number; /** * Whether the budget renews automatically (monthly budgets only) */ renewAutomatically: boolean; /** * Budget type: monthly or lifetime */ type: string; } /** * Campaign performance metrics */ export interface Performance { /** * Total clicks */ clicks: number; /** * Cost per thousand impressions */ cpm: number | null; /** * Total spend */ spend: number; /** * Total views */ views: number; } /** * Campaign targeting configuration with enhanced targeting options */ export interface Targeting { /** * Target age range [min, max] */ ageRange: Array; /** * Target countries (ISO 3166-1 alpha-2 codes) */ country: Array; /** * Target gender demographics */ gender: Array; /** * Target interests for audience */ interests: Array; /** * Target keywords for content creation */ keywords: Array; /** * Target languages (ISO 639-1 codes) */ languages: Array; /** * Target social media platforms */ platform: Array; } } } /** * Response schema for deleting a campaign */ export interface CampaignDeleteResponse { /** * Unique identifier of the deleted campaign */ id: string; /** * Confirmation message */ message: string; } /** * Response schema for cancelling a campaign */ export interface CampaignCancelResponse { /** * Unique identifier of the cancelled campaign */ id: string; /** * ISO 8601 timestamp of when the campaign was cancelled */ cancelledAt: string; /** * Confirmation message */ message: string; /** * Updated campaign status */ status: string; } /** * Response schema for retrieving products associated with a campaign */ export type CampaignRetrieveProductsResponse = Array; export namespace CampaignRetrieveProductsResponse { /** * Complete product information including details, guidelines, and associated * assets */ export interface CampaignRetrieveProductsResponseItem { /** * Unique identifier for the product */ id: string; /** * List of assets associated with the product */ assets: Array; /** * Unique identifier of the brand that owns the product */ brandId: string; /** * The call-to-action text for the product */ callToAction: string; /** * ISO 8601 timestamp of when the product was created */ createdAt: string; /** * A detailed description of the product */ description: string; /** * Key phrases that must be included in influencer content */ mandatoryPhrases: Array; /** * The name of the product */ name: string; /** * ISO 8601 timestamp of when the product was last updated */ updatedAt: string; /** * The URL where customers can purchase or learn more about the product */ url: string; /** * Guidelines for what influencers should NOT say about the product */ whatNotToSay: string; /** * Guidelines for what influencers should say about the product */ whatToSay: string; } } /** * Response schema for campaign status toggle */ export interface CampaignToggleResponse { /** * Campaign status toggle result data */ data: CampaignToggleResponse.Data; /** * Success message describing the action performed */ message: string; /** * Indicates if the toggle operation was successful */ success: boolean; } export namespace CampaignToggleResponse { /** * Campaign status toggle result data */ export interface Data { /** * UUID of the campaign */ id: string; /** * Previous campaign status before toggle */ previousStatus: 'active' | 'inactive'; /** * Current campaign status after toggle */ status: 'active' | 'inactive'; /** * ISO 8601 timestamp of when the status was updated */ updatedAt: string; } } export interface CampaignCreateParams { /** * Additional specific requirements or requests for influencers. Maximum 1200 * characters. */ additionalRequests: string; /** * Target age range for the campaign audience. Array of two numbers [min, max] * where min >= 13 and max <= 100. */ ageRange: Array; /** * Whether to automatically approve deliverables that meet the campaign * requirements. */ autoApproveDeliverables: boolean; /** * Campaign budget configuration with type and amount. Monthly budgets can renew * automatically, lifetime budgets have a fixed total. */ budget: CampaignCreateParams.Budget; /** * Target countries for the campaign. Must include at least one country. */ country: Array< | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' >; /** * Target gender demographics for the campaign. Must include at least one option. */ gender: Array<'male' | 'female'>; /** * The primary goal of the campaign. */ goal: 'sales' | 'awareness' | 'engagement'; /** * Target interests for the campaign audience. Array of interest keywords. Must * include at least 1 interest, maximum 20 interests, each up to 50 characters. */ interests: Array; /** * Target keywords for content creation. Array of keywords that influencers should * focus on. Must include at least 1 keyword, maximum 30 keywords, each up to 50 * characters. */ keywords: Array; /** * Target languages for the campaign audience (ISO 639-1 codes). Must include at * least one language. */ languages: Array< | 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'ja' | 'ko' | 'zh' | 'ar' | 'hi' | 'nl' | 'sv' | 'no' | 'da' | 'fi' | 'pl' | 'tr' | 'th' | 'vi' | 'id' | 'ms' | 'tl' | 'he' | 'cs' | 'hu' | 'ro' | 'bg' | 'hr' | 'sk' | 'sl' | 'et' | 'lv' | 'lt' | 'uk' | 'el' | 'ca' | 'eu' | 'gl' | 'mt' | 'is' | 'ga' | 'cy' | 'af' | 'sw' | 'zu' | 'xh' | 'am' | 'bn' | 'ta' | 'te' | 'ml' | 'kn' | 'gu' | 'pa' | 'ur' | 'ne' | 'si' | 'my' | 'km' | 'lo' | 'ka' | 'hy' | 'az' | 'kk' | 'ky' | 'uz' | 'mn' | 'fa' >; /** * The name of the campaign. Must be between 2 and 255 characters. */ name: string; /** * Target social media platforms for the campaign. Must include at least one * platform. */ platform: Array<'facebook' | 'instagram' | 'twitter' | 'tiktok' | 'youtube'>; /** * Array of product IDs to be included in the campaign. Must include at least one * product. */ productIds: Array; /** * The start date for the campaign. Required for all campaigns. */ startDate: string; /** * The type of campaign being created. */ type: 'custom' | 'advantage'; /** * Average views per post range [from, to] */ avgViews?: Array; /** * The deadline for campaign completion. Must be a valid date in the future. */ deadline?: string; /** * A detailed description of the campaign objectives and requirements. Must be * between 10 and 5000 characters. */ description?: string; /** * The end date for the campaign. Required for lifetime budgets, optional for * monthly budgets (Always On if not provided). */ endDate?: string; /** * Average engagement rate per post */ engagementRate?: number; /** * Follower count range for influencer targeting [from, to] */ followerSegmentation?: Array; /** * Growth period for selecting an influencer */ growthPeriod?: 'day' | 'week' | 'month' | 'year'; /** * Average growth rate per post */ growthRate?: number; /** * URLs of similar content or competitors for reference. Maximum 10 URLs. */ lookALikeUrls?: Array; /** * Reference URLs for inspiration or examples. Maximum 10 URLs. */ referenceUrls?: Array; } export namespace CampaignCreateParams { /** * Campaign budget configuration with type and amount. Monthly budgets can renew * automatically, lifetime budgets have a fixed total. */ export interface Budget { /** * The budget amount in the smallest currency unit (e.g., cents). Must be at least * 500 USD. */ amount: number; /** * The type of budget: 'monthly' for recurring monthly budget or 'lifetime' for * total campaign budget. */ type: 'monthly' | 'lifetime'; /** * Whether the budget should automatically renew. Only applicable for monthly * budgets with no endDate. */ renewAutomatically?: boolean; } } export interface CampaignRetrieveParams { /** * The end date for filtering campaigns. Must be a valid date and after the start * date. */ endDate?: string; /** * The start date for filtering campaigns. Must be a valid date. */ startDate?: string; } export interface CampaignUpdateParams { /** * Updated additional specific requirements or requests for influencers. Maximum * 1200 characters. */ additionalRequests?: string; /** * Updated target age range for the campaign audience. Array of two numbers [min, * max] where min >= 13 and max <= 100. */ ageRange?: Array; /** * Updated setting for whether to automatically approve deliverables that meet the * campaign requirements. */ autoApproveDeliverables?: boolean; /** * Average views per post range [from, to] */ avgViews?: Array; /** * Updated campaign budget configuration with type and amount. Monthly budgets can * renew automatically, lifetime budgets have a fixed total. */ budget?: CampaignUpdateParams.Budget; /** * Updated target countries for the campaign. Must include at least one country if * provided. */ country?: Array< | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' >; /** * The updated deadline for campaign completion. Must be a valid date in the * future. */ deadline?: string; /** * The updated description of the campaign objectives and requirements. Must be * between 10 and 5000 characters. */ description?: string; /** * The updated end date for the campaign. Required for lifetime budgets, optional * for monthly budgets (Always On if not provided). */ endDate?: string; /** * Average engagement rate per post */ engagementRate?: number; /** * Follower count range for influencer targeting [from, to] */ followerSegmentation?: Array; /** * Updated target gender demographics for the campaign. Must include at least one * option if provided. */ gender?: Array<'male' | 'female'>; /** * The updated primary goal of the campaign. */ goal?: 'sales' | 'awareness' | 'engagement'; /** * Growth period for selecting an influencer */ growthPeriod?: 'day' | 'week' | 'month' | 'year'; /** * Average growth rate per post */ growthRate?: number; /** * Updated target interests for the campaign audience. Array of interest keywords. * If provided, must include at least 1 interest, maximum 20 interests, each up to * 50 characters. */ interests?: Array; /** * Updated target keywords for content creation. Array of keywords that influencers * should focus on. If provided, must include at least 1 keyword, maximum 30 * keywords, each up to 50 characters. */ keywords?: Array; /** * Updated target languages for the campaign audience (ISO 639-1 codes). If * provided, must include at least one language. */ languages?: Array< | 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'ja' | 'ko' | 'zh' | 'ar' | 'hi' | 'nl' | 'sv' | 'no' | 'da' | 'fi' | 'pl' | 'tr' | 'th' | 'vi' | 'id' | 'ms' | 'tl' | 'he' | 'cs' | 'hu' | 'ro' | 'bg' | 'hr' | 'sk' | 'sl' | 'et' | 'lv' | 'lt' | 'uk' | 'el' | 'ca' | 'eu' | 'gl' | 'mt' | 'is' | 'ga' | 'cy' | 'af' | 'sw' | 'zu' | 'xh' | 'am' | 'bn' | 'ta' | 'te' | 'ml' | 'kn' | 'gu' | 'pa' | 'ur' | 'ne' | 'si' | 'my' | 'km' | 'lo' | 'ka' | 'hy' | 'az' | 'kk' | 'ky' | 'uz' | 'mn' | 'fa' >; /** * Updated URLs of similar content or competitors for reference. Maximum 10 URLs. */ lookALikeUrls?: Array; /** * The updated name of the campaign. Must be between 2 and 255 characters. */ name?: string; /** * Updated target social media platforms for the campaign. Must include at least * one platform if provided. */ platform?: Array<'facebook' | 'instagram' | 'twitter' | 'tiktok' | 'youtube'>; /** * Updated array of product IDs to be included in the campaign. Must include at * least one product if provided. */ productIds?: Array; /** * Updated reference URLs for inspiration or examples. Maximum 10 URLs. */ referenceUrls?: Array; /** * The updated start date for the campaign. */ startDate?: string; /** * The updated status of the campaign. Use 'active' to unpause or 'inactive' to * pause the campaign. */ status?: 'active' | 'inactive'; /** * The updated type of campaign. */ type?: 'custom' | 'advantage'; } export namespace CampaignUpdateParams { /** * Updated campaign budget configuration with type and amount. Monthly budgets can * renew automatically, lifetime budgets have a fixed total. */ export interface Budget { /** * The updated budget amount in the smallest currency unit (e.g., cents). Must be * at least 500 USD. */ amount: number; /** * The updated type of budget: 'monthly' for recurring monthly budget or 'lifetime' * for total campaign budget. */ type: 'monthly' | 'lifetime'; /** * Whether the budget should automatically renew. Only applicable for monthly * budgets with no endDate. */ renewAutomatically?: boolean; } } export interface CampaignListParams { /** * The end date for filtering campaigns. Must be a valid date and after the start * date. */ endDate?: string; /** * The start date for filtering campaigns. Must be a valid date. */ startDate?: string; } export interface CampaignToggleParams {} Campaigns.Deliverables = Deliverables; Campaigns.Leads = Leads; export declare namespace Campaigns { export { type CampaignCreateResponse as CampaignCreateResponse, type CampaignRetrieveResponse as CampaignRetrieveResponse, type CampaignUpdateResponse as CampaignUpdateResponse, type CampaignListResponse as CampaignListResponse, type CampaignDeleteResponse as CampaignDeleteResponse, type CampaignCancelResponse as CampaignCancelResponse, type CampaignRetrieveProductsResponse as CampaignRetrieveProductsResponse, type CampaignToggleResponse as CampaignToggleResponse, type CampaignCreateParams as CampaignCreateParams, type CampaignRetrieveParams as CampaignRetrieveParams, type CampaignUpdateParams as CampaignUpdateParams, type CampaignListParams as CampaignListParams, type CampaignToggleParams as CampaignToggleParams, }; export { Deliverables as Deliverables, type DeliverableListResponse as DeliverableListResponse, type DeliverableAcceptResponse as DeliverableAcceptResponse, type DeliverableRejectResponse as DeliverableRejectResponse, type DeliverableAcceptParams as DeliverableAcceptParams, type DeliverableRejectParams as DeliverableRejectParams, }; export { Leads as Leads, type LeadListResponse as LeadListResponse, type LeadOverviewResponse as LeadOverviewResponse, type LeadOverviewParams as LeadOverviewParams, }; }