@zernio/node 0.2.1517 → 0.2.1519
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/index.d.mts +1967 -107
- package/dist/index.d.ts +1967 -107
- package/dist/index.js +223 -1
- package/dist/index.mjs +223 -1
- package/package.json +1 -1
- package/src/client.ts +68 -0
- package/src/generated/sdk.gen.ts +437 -2
- package/src/generated/types.gen.ts +2092 -109
|
@@ -2064,6 +2064,63 @@ export type status3 = 'done' | 'skipped' | 'failed';
|
|
|
2064
2064
|
*/
|
|
2065
2065
|
export type targetMetric = 'cpa' | 'roas';
|
|
2066
2066
|
|
|
2067
|
+
/**
|
|
2068
|
+
* One check of an ad rule.
|
|
2069
|
+
*/
|
|
2070
|
+
export type AdRuleAutomationCheck = {
|
|
2071
|
+
id: string;
|
|
2072
|
+
automationId: string;
|
|
2073
|
+
checkedAt: string;
|
|
2074
|
+
outcome: 'triggered' | 'cooldown' | 'no_match' | 'failed';
|
|
2075
|
+
/**
|
|
2076
|
+
* Objects judged.
|
|
2077
|
+
*/
|
|
2078
|
+
evaluated: number;
|
|
2079
|
+
subjects: Array<{
|
|
2080
|
+
subject?: {
|
|
2081
|
+
id?: string;
|
|
2082
|
+
name?: string;
|
|
2083
|
+
campaignId?: (string) | null;
|
|
2084
|
+
};
|
|
2085
|
+
matched?: boolean;
|
|
2086
|
+
conditions?: Array<{
|
|
2087
|
+
[key: string]: unknown;
|
|
2088
|
+
}>;
|
|
2089
|
+
}>;
|
|
2090
|
+
actions: Array<(AutomationActionResult & {
|
|
2091
|
+
subjectId?: string;
|
|
2092
|
+
})>;
|
|
2093
|
+
notification: {
|
|
2094
|
+
status?: 'done' | 'failed';
|
|
2095
|
+
reason?: string;
|
|
2096
|
+
} | null;
|
|
2097
|
+
error: (string) | null;
|
|
2098
|
+
};
|
|
2099
|
+
|
|
2100
|
+
export type outcome = 'triggered' | 'cooldown' | 'no_match' | 'failed';
|
|
2101
|
+
|
|
2102
|
+
export type status4 = 'done' | 'failed';
|
|
2103
|
+
|
|
2104
|
+
/**
|
|
2105
|
+
* An ad rule. It is also readable under `/v1/ads/rules` with the same id. Unknown fields are refused.
|
|
2106
|
+
*
|
|
2107
|
+
* To have a person OK each change before it is made, put an `approval.request` step before the `ads.*` step.
|
|
2108
|
+
*
|
|
2109
|
+
*/
|
|
2110
|
+
export type AdRuleAutomationDefinition = {
|
|
2111
|
+
name: string;
|
|
2112
|
+
/**
|
|
2113
|
+
* A new ad rule stays paused unless `active`.
|
|
2114
|
+
*/
|
|
2115
|
+
status?: 'active' | 'paused';
|
|
2116
|
+
trigger: AutomationScheduleTrigger;
|
|
2117
|
+
subjects: AutomationSubjects;
|
|
2118
|
+
conditions: AdRuleConditions;
|
|
2119
|
+
alert?: AutomationAlert;
|
|
2120
|
+
steps: Array<AutomationStep>;
|
|
2121
|
+
limits?: AutomationLimits;
|
|
2122
|
+
};
|
|
2123
|
+
|
|
2067
2124
|
export type AdRuleCondition = {
|
|
2068
2125
|
/**
|
|
2069
2126
|
* `ctr` is a percentage. `spend`, `cpc`, `cpm` and `cpa` are in the ad account currency. `reach` and `frequency` use the platform's de-duplicated reach, so they are accepted on Meta and TikTok only.
|
|
@@ -2322,19 +2379,6 @@ export type AdRuleRun = {
|
|
|
2322
2379
|
error: (string) | null;
|
|
2323
2380
|
};
|
|
2324
2381
|
|
|
2325
|
-
/**
|
|
2326
|
-
* Result of the rule run:
|
|
2327
|
-
*
|
|
2328
|
-
* - `triggered`: the rule acted on at least one object (`error` is set if the webhook could not be sent afterwards).
|
|
2329
|
-
* - `cooldown`: objects matched but all were in cooldown.
|
|
2330
|
-
* - `no_match`: nothing matched.
|
|
2331
|
-
* - `failed`: the metrics could not be read, every action failed, or the webhook of a notify-only rule could not be sent (see `error`).
|
|
2332
|
-
*
|
|
2333
|
-
*/
|
|
2334
|
-
export type outcome = 'triggered' | 'cooldown' | 'no_match' | 'failed';
|
|
2335
|
-
|
|
2336
|
-
export type status4 = 'done' | 'failed';
|
|
2337
|
-
|
|
2338
2382
|
/**
|
|
2339
2383
|
* Either `everyMinutes` or `times`. Sending a schedule replaces the rule's whole timing. Without one, a new rule runs every 60 minutes.
|
|
2340
2384
|
*/
|
|
@@ -3543,6 +3587,1115 @@ export type scope = 'full' | 'profiles';
|
|
|
3543
3587
|
*/
|
|
3544
3588
|
export type permission = 'read-write' | 'read';
|
|
3545
3589
|
|
|
3590
|
+
export type Automation = (AdRuleAutomationDefinition & AutomationRecord & {
|
|
3591
|
+
kind?: "ad_rule";
|
|
3592
|
+
}) | (EventAutomationDefinition & AutomationRecord & {
|
|
3593
|
+
kind?: "event";
|
|
3594
|
+
}) | (ScheduledAutomationDefinition & AutomationRecord & {
|
|
3595
|
+
kind?: "scheduled";
|
|
3596
|
+
});
|
|
3597
|
+
|
|
3598
|
+
export type AutomationAction = AutomationActionResult & {
|
|
3599
|
+
id: string;
|
|
3600
|
+
automationId: string;
|
|
3601
|
+
automationName: string;
|
|
3602
|
+
checkId: string;
|
|
3603
|
+
subject: {
|
|
3604
|
+
kind?: 'campaign' | 'adset' | 'ad';
|
|
3605
|
+
id?: string;
|
|
3606
|
+
name?: (string) | null;
|
|
3607
|
+
};
|
|
3608
|
+
platform: string;
|
|
3609
|
+
adAccount: {
|
|
3610
|
+
accountId?: string;
|
|
3611
|
+
adAccountId?: string;
|
|
3612
|
+
};
|
|
3613
|
+
currency: (string) | null;
|
|
3614
|
+
createdAt: string;
|
|
3615
|
+
};
|
|
3616
|
+
|
|
3617
|
+
export type kind2 = 'campaign' | 'adset' | 'ad';
|
|
3618
|
+
|
|
3619
|
+
/**
|
|
3620
|
+
* What an ad rule did to one object, as an absolute change: a budget change reads as the budget it set.
|
|
3621
|
+
*/
|
|
3622
|
+
export type AutomationActionResult = {
|
|
3623
|
+
/**
|
|
3624
|
+
* The id of the step that made it, for example `budget`.
|
|
3625
|
+
*/
|
|
3626
|
+
step: string;
|
|
3627
|
+
type: 'ads.pause' | 'ads.activate' | 'ads.set_budget' | 'ads.duplicate' | 'ads.edit_name' | 'ads.set_bid' | 'ads.set_target' | 'ads.reallocate_budget';
|
|
3628
|
+
status: 'applied' | 'skipped' | 'failed';
|
|
3629
|
+
/**
|
|
3630
|
+
* Why it was skipped or failed, such as `already_paused`, `daily_limit_reached` or `awaiting_approval`.
|
|
3631
|
+
*/
|
|
3632
|
+
reason: (string) | null;
|
|
3633
|
+
previous: AutomationChangedValue;
|
|
3634
|
+
target: AutomationChangedValue;
|
|
3635
|
+
};
|
|
3636
|
+
|
|
3637
|
+
export type type5 = 'ads.pause' | 'ads.activate' | 'ads.set_budget' | 'ads.duplicate' | 'ads.edit_name' | 'ads.set_bid' | 'ads.set_target' | 'ads.reallocate_budget';
|
|
3638
|
+
|
|
3639
|
+
export type status6 = 'applied' | 'skipped' | 'failed';
|
|
3640
|
+
|
|
3641
|
+
export type AutomationAdAccountControls = {
|
|
3642
|
+
/**
|
|
3643
|
+
* The connection your automations reach the ad account through; null when no automation uses it any more.
|
|
3644
|
+
*/
|
|
3645
|
+
accountId: (string) | null;
|
|
3646
|
+
/**
|
|
3647
|
+
* The ad platform, for example `facebook`.
|
|
3648
|
+
*/
|
|
3649
|
+
platform: string;
|
|
3650
|
+
/**
|
|
3651
|
+
* The platform's ad account id.
|
|
3652
|
+
*/
|
|
3653
|
+
adAccountId: string;
|
|
3654
|
+
/**
|
|
3655
|
+
* True when every ad rule on this ad account is stopped.
|
|
3656
|
+
*/
|
|
3657
|
+
paused: boolean;
|
|
3658
|
+
pausedAt: (string) | null;
|
|
3659
|
+
/**
|
|
3660
|
+
* The most automations may raise budgets on this ad account in any 24 hours, in the ad account's currency. Null when there is no limit.
|
|
3661
|
+
*/
|
|
3662
|
+
dailyRaiseLimit: (number) | null;
|
|
3663
|
+
};
|
|
3664
|
+
|
|
3665
|
+
/**
|
|
3666
|
+
* Narrows the ad objects checked, before any metric is read. `GET /v1/automations/catalog` lists the fields each subject accepts.
|
|
3667
|
+
*
|
|
3668
|
+
*/
|
|
3669
|
+
export type AutomationAdFilter = {
|
|
3670
|
+
field: 'name' | 'campaign_name' | 'adset_name' | 'goal';
|
|
3671
|
+
op: 'contains' | 'not_contains' | 'equals' | 'not_equals' | 'starts_with';
|
|
3672
|
+
value: string;
|
|
3673
|
+
} | {
|
|
3674
|
+
field: 'campaign_id' | 'adset_id' | 'ad_id';
|
|
3675
|
+
op: 'in' | 'not_in';
|
|
3676
|
+
values: Array<(string)>;
|
|
3677
|
+
} | {
|
|
3678
|
+
field: "days_live";
|
|
3679
|
+
op: '>=' | '<';
|
|
3680
|
+
value: number;
|
|
3681
|
+
} | {
|
|
3682
|
+
field: "budget_level";
|
|
3683
|
+
op: "equals";
|
|
3684
|
+
value: 'campaign' | 'adset';
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
export type field = 'name' | 'campaign_name' | 'adset_name' | 'goal';
|
|
3688
|
+
|
|
3689
|
+
export type op2 = 'contains' | 'not_contains' | 'equals' | 'not_equals' | 'starts_with';
|
|
3690
|
+
|
|
3691
|
+
export type value = 'campaign' | 'adset';
|
|
3692
|
+
|
|
3693
|
+
/**
|
|
3694
|
+
* Turns matches into alerts: the ad rule acts only after `confirmChecks` matching checks in a row, keeps the alert open while `hold` holds and marks it critical when `critical` holds.
|
|
3695
|
+
*/
|
|
3696
|
+
export type AutomationAlert = {
|
|
3697
|
+
confirmChecks?: number;
|
|
3698
|
+
hold?: AdRuleConditions;
|
|
3699
|
+
critical?: AdRuleConditions;
|
|
3700
|
+
};
|
|
3701
|
+
|
|
3702
|
+
/**
|
|
3703
|
+
* A request an automation sent for a person's approval before acting, with each change it holds.
|
|
3704
|
+
*/
|
|
3705
|
+
export type AutomationApproval = {
|
|
3706
|
+
id: string;
|
|
3707
|
+
automationId: string;
|
|
3708
|
+
/**
|
|
3709
|
+
* The check that found the matches and sent the request.
|
|
3710
|
+
*/
|
|
3711
|
+
checkId: string;
|
|
3712
|
+
/**
|
|
3713
|
+
* `cancelled` when the automation stopped asking for approval before anyone decided.
|
|
3714
|
+
*/
|
|
3715
|
+
status: 'pending' | 'approved' | 'rejected' | 'expired' | 'cancelled';
|
|
3716
|
+
/**
|
|
3717
|
+
* The emails the request was sent to.
|
|
3718
|
+
*/
|
|
3719
|
+
to: Array<(string)>;
|
|
3720
|
+
/**
|
|
3721
|
+
* After this the request can no longer be decided and its changes are skipped.
|
|
3722
|
+
*/
|
|
3723
|
+
expiresAt: string;
|
|
3724
|
+
createdAt: string;
|
|
3725
|
+
/**
|
|
3726
|
+
* Who approved or rejected it; null while undecided.
|
|
3727
|
+
*/
|
|
3728
|
+
decidedBy: {
|
|
3729
|
+
email?: string;
|
|
3730
|
+
} | null;
|
|
3731
|
+
decidedAt: (string) | null;
|
|
3732
|
+
/**
|
|
3733
|
+
* True when the request is pending and you are one of the approvers the automation names now.
|
|
3734
|
+
*/
|
|
3735
|
+
canDecide: boolean;
|
|
3736
|
+
/**
|
|
3737
|
+
* The changes the request holds. Notifications are not listed.
|
|
3738
|
+
*/
|
|
3739
|
+
changes: Array<AutomationApprovalChange>;
|
|
3740
|
+
};
|
|
3741
|
+
|
|
3742
|
+
/**
|
|
3743
|
+
* `cancelled` when the automation stopped asking for approval before anyone decided.
|
|
3744
|
+
*/
|
|
3745
|
+
export type status7 = 'pending' | 'approved' | 'rejected' | 'expired' | 'cancelled';
|
|
3746
|
+
|
|
3747
|
+
export type AutomationApprovalChange = {
|
|
3748
|
+
actionId: string;
|
|
3749
|
+
subject: {
|
|
3750
|
+
kind: 'campaign' | 'adset' | 'ad';
|
|
3751
|
+
id: string;
|
|
3752
|
+
name: (string) | null;
|
|
3753
|
+
};
|
|
3754
|
+
type: 'ads.pause' | 'ads.activate' | 'ads.set_budget' | 'ads.duplicate' | 'ads.edit_name' | 'ads.set_bid' | 'ads.set_target' | 'ads.reallocate_budget';
|
|
3755
|
+
/**
|
|
3756
|
+
* The value before the change, under one of `dailyBudget`, `name`, `bidAmount`, `targetCpa` or `targetRoas`. Null when the change moves no value.
|
|
3757
|
+
*/
|
|
3758
|
+
previous: {
|
|
3759
|
+
dailyBudget?: number;
|
|
3760
|
+
name?: string;
|
|
3761
|
+
bidAmount?: number;
|
|
3762
|
+
targetCpa?: number;
|
|
3763
|
+
targetRoas?: number;
|
|
3764
|
+
} | null;
|
|
3765
|
+
/**
|
|
3766
|
+
* The value the change sets, keyed like `previous`.
|
|
3767
|
+
*/
|
|
3768
|
+
target: {
|
|
3769
|
+
dailyBudget?: number;
|
|
3770
|
+
name?: string;
|
|
3771
|
+
bidAmount?: number;
|
|
3772
|
+
targetCpa?: number;
|
|
3773
|
+
targetRoas?: number;
|
|
3774
|
+
} | null;
|
|
3775
|
+
/**
|
|
3776
|
+
* Each condition as it was judged when the request was sent, with its actual value.
|
|
3777
|
+
*/
|
|
3778
|
+
conditions: Array<{
|
|
3779
|
+
[key: string]: unknown;
|
|
3780
|
+
}>;
|
|
3781
|
+
/**
|
|
3782
|
+
* `pending` until the request is decided.
|
|
3783
|
+
*/
|
|
3784
|
+
status: 'pending' | 'applied' | 'skipped' | 'failed' | 'unknown';
|
|
3785
|
+
/**
|
|
3786
|
+
* Why the change was made, skipped or failed, when known.
|
|
3787
|
+
*/
|
|
3788
|
+
reason: (string) | null;
|
|
3789
|
+
};
|
|
3790
|
+
|
|
3791
|
+
/**
|
|
3792
|
+
* `pending` until the request is decided.
|
|
3793
|
+
*/
|
|
3794
|
+
export type status8 = 'pending' | 'applied' | 'skipped' | 'failed' | 'unknown';
|
|
3795
|
+
|
|
3796
|
+
export type AutomationApprovalDecision = {
|
|
3797
|
+
/**
|
|
3798
|
+
* The token from the emailed approval link. When sent, the decision counts only if the link was sent to you. Leave it out when deciding from the API.
|
|
3799
|
+
*/
|
|
3800
|
+
token?: string;
|
|
3801
|
+
};
|
|
3802
|
+
|
|
3803
|
+
/**
|
|
3804
|
+
* Makes the ad rule wait for a person's OK before it acts. One per ad rule, placed before the change. Each change waits until one of `to` approves it, for `expiresIn` at most.
|
|
3805
|
+
*
|
|
3806
|
+
*/
|
|
3807
|
+
export type AutomationApprovalStep = {
|
|
3808
|
+
id?: "approval";
|
|
3809
|
+
type: "approval.request";
|
|
3810
|
+
/**
|
|
3811
|
+
* Team members, by email. Each once.
|
|
3812
|
+
*/
|
|
3813
|
+
to: Array<(string)>;
|
|
3814
|
+
/**
|
|
3815
|
+
* From `15m` to `7d`, in whole minutes.
|
|
3816
|
+
*/
|
|
3817
|
+
expiresIn: string;
|
|
3818
|
+
};
|
|
3819
|
+
|
|
3820
|
+
/**
|
|
3821
|
+
* What the automation would have done on each past day, replayed on stored daily metrics. Nothing is changed.
|
|
3822
|
+
*/
|
|
3823
|
+
export type AutomationBacktest = {
|
|
3824
|
+
/**
|
|
3825
|
+
* The first day replayed, in the ad account timezone.
|
|
3826
|
+
*/
|
|
3827
|
+
from: string;
|
|
3828
|
+
/**
|
|
3829
|
+
* The last day replayed, yesterday in the ad account timezone.
|
|
3830
|
+
*/
|
|
3831
|
+
to: string;
|
|
3832
|
+
timezone: string;
|
|
3833
|
+
/**
|
|
3834
|
+
* True when the ad account timezone is unknown and UTC was used.
|
|
3835
|
+
*/
|
|
3836
|
+
timezoneAssumed: boolean;
|
|
3837
|
+
currency: (string) | null;
|
|
3838
|
+
totals: {
|
|
3839
|
+
/**
|
|
3840
|
+
* Actions it would have taken. Skipped ones are not counted.
|
|
3841
|
+
*/
|
|
3842
|
+
actions: number;
|
|
3843
|
+
pauses: number;
|
|
3844
|
+
activations: number;
|
|
3845
|
+
/**
|
|
3846
|
+
* Budget changes that raised a budget.
|
|
3847
|
+
*/
|
|
3848
|
+
budgetRaised: number;
|
|
3849
|
+
/**
|
|
3850
|
+
* Budget changes that lowered a budget.
|
|
3851
|
+
*/
|
|
3852
|
+
budgetLowered: number;
|
|
3853
|
+
/**
|
|
3854
|
+
* The net budget change across every budget action, in `currency`.
|
|
3855
|
+
*/
|
|
3856
|
+
budgetChange: number;
|
|
3857
|
+
notifications: number;
|
|
3858
|
+
/**
|
|
3859
|
+
* Actions planned but skipped.
|
|
3860
|
+
*/
|
|
3861
|
+
skipped: number;
|
|
3862
|
+
/**
|
|
3863
|
+
* Distinct objects it would have acted on.
|
|
3864
|
+
*/
|
|
3865
|
+
subjects: number;
|
|
3866
|
+
/**
|
|
3867
|
+
* Matches left alone by the cooldown or a cap, summed over the days.
|
|
3868
|
+
*/
|
|
3869
|
+
heldBack: number;
|
|
3870
|
+
daysWithActions: number;
|
|
3871
|
+
};
|
|
3872
|
+
days: Array<AutomationBacktestDay>;
|
|
3873
|
+
/**
|
|
3874
|
+
* What this replay could not know, for example that budgets have no history.
|
|
3875
|
+
*/
|
|
3876
|
+
notes: Array<{
|
|
3877
|
+
code: 'budget_assumed' | 'results_not_replayed' | 'reach_stored' | 'today_whole_day' | 'pause_history' | 'status_history' | 'no_checks' | 'same_day_numbers' | 'alerts_not_replayed';
|
|
3878
|
+
message: string;
|
|
3879
|
+
}>;
|
|
3880
|
+
};
|
|
3881
|
+
|
|
3882
|
+
export type AutomationBacktestDay = {
|
|
3883
|
+
date: string;
|
|
3884
|
+
/**
|
|
3885
|
+
* Checks the schedule would have run that day. 0 on a day it skips.
|
|
3886
|
+
*/
|
|
3887
|
+
checks: number;
|
|
3888
|
+
/**
|
|
3889
|
+
* The most objects any of the day's checks judged.
|
|
3890
|
+
*/
|
|
3891
|
+
evaluated: number;
|
|
3892
|
+
/**
|
|
3893
|
+
* The most objects any of the day's checks matched.
|
|
3894
|
+
*/
|
|
3895
|
+
matched: number;
|
|
3896
|
+
/**
|
|
3897
|
+
* Matches left alone all day by the cooldown or a cap.
|
|
3898
|
+
*/
|
|
3899
|
+
heldBack: number;
|
|
3900
|
+
actions: Array<{
|
|
3901
|
+
subject: {
|
|
3902
|
+
kind: 'campaign' | 'adset' | 'ad';
|
|
3903
|
+
id: string;
|
|
3904
|
+
name: string;
|
|
3905
|
+
campaignId: (string) | null;
|
|
3906
|
+
};
|
|
3907
|
+
/**
|
|
3908
|
+
* For an automation with groups, the group the campaign was judged in.
|
|
3909
|
+
*/
|
|
3910
|
+
group?: string;
|
|
3911
|
+
type: 'ads.pause' | 'ads.activate' | 'ads.set_budget' | 'ads.duplicate' | 'ads.edit_name' | 'ads.set_bid' | 'ads.set_target' | 'ads.reallocate_budget' | 'notify.send';
|
|
3912
|
+
/**
|
|
3913
|
+
* For a budget change, the daily budget before and after.
|
|
3914
|
+
*/
|
|
3915
|
+
budget?: {
|
|
3916
|
+
from: number;
|
|
3917
|
+
to: number;
|
|
3918
|
+
};
|
|
3919
|
+
/**
|
|
3920
|
+
* Why it would have been skipped. Absent when it would have acted.
|
|
3921
|
+
*/
|
|
3922
|
+
skipped?: 'budget_unknown' | 'at_limit' | 'already_at_amount';
|
|
3923
|
+
}>;
|
|
3924
|
+
};
|
|
3925
|
+
|
|
3926
|
+
/**
|
|
3927
|
+
* Promotes each matched Facebook or Instagram post once, as a Meta ad with a lifetime budget. Posts on other platforms are not boosted. It needs the Ads add-on.
|
|
3928
|
+
*
|
|
3929
|
+
* One boost step per automation, and `limits.maxChangesPerDay` (up to 20) is required: the most posts boosted in a day. At most 5 posts are boosted per check.
|
|
3930
|
+
*
|
|
3931
|
+
*/
|
|
3932
|
+
export type AutomationBoostStep = {
|
|
3933
|
+
id?: string;
|
|
3934
|
+
type: "ads.boost_post";
|
|
3935
|
+
/**
|
|
3936
|
+
* The Meta ad account that pays, from `GET /v1/ads/accounts`.
|
|
3937
|
+
*/
|
|
3938
|
+
adAccountId: string;
|
|
3939
|
+
/**
|
|
3940
|
+
* The whole spend of one boost, in the ad account currency.
|
|
3941
|
+
*/
|
|
3942
|
+
budget: number;
|
|
3943
|
+
/**
|
|
3944
|
+
* How long each boost runs.
|
|
3945
|
+
*/
|
|
3946
|
+
days: number;
|
|
3947
|
+
goal?: 'engagement' | 'awareness' | 'video_views';
|
|
3948
|
+
/**
|
|
3949
|
+
* ISO 3166 alpha-2 codes.
|
|
3950
|
+
*/
|
|
3951
|
+
countries: Array<(string)>;
|
|
3952
|
+
};
|
|
3953
|
+
|
|
3954
|
+
export type goal2 = 'engagement' | 'awareness' | 'video_views';
|
|
3955
|
+
|
|
3956
|
+
/**
|
|
3957
|
+
* The one value the change moved, keyed by what it is. Null when it moved none, as for a pause.
|
|
3958
|
+
*/
|
|
3959
|
+
export type AutomationChangedValue = {
|
|
3960
|
+
dailyBudget?: number;
|
|
3961
|
+
name?: string;
|
|
3962
|
+
bidAmount?: number;
|
|
3963
|
+
targetCpa?: number;
|
|
3964
|
+
targetRoas?: number;
|
|
3965
|
+
} | null;
|
|
3966
|
+
|
|
3967
|
+
/**
|
|
3968
|
+
* One check, shaped by the automation's kind.
|
|
3969
|
+
*/
|
|
3970
|
+
export type AutomationCheck = AdRuleAutomationCheck | EventAutomationCheck | ScheduledAutomationCheck;
|
|
3971
|
+
|
|
3972
|
+
export type AutomationConditionResult = {
|
|
3973
|
+
path?: string;
|
|
3974
|
+
metric?: string;
|
|
3975
|
+
window?: string;
|
|
3976
|
+
op?: string;
|
|
3977
|
+
value?: number;
|
|
3978
|
+
compareTo?: string;
|
|
3979
|
+
/**
|
|
3980
|
+
* Null when the value is unknown; such a condition never holds.
|
|
3981
|
+
*/
|
|
3982
|
+
actual?: (number) | null;
|
|
3983
|
+
met?: boolean;
|
|
3984
|
+
};
|
|
3985
|
+
|
|
3986
|
+
/**
|
|
3987
|
+
* The team's switch for every ad rule, and each ad account's own controls. Every team member sees the same ones.
|
|
3988
|
+
*/
|
|
3989
|
+
export type AutomationControls = {
|
|
3990
|
+
/**
|
|
3991
|
+
* True when every ad rule of the team is stopped. Each rule keeps its own status.
|
|
3992
|
+
*/
|
|
3993
|
+
paused: boolean;
|
|
3994
|
+
/**
|
|
3995
|
+
* When the team switch was turned off; null while it is on.
|
|
3996
|
+
*/
|
|
3997
|
+
pausedAt: (string) | null;
|
|
3998
|
+
/**
|
|
3999
|
+
* Every ad account your automations use, plus any ad account that has controls set.
|
|
4000
|
+
*/
|
|
4001
|
+
adAccounts: Array<AutomationAdAccountControls>;
|
|
4002
|
+
};
|
|
4003
|
+
|
|
4004
|
+
/**
|
|
4005
|
+
* An automation of one of three kinds, told apart by its shape:
|
|
4006
|
+
*
|
|
4007
|
+
* - **Ad rule**: a `schedule` trigger over campaigns, ad sets or ads, with metric `conditions` and ad `steps`.
|
|
4008
|
+
* - **Event**: a Zernio event in `trigger.type`, narrowed by `trigger.filter`, with notify steps.
|
|
4009
|
+
* - **Scheduled**: a `schedule` trigger over `subjects.each: post`, narrowed by `filter`, with notify and boost steps.
|
|
4010
|
+
*
|
|
4011
|
+
*/
|
|
4012
|
+
export type AutomationDefinition = AdRuleAutomationDefinition | EventAutomationDefinition | ScheduledAutomationDefinition;
|
|
4013
|
+
|
|
4014
|
+
/**
|
|
4015
|
+
* The limits of an event or scheduled automation.
|
|
4016
|
+
*/
|
|
4017
|
+
export type AutomationEventLimits = {
|
|
4018
|
+
/**
|
|
4019
|
+
* How long the same post or account is left alone after the automation acts on it, rounded up to whole minutes. None by default.
|
|
4020
|
+
*/
|
|
4021
|
+
cooldown?: string;
|
|
4022
|
+
/**
|
|
4023
|
+
* Most runs across the last 24 hours. Required, up to 20, with a boost step.
|
|
4024
|
+
*/
|
|
4025
|
+
maxChangesPerDay?: number;
|
|
4026
|
+
};
|
|
4027
|
+
|
|
4028
|
+
/**
|
|
4029
|
+
* Starts the automation when something happens in Zernio, in one profile. `GET /v1/automations/catalog` lists every event with its facts.
|
|
4030
|
+
*
|
|
4031
|
+
*/
|
|
4032
|
+
export type AutomationEventTrigger = {
|
|
4033
|
+
/**
|
|
4034
|
+
* The Zernio event that starts it.
|
|
4035
|
+
*/
|
|
4036
|
+
type: 'post.failed' | 'post.partial' | 'post.published' | 'post.scheduled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.external.created' | 'account.connected' | 'account.disconnected' | 'account.permissions_changed' | 'account.rate_limited' | 'account.ads.sync_failed' | 'ad.status_changed' | 'ad.review.rejected' | 'ad.delivery_issue' | 'campaign.budget.depleted' | 'ad_account.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.account.quality_updated' | 'commerce.order.created' | 'commerce.order.updated' | 'commerce.order.refunded' | 'message.received' | 'message.failed' | 'conversation.started' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'call.received' | 'call.ended' | 'call.failed' | 'lead.received';
|
|
4037
|
+
/**
|
|
4038
|
+
* The profile whose events start it, from `GET /v1/profiles`.
|
|
4039
|
+
*/
|
|
4040
|
+
profileId: string;
|
|
4041
|
+
/**
|
|
4042
|
+
* Only events of these accounts. Leave out for every account of the profile.
|
|
4043
|
+
*/
|
|
4044
|
+
accountIds?: Array<(string)>;
|
|
4045
|
+
filter?: AutomationFactCondition;
|
|
4046
|
+
};
|
|
4047
|
+
|
|
4048
|
+
/**
|
|
4049
|
+
* The Zernio event that starts it.
|
|
4050
|
+
*/
|
|
4051
|
+
export type type6 = 'post.failed' | 'post.partial' | 'post.published' | 'post.scheduled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.external.created' | 'account.connected' | 'account.disconnected' | 'account.permissions_changed' | 'account.rate_limited' | 'account.ads.sync_failed' | 'ad.status_changed' | 'ad.review.rejected' | 'ad.delivery_issue' | 'campaign.budget.depleted' | 'ad_account.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.account.quality_updated' | 'commerce.order.created' | 'commerce.order.updated' | 'commerce.order.refunded' | 'message.received' | 'message.failed' | 'conversation.started' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'call.received' | 'call.ended' | 'call.failed' | 'lead.received';
|
|
4052
|
+
|
|
4053
|
+
/**
|
|
4054
|
+
* Narrows by the facts of the event or post, such as `platform` or `likes`: one comparison, or a group where `all` must hold or `any` is enough. Groups nest.
|
|
4055
|
+
*
|
|
4056
|
+
* A leaf whose `field` is not a fact of the event or post is refused. Text compares ignoring case. A number or date that does not parse never matches.
|
|
4057
|
+
*
|
|
4058
|
+
*/
|
|
4059
|
+
export type AutomationFactCondition = {
|
|
4060
|
+
/**
|
|
4061
|
+
* A fact name from the catalog.
|
|
4062
|
+
*/
|
|
4063
|
+
field: string;
|
|
4064
|
+
op: 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'exists' | 'not_exists' | 'matches' | 'greater_than' | 'less_than' | 'greater_or_equal' | 'less_or_equal' | 'before' | 'after' | 'has_tag' | 'not_has_tag' | 'is_true' | 'is_false';
|
|
4065
|
+
value: string | number;
|
|
4066
|
+
} | {
|
|
4067
|
+
all: Array<AutomationFactCondition>;
|
|
4068
|
+
} | {
|
|
4069
|
+
any: Array<AutomationFactCondition>;
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4072
|
+
export type op3 = 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'exists' | 'not_exists' | 'matches' | 'greater_than' | 'less_than' | 'greater_or_equal' | 'less_or_equal' | 'before' | 'after' | 'has_tag' | 'not_has_tag' | 'is_true' | 'is_false';
|
|
4073
|
+
|
|
4074
|
+
/**
|
|
4075
|
+
* One leaf of the filter, with the fact's value at the check. Content facts are null for teams that keep no content.
|
|
4076
|
+
*/
|
|
4077
|
+
export type AutomationFactResult = {
|
|
4078
|
+
field?: string;
|
|
4079
|
+
op?: string;
|
|
4080
|
+
value?: unknown;
|
|
4081
|
+
actual?: unknown;
|
|
4082
|
+
met?: boolean;
|
|
4083
|
+
};
|
|
4084
|
+
|
|
4085
|
+
/**
|
|
4086
|
+
* An ad rule's limits.
|
|
4087
|
+
*/
|
|
4088
|
+
export type AutomationLimits = {
|
|
4089
|
+
/**
|
|
4090
|
+
* How long an object is left alone after the rule acts on it. Whole minutes, up to `30d`.
|
|
4091
|
+
*/
|
|
4092
|
+
cooldown?: string;
|
|
4093
|
+
/**
|
|
4094
|
+
* Most changes across the last 24 hours. Needs an `ads.*` step.
|
|
4095
|
+
*/
|
|
4096
|
+
maxChangesPerDay?: number;
|
|
4097
|
+
/**
|
|
4098
|
+
* Most times the rule may change one object, over its whole history. Needs an `ads.*` step.
|
|
4099
|
+
*/
|
|
4100
|
+
maxChangesPerObject?: number;
|
|
4101
|
+
};
|
|
4102
|
+
|
|
4103
|
+
/**
|
|
4104
|
+
* Sends a summary to Slack channels or email addresses of connected accounts. In an ad rule it also sends the `ad_rule.triggered` webhook, and `to` is optional.
|
|
4105
|
+
*
|
|
4106
|
+
* Event and scheduled automations need `to`.
|
|
4107
|
+
*
|
|
4108
|
+
*/
|
|
4109
|
+
export type AutomationNotifyStep = {
|
|
4110
|
+
/**
|
|
4111
|
+
* In an ad rule the id is always `notify`.
|
|
4112
|
+
*/
|
|
4113
|
+
id?: string;
|
|
4114
|
+
type: "notify.send";
|
|
4115
|
+
/**
|
|
4116
|
+
* Up to 5 in an ad rule.
|
|
4117
|
+
*/
|
|
4118
|
+
to?: Array<{
|
|
4119
|
+
accountId: string;
|
|
4120
|
+
/**
|
|
4121
|
+
* An address for a connected Gmail or Outlook account.
|
|
4122
|
+
*/
|
|
4123
|
+
to?: string;
|
|
4124
|
+
/**
|
|
4125
|
+
* A channel of a connected Slack account.
|
|
4126
|
+
*/
|
|
4127
|
+
channelId?: string;
|
|
4128
|
+
}>;
|
|
4129
|
+
};
|
|
4130
|
+
|
|
4131
|
+
/**
|
|
4132
|
+
* When a scheduled automation checks its posts. Set times and quiet hours are not available for posts.
|
|
4133
|
+
*/
|
|
4134
|
+
export type AutomationPostSchedule = {
|
|
4135
|
+
type: "schedule";
|
|
4136
|
+
every: '15m' | '30m' | '1h' | '3h' | '6h' | '12h' | '1d';
|
|
4137
|
+
/**
|
|
4138
|
+
* Runs from this time on.
|
|
4139
|
+
*/
|
|
4140
|
+
startsAt?: string;
|
|
4141
|
+
/**
|
|
4142
|
+
* Stops running after this time.
|
|
4143
|
+
*/
|
|
4144
|
+
endsAt?: string;
|
|
4145
|
+
};
|
|
4146
|
+
|
|
4147
|
+
export type every = '15m' | '30m' | '1h' | '3h' | '6h' | '12h' | '1d';
|
|
4148
|
+
|
|
4149
|
+
/**
|
|
4150
|
+
* The posts a scheduled automation checks.
|
|
4151
|
+
*/
|
|
4152
|
+
export type AutomationPostSubjects = {
|
|
4153
|
+
each: "post";
|
|
4154
|
+
/**
|
|
4155
|
+
* The profile whose posts are checked.
|
|
4156
|
+
*/
|
|
4157
|
+
profileId: string;
|
|
4158
|
+
/**
|
|
4159
|
+
* Only posts of these accounts. Each must be active on the profile.
|
|
4160
|
+
*/
|
|
4161
|
+
accountIds?: Array<(string)>;
|
|
4162
|
+
/**
|
|
4163
|
+
* How far back posts are checked, by when they were published. Whole days, from `1d` to `30d` (`48h` is 2 days).
|
|
4164
|
+
*/
|
|
4165
|
+
publishedWithin?: string;
|
|
4166
|
+
};
|
|
4167
|
+
|
|
4168
|
+
/**
|
|
4169
|
+
* What an ad rule would do if it ran now. Nothing is changed. Cooldowns and daily caps are left out, so a run right after can act on fewer objects.
|
|
4170
|
+
*
|
|
4171
|
+
*/
|
|
4172
|
+
export type AutomationPreview = {
|
|
4173
|
+
evaluatedAt: string;
|
|
4174
|
+
/**
|
|
4175
|
+
* Today in the ad account timezone.
|
|
4176
|
+
*/
|
|
4177
|
+
today: string;
|
|
4178
|
+
timezone: string;
|
|
4179
|
+
/**
|
|
4180
|
+
* True when the ad account timezone is unknown and UTC was used.
|
|
4181
|
+
*/
|
|
4182
|
+
timezoneAssumed: boolean;
|
|
4183
|
+
currency: (string) | null;
|
|
4184
|
+
evaluated: number;
|
|
4185
|
+
matched: number;
|
|
4186
|
+
/**
|
|
4187
|
+
* True when more subjects were judged than `limit` lists.
|
|
4188
|
+
*/
|
|
4189
|
+
truncated: boolean;
|
|
4190
|
+
/**
|
|
4191
|
+
* Matches first, up to `limit`.
|
|
4192
|
+
*/
|
|
4193
|
+
subjects: Array<{
|
|
4194
|
+
subject: {
|
|
4195
|
+
kind?: 'campaign' | 'adset' | 'ad';
|
|
4196
|
+
/**
|
|
4197
|
+
* Platform ID.
|
|
4198
|
+
*/
|
|
4199
|
+
id?: string;
|
|
4200
|
+
name?: string;
|
|
4201
|
+
campaignId?: (string) | null;
|
|
4202
|
+
};
|
|
4203
|
+
/**
|
|
4204
|
+
* The group it was judged in, when the rule has `subjects.groups`.
|
|
4205
|
+
*/
|
|
4206
|
+
group?: string;
|
|
4207
|
+
matched: boolean;
|
|
4208
|
+
conditions: Array<AutomationConditionResult>;
|
|
4209
|
+
wouldRun: Array<{
|
|
4210
|
+
step?: string;
|
|
4211
|
+
type?: string;
|
|
4212
|
+
}>;
|
|
4213
|
+
}>;
|
|
4214
|
+
/**
|
|
4215
|
+
* Each group's totals against the conditions, when the rule has `subjects.groups`.
|
|
4216
|
+
*/
|
|
4217
|
+
groups?: Array<{
|
|
4218
|
+
name?: string;
|
|
4219
|
+
matched?: boolean;
|
|
4220
|
+
conditions?: Array<AutomationConditionResult>;
|
|
4221
|
+
campaignIds?: Array<(string)>;
|
|
4222
|
+
}>;
|
|
4223
|
+
};
|
|
4224
|
+
|
|
4225
|
+
/**
|
|
4226
|
+
* Every problem with the automation, each at a JSON path such as `steps[0].by`. The first one also fills `error` and `param`.
|
|
4227
|
+
*/
|
|
4228
|
+
export type AutomationProblems = {
|
|
4229
|
+
problems?: Array<{
|
|
4230
|
+
path: string;
|
|
4231
|
+
code: 'invalid_value' | 'not_supported';
|
|
4232
|
+
message: string;
|
|
4233
|
+
}>;
|
|
4234
|
+
};
|
|
4235
|
+
|
|
4236
|
+
export type AutomationRecord = {
|
|
4237
|
+
id: string;
|
|
4238
|
+
kind: 'ad_rule' | 'event' | 'scheduled';
|
|
4239
|
+
status: 'active' | 'paused';
|
|
4240
|
+
/**
|
|
4241
|
+
* Send it back as `If-Match` when editing, so an edit made after someone else saved is refused.
|
|
4242
|
+
*/
|
|
4243
|
+
version: string;
|
|
4244
|
+
/**
|
|
4245
|
+
* Null until an ad rule first checks. Always null for event and scheduled automations; their checks list when they ran.
|
|
4246
|
+
*/
|
|
4247
|
+
lastCheckAt: (string) | null;
|
|
4248
|
+
/**
|
|
4249
|
+
* Null while paused. Always null for event and scheduled automations.
|
|
4250
|
+
*/
|
|
4251
|
+
nextCheckAt: (string) | null;
|
|
4252
|
+
createdAt: string;
|
|
4253
|
+
updatedAt: string;
|
|
4254
|
+
/**
|
|
4255
|
+
* Only on `GET /v1/automations/{automationId}`, for an automation installed from a template.
|
|
4256
|
+
*/
|
|
4257
|
+
template?: {
|
|
4258
|
+
id: string;
|
|
4259
|
+
name: (string) | null;
|
|
4260
|
+
/**
|
|
4261
|
+
* The template version it was installed from.
|
|
4262
|
+
*/
|
|
4263
|
+
version: number;
|
|
4264
|
+
/**
|
|
4265
|
+
* Null once the template is deleted.
|
|
4266
|
+
*/
|
|
4267
|
+
latestVersion: (number) | null;
|
|
4268
|
+
};
|
|
4269
|
+
};
|
|
4270
|
+
|
|
4271
|
+
export type kind3 = 'ad_rule' | 'event' | 'scheduled';
|
|
4272
|
+
|
|
4273
|
+
export type AutomationRunResult = {
|
|
4274
|
+
type: 'notify.send' | 'ads.boost_post';
|
|
4275
|
+
/**
|
|
4276
|
+
* `unknown` when the platform never answered, so the outcome is not known.
|
|
4277
|
+
*/
|
|
4278
|
+
status: 'pending' | 'applied' | 'skipped' | 'failed' | 'unknown';
|
|
4279
|
+
reason: (string) | null;
|
|
4280
|
+
};
|
|
4281
|
+
|
|
4282
|
+
export type type7 = 'notify.send' | 'ads.boost_post';
|
|
4283
|
+
|
|
4284
|
+
/**
|
|
4285
|
+
* When an ad rule runs: `every` an interval or at set weekly `times` (send one), optionally only between `startsAt` and `endsAt` and never inside `quietHours`. Times and quiet hours are in the ad account timezone.
|
|
4286
|
+
*
|
|
4287
|
+
*/
|
|
4288
|
+
export type AutomationScheduleTrigger = {
|
|
4289
|
+
type: "schedule";
|
|
4290
|
+
/**
|
|
4291
|
+
* Run every interval. Send this or `times`, not both.
|
|
4292
|
+
*/
|
|
4293
|
+
every?: '15m' | '30m' | '1h' | '3h' | '6h' | '12h' | '1d';
|
|
4294
|
+
/**
|
|
4295
|
+
* Set weekly times. Send this or `every`, not both.
|
|
4296
|
+
*/
|
|
4297
|
+
times?: Array<{
|
|
4298
|
+
days: Array<('mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun')>;
|
|
4299
|
+
at: string;
|
|
4300
|
+
}>;
|
|
4301
|
+
/**
|
|
4302
|
+
* Runs from this time on.
|
|
4303
|
+
*/
|
|
4304
|
+
startsAt?: string;
|
|
4305
|
+
/**
|
|
4306
|
+
* Stops running after this time. Must be after `startsAt`.
|
|
4307
|
+
*/
|
|
4308
|
+
endsAt?: string;
|
|
4309
|
+
/**
|
|
4310
|
+
* A daily window with no checks. It may wrap past midnight, such as `22:00` to `06:00`.
|
|
4311
|
+
*/
|
|
4312
|
+
quietHours?: {
|
|
4313
|
+
from: string;
|
|
4314
|
+
/**
|
|
4315
|
+
* Differs from `from`.
|
|
4316
|
+
*/
|
|
4317
|
+
to: string;
|
|
4318
|
+
};
|
|
4319
|
+
};
|
|
4320
|
+
|
|
4321
|
+
/**
|
|
4322
|
+
* One thing an ad rule does for each matching object, in order. An ad rule takes at most one `ads.*` change, can ask for approval before it and notify after it.
|
|
4323
|
+
*
|
|
4324
|
+
* `id` is fixed by the step type; leave it out when writing. `GET /v1/automations/catalog` lists the platforms and subjects each step works on.
|
|
4325
|
+
*
|
|
4326
|
+
*/
|
|
4327
|
+
export type AutomationStep = {
|
|
4328
|
+
id?: "pause";
|
|
4329
|
+
type: "ads.pause";
|
|
4330
|
+
} | {
|
|
4331
|
+
id?: "activate";
|
|
4332
|
+
type: "ads.activate";
|
|
4333
|
+
/**
|
|
4334
|
+
* Also objects a person paused. Without it only what this automation paused is turned back on.
|
|
4335
|
+
*/
|
|
4336
|
+
includeManuallyPaused?: boolean;
|
|
4337
|
+
} | {
|
|
4338
|
+
id?: "duplicate";
|
|
4339
|
+
type: "ads.duplicate";
|
|
4340
|
+
/**
|
|
4341
|
+
* The copy starts paused unless `active`.
|
|
4342
|
+
*/
|
|
4343
|
+
status?: 'paused' | 'active';
|
|
4344
|
+
renameSuffix?: string;
|
|
4345
|
+
} | {
|
|
4346
|
+
id?: "budget";
|
|
4347
|
+
type: "ads.change_budget";
|
|
4348
|
+
/**
|
|
4349
|
+
* Up to +100% or down to -90%.
|
|
4350
|
+
*/
|
|
4351
|
+
by: string;
|
|
4352
|
+
max?: number;
|
|
4353
|
+
min?: number;
|
|
4354
|
+
} | {
|
|
4355
|
+
id?: "budget";
|
|
4356
|
+
type: "ads.set_budget";
|
|
4357
|
+
/**
|
|
4358
|
+
* The daily budget to set, in the ad account currency.
|
|
4359
|
+
*/
|
|
4360
|
+
amount: number;
|
|
4361
|
+
} | {
|
|
4362
|
+
id?: "bid";
|
|
4363
|
+
type: "ads.change_bid";
|
|
4364
|
+
/**
|
|
4365
|
+
* Up to +100% or down to -90%.
|
|
4366
|
+
*/
|
|
4367
|
+
by: string;
|
|
4368
|
+
max?: number;
|
|
4369
|
+
min?: number;
|
|
4370
|
+
} | {
|
|
4371
|
+
id?: "bid";
|
|
4372
|
+
type: "ads.set_bid";
|
|
4373
|
+
amount: number;
|
|
4374
|
+
} | {
|
|
4375
|
+
id?: "target";
|
|
4376
|
+
type: "ads.change_target";
|
|
4377
|
+
target: 'cpa' | 'roas';
|
|
4378
|
+
by: string;
|
|
4379
|
+
max?: number;
|
|
4380
|
+
min?: number;
|
|
4381
|
+
} | {
|
|
4382
|
+
id?: "target";
|
|
4383
|
+
type: "ads.set_target";
|
|
4384
|
+
target: 'cpa' | 'roas';
|
|
4385
|
+
amount: number;
|
|
4386
|
+
} | {
|
|
4387
|
+
id?: "reallocate";
|
|
4388
|
+
type: "ads.reallocate_budget";
|
|
4389
|
+
/**
|
|
4390
|
+
* A condition metric or `result:<key>`, not a calendar metric.
|
|
4391
|
+
*/
|
|
4392
|
+
metric: string;
|
|
4393
|
+
/**
|
|
4394
|
+
* A condition window.
|
|
4395
|
+
*/
|
|
4396
|
+
window: string;
|
|
4397
|
+
/**
|
|
4398
|
+
* Which end is best. Defaults to lowest for `cpa`, `cpc`, `cpm`, `frequency` and cost results, highest otherwise.
|
|
4399
|
+
*/
|
|
4400
|
+
best?: 'highest' | 'lowest';
|
|
4401
|
+
/**
|
|
4402
|
+
* How many objects give budget.
|
|
4403
|
+
*/
|
|
4404
|
+
from: number;
|
|
4405
|
+
/**
|
|
4406
|
+
* How many objects receive it.
|
|
4407
|
+
*/
|
|
4408
|
+
to: number;
|
|
4409
|
+
/**
|
|
4410
|
+
* From 1% to 90%.
|
|
4411
|
+
*/
|
|
4412
|
+
by?: string;
|
|
4413
|
+
amount?: number;
|
|
4414
|
+
/**
|
|
4415
|
+
* A giver's budget never goes below this.
|
|
4416
|
+
*/
|
|
4417
|
+
min?: number;
|
|
4418
|
+
/**
|
|
4419
|
+
* A receiver's budget never goes above this.
|
|
4420
|
+
*/
|
|
4421
|
+
max?: number;
|
|
4422
|
+
} | {
|
|
4423
|
+
id?: "edit_name";
|
|
4424
|
+
type: "ads.edit_name";
|
|
4425
|
+
add?: string;
|
|
4426
|
+
remove?: string;
|
|
4427
|
+
at?: 'start' | 'end';
|
|
4428
|
+
} | AutomationApprovalStep | AutomationNotifyStep;
|
|
4429
|
+
|
|
4430
|
+
/**
|
|
4431
|
+
* What an ad rule checks, and where.
|
|
4432
|
+
*/
|
|
4433
|
+
export type AutomationSubjects = {
|
|
4434
|
+
/**
|
|
4435
|
+
* The objects judged one by one.
|
|
4436
|
+
*/
|
|
4437
|
+
each: 'campaign' | 'adset' | 'ad';
|
|
4438
|
+
/**
|
|
4439
|
+
* The ad account to check. One per ad rule, and an edit cannot move it to another.
|
|
4440
|
+
*/
|
|
4441
|
+
adAccounts: [
|
|
4442
|
+
{
|
|
4443
|
+
/**
|
|
4444
|
+
* The ads connection, from `GET /v1/accounts`.
|
|
4445
|
+
*/
|
|
4446
|
+
accountId: string;
|
|
4447
|
+
/**
|
|
4448
|
+
* Platform ad account ID, from `GET /v1/ads/accounts`.
|
|
4449
|
+
*/
|
|
4450
|
+
adAccountId: string;
|
|
4451
|
+
}
|
|
4452
|
+
];
|
|
4453
|
+
/**
|
|
4454
|
+
* Only these platform campaigns or their ad sets and ads. Leave out to check the whole ad account.
|
|
4455
|
+
*/
|
|
4456
|
+
campaignIds?: Array<(string)>;
|
|
4457
|
+
/**
|
|
4458
|
+
* All must hold.
|
|
4459
|
+
*/
|
|
4460
|
+
filters?: Array<AutomationAdFilter>;
|
|
4461
|
+
/**
|
|
4462
|
+
* Judges campaigns together (campaign rules only): each group's numbers are summed and its rates computed on the totals, and a matching group acts on each of its campaigns.
|
|
4463
|
+
*
|
|
4464
|
+
* A group with no filters holds every campaign the rule checks. `reach` and `frequency` cannot be used with groups.
|
|
4465
|
+
*
|
|
4466
|
+
*/
|
|
4467
|
+
groups?: Array<{
|
|
4468
|
+
/**
|
|
4469
|
+
* Unique within the rule.
|
|
4470
|
+
*/
|
|
4471
|
+
name: string;
|
|
4472
|
+
filters: Array<AutomationAdFilter>;
|
|
4473
|
+
}>;
|
|
4474
|
+
};
|
|
4475
|
+
|
|
4476
|
+
/**
|
|
4477
|
+
* The objects judged one by one.
|
|
4478
|
+
*/
|
|
4479
|
+
export type each = 'campaign' | 'adset' | 'ad';
|
|
4480
|
+
|
|
4481
|
+
export type AutomationTemplate = {
|
|
4482
|
+
/**
|
|
4483
|
+
* A team template's id (24 hex characters), or the id of one of Zernio's templates such as `stop_losers`.
|
|
4484
|
+
*/
|
|
4485
|
+
id: string;
|
|
4486
|
+
name: string;
|
|
4487
|
+
description: string;
|
|
4488
|
+
publisher: {
|
|
4489
|
+
/**
|
|
4490
|
+
* `team` for your team's templates and shared ones, `zernio` for Zernio's own.
|
|
4491
|
+
*/
|
|
4492
|
+
type: 'team' | 'zernio';
|
|
4493
|
+
};
|
|
4494
|
+
/**
|
|
4495
|
+
* `team`: your team only. `link`: anyone with the share link can read and install it. `public`: one of Zernio's templates.
|
|
4496
|
+
*/
|
|
4497
|
+
visibility: 'team' | 'link' | 'public';
|
|
4498
|
+
/**
|
|
4499
|
+
* Goes up each time the content changes. Renaming or sharing keeps it.
|
|
4500
|
+
*/
|
|
4501
|
+
version: number;
|
|
4502
|
+
/**
|
|
4503
|
+
* What its automations work on.
|
|
4504
|
+
*/
|
|
4505
|
+
areas: Array<('ads' | 'events' | 'posts' | 'inbox' | 'comments')>;
|
|
4506
|
+
inputs: Array<AutomationTemplateInput>;
|
|
4507
|
+
automations: Array<AutomationTemplateAutomation>;
|
|
4508
|
+
/**
|
|
4509
|
+
* Installs across every team. Always 0 on Zernio's templates.
|
|
4510
|
+
*/
|
|
4511
|
+
installs: number;
|
|
4512
|
+
/**
|
|
4513
|
+
* Your team's automations made from it. Absent on shared and Zernio templates.
|
|
4514
|
+
*/
|
|
4515
|
+
installedInTeam?: number;
|
|
4516
|
+
/**
|
|
4517
|
+
* While shared by link (on your own templates only). Null otherwise.
|
|
4518
|
+
*/
|
|
4519
|
+
share: {
|
|
4520
|
+
/**
|
|
4521
|
+
* The share token for `/v1/automations/templates/shared/{shareToken}`.
|
|
4522
|
+
*/
|
|
4523
|
+
token: string;
|
|
4524
|
+
/**
|
|
4525
|
+
* The dashboard page that opens the template.
|
|
4526
|
+
*/
|
|
4527
|
+
path: string;
|
|
4528
|
+
} | null;
|
|
4529
|
+
/**
|
|
4530
|
+
* The user who saved it. Only on your team's templates.
|
|
4531
|
+
*/
|
|
4532
|
+
createdBy?: string;
|
|
4533
|
+
/**
|
|
4534
|
+
* Absent on Zernio's templates.
|
|
4535
|
+
*/
|
|
4536
|
+
createdAt?: string;
|
|
4537
|
+
/**
|
|
4538
|
+
* Absent on Zernio's templates.
|
|
4539
|
+
*/
|
|
4540
|
+
updatedAt?: string;
|
|
4541
|
+
};
|
|
4542
|
+
|
|
4543
|
+
/**
|
|
4544
|
+
* `team` for your team's templates and shared ones, `zernio` for Zernio's own.
|
|
4545
|
+
*/
|
|
4546
|
+
export type type8 = 'team' | 'zernio';
|
|
4547
|
+
|
|
4548
|
+
/**
|
|
4549
|
+
* `team`: your team only. `link`: anyone with the share link can read and install it. `public`: one of Zernio's templates.
|
|
4550
|
+
*/
|
|
4551
|
+
export type visibility = 'team' | 'link' | 'public';
|
|
4552
|
+
|
|
4553
|
+
export type AutomationTemplateAutomation = {
|
|
4554
|
+
/**
|
|
4555
|
+
* Stable within the template, for example `automation1`.
|
|
4556
|
+
*/
|
|
4557
|
+
key: string;
|
|
4558
|
+
/**
|
|
4559
|
+
* A `POST /v1/automations` body without `status`, in which every value tied to one account is an input reference such as `{ "$input": "adAccount" }`. Campaign ids, id filters, start and end dates and approval steps are not kept.
|
|
4560
|
+
*/
|
|
4561
|
+
definition: {
|
|
4562
|
+
[key: string]: unknown;
|
|
4563
|
+
};
|
|
4564
|
+
};
|
|
4565
|
+
|
|
4566
|
+
/**
|
|
4567
|
+
* Where the automations come from. Send `from` or `automations`, not both.
|
|
4568
|
+
*/
|
|
4569
|
+
export type AutomationTemplateContent = {
|
|
4570
|
+
/**
|
|
4571
|
+
* Copy existing automations: your own (`automationIds`), one of Zernio's templates (`templateId`, for example `stop_losers`), or a template shared by link (`shareToken`).
|
|
4572
|
+
*/
|
|
4573
|
+
from?: ({
|
|
4574
|
+
automationIds: Array<(string)>;
|
|
4575
|
+
} | {
|
|
4576
|
+
templateId: string;
|
|
4577
|
+
} | {
|
|
4578
|
+
shareToken: string;
|
|
4579
|
+
});
|
|
4580
|
+
/**
|
|
4581
|
+
* Automation definitions, each checked like a `POST /v1/automations` body. Ad accounts, a trigger's profile and accounts, and alert destinations become inputs.
|
|
4582
|
+
*/
|
|
4583
|
+
automations?: Array<AutomationDefinition>;
|
|
4584
|
+
};
|
|
4585
|
+
|
|
4586
|
+
/**
|
|
4587
|
+
* Something an install asks for. Each automation in the template holds `{ "$input": "<key>" }` where the value goes, and installing puts the value sent in `inputs.<key>` there.
|
|
4588
|
+
*/
|
|
4589
|
+
export type AutomationTemplateInput = {
|
|
4590
|
+
/**
|
|
4591
|
+
* The name to send the value under in `inputs`, for example `adAccount`.
|
|
4592
|
+
*/
|
|
4593
|
+
key: string;
|
|
4594
|
+
/**
|
|
4595
|
+
* What the value is. `ad_account`: `{ accountId, adAccountId }`. `profile`: a profile id. `social_accounts`: an array of social account ids. `notify_destination`: an array of `{ accountId, to?, channelId? }`. `number`, `money` (in the ad account's currency) and `percent`: a number within the bounds below. `choice`: one of `options[].value`.
|
|
4596
|
+
*/
|
|
4597
|
+
type: 'ad_account' | 'profile' | 'social_accounts' | 'notify_destination' | 'number' | 'money' | 'percent' | 'choice';
|
|
4598
|
+
label: string;
|
|
4599
|
+
/**
|
|
4600
|
+
* True when an install may leave it out. A field that points at a left-out input is dropped.
|
|
4601
|
+
*/
|
|
4602
|
+
optional?: boolean;
|
|
4603
|
+
/**
|
|
4604
|
+
* Used when an install leaves the input out. An input with a default is never missing.
|
|
4605
|
+
*/
|
|
4606
|
+
default?: string | number;
|
|
4607
|
+
min?: number;
|
|
4608
|
+
/**
|
|
4609
|
+
* The value must be above it, for example an amount above 0.
|
|
4610
|
+
*/
|
|
4611
|
+
exclusiveMin?: number;
|
|
4612
|
+
max?: number;
|
|
4613
|
+
/**
|
|
4614
|
+
* True when only whole numbers are accepted.
|
|
4615
|
+
*/
|
|
4616
|
+
integer?: boolean;
|
|
4617
|
+
/**
|
|
4618
|
+
* What a `choice` input offers.
|
|
4619
|
+
*/
|
|
4620
|
+
options?: Array<{
|
|
4621
|
+
value: string | number;
|
|
4622
|
+
label: string;
|
|
4623
|
+
}>;
|
|
4624
|
+
};
|
|
4625
|
+
|
|
4626
|
+
/**
|
|
4627
|
+
* What the value is. `ad_account`: `{ accountId, adAccountId }`. `profile`: a profile id. `social_accounts`: an array of social account ids. `notify_destination`: an array of `{ accountId, to?, channelId? }`. `number`, `money` (in the ad account's currency) and `percent`: a number within the bounds below. `choice`: one of `options[].value`.
|
|
4628
|
+
*/
|
|
4629
|
+
export type type9 = 'ad_account' | 'profile' | 'social_accounts' | 'notify_destination' | 'number' | 'money' | 'percent' | 'choice';
|
|
4630
|
+
|
|
4631
|
+
export type AutomationTemplateInstallation = {
|
|
4632
|
+
templateId: string;
|
|
4633
|
+
templateVersion: number;
|
|
4634
|
+
automations: Array<Automation>;
|
|
4635
|
+
};
|
|
4636
|
+
|
|
4637
|
+
export type AutomationTemplateInstallRequest = {
|
|
4638
|
+
/**
|
|
4639
|
+
* A value for each input, by its `key`. Required inputs without a default must be sent.
|
|
4640
|
+
*/
|
|
4641
|
+
inputs?: {
|
|
4642
|
+
[key: string]: unknown;
|
|
4643
|
+
};
|
|
4644
|
+
/**
|
|
4645
|
+
* Install several times in one call, for example on many ad accounts. Each target is its own install, all or nothing, and its `inputs` win over the shared `inputs`. A failed target leaves the others in place.
|
|
4646
|
+
*/
|
|
4647
|
+
targets?: Array<{
|
|
4648
|
+
inputs: {
|
|
4649
|
+
[key: string]: unknown;
|
|
4650
|
+
};
|
|
4651
|
+
}>;
|
|
4652
|
+
/**
|
|
4653
|
+
* The status of every automation created.
|
|
4654
|
+
*/
|
|
4655
|
+
status?: 'active' | 'paused';
|
|
4656
|
+
};
|
|
4657
|
+
|
|
4658
|
+
export type AutomationTemplateInstallResponse = {
|
|
4659
|
+
installation: AutomationTemplateInstallation;
|
|
4660
|
+
} | {
|
|
4661
|
+
/**
|
|
4662
|
+
* One result per target, in order.
|
|
4663
|
+
*/
|
|
4664
|
+
installations: Array<AutomationTemplateTargetResult>;
|
|
4665
|
+
};
|
|
4666
|
+
|
|
4667
|
+
export type AutomationTemplateTargetResult = {
|
|
4668
|
+
/**
|
|
4669
|
+
* The index of the entry in `targets`.
|
|
4670
|
+
*/
|
|
4671
|
+
target: number;
|
|
4672
|
+
status: 'created' | 'failed';
|
|
4673
|
+
installation?: AutomationTemplateInstallation;
|
|
4674
|
+
/**
|
|
4675
|
+
* Why this target did not install. Problem paths point into the request, such as `targets[2].inputs.adAccount`.
|
|
4676
|
+
*/
|
|
4677
|
+
error?: {
|
|
4678
|
+
code: string;
|
|
4679
|
+
message: string;
|
|
4680
|
+
param?: string;
|
|
4681
|
+
details?: {
|
|
4682
|
+
[key: string]: unknown;
|
|
4683
|
+
};
|
|
4684
|
+
};
|
|
4685
|
+
};
|
|
4686
|
+
|
|
4687
|
+
export type status9 = 'created' | 'failed';
|
|
4688
|
+
|
|
4689
|
+
/**
|
|
4690
|
+
* When the automation runs. Its shape decides the kind:
|
|
4691
|
+
*
|
|
4692
|
+
* - A Zernio event name in `type` makes an event automation.
|
|
4693
|
+
* - A `schedule` over `subjects.each: post` makes a scheduled automation.
|
|
4694
|
+
* - Any other `schedule` makes an ad rule.
|
|
4695
|
+
*
|
|
4696
|
+
*/
|
|
4697
|
+
export type AutomationTrigger = AutomationScheduleTrigger | AutomationEventTrigger | AutomationPostSchedule;
|
|
4698
|
+
|
|
3546
4699
|
export type AutoRecharge = {
|
|
3547
4700
|
/**
|
|
3548
4701
|
* Whether auto-recharge is on. Charges happen only when this is true and disabledReason is null.
|
|
@@ -3760,7 +4913,7 @@ export type BlogArticle = {
|
|
|
3760
4913
|
/**
|
|
3761
4914
|
* WordPress and Wix. Post status (`future` = scheduled, `pending` = in review on Wix); omitted for Shopify.
|
|
3762
4915
|
*/
|
|
3763
|
-
export type
|
|
4916
|
+
export type status10 = 'publish' | 'future' | 'draft' | 'pending' | 'private';
|
|
3764
4917
|
|
|
3765
4918
|
/**
|
|
3766
4919
|
* Bluesky post settings. Supports text posts with up to 4 images or a single video. threadItems creates a reply chain (Bluesky thread). Images exceeding 1MB are automatically compressed. Alt text supported via mediaItem properties. Use langs to tag post language for feed-generator filtering.
|
|
@@ -3934,7 +5087,7 @@ export type BrandedCallingIdentity = {
|
|
|
3934
5087
|
* - permanently_rejected: terminal
|
|
3935
5088
|
*
|
|
3936
5089
|
*/
|
|
3937
|
-
export type
|
|
5090
|
+
export type status11 = 'requested' | 'changes_requested' | 'rejected' | 'pending_email_verification' | 'in_review' | 'verified' | 'suspended' | 'expired' | 'permanently_rejected';
|
|
3938
5091
|
|
|
3939
5092
|
export type BrandedCallingIdentityNumber = {
|
|
3940
5093
|
phoneNumberId?: string;
|
|
@@ -3956,7 +5109,7 @@ export type BrandedCallingIdentityNumber = {
|
|
|
3956
5109
|
/**
|
|
3957
5110
|
* verified = the identity shows on calls from this number. permanently_rejected cannot be attached again anywhere.
|
|
3958
5111
|
*/
|
|
3959
|
-
export type
|
|
5112
|
+
export type status12 = 'submitted' | 'in_review' | 'verified' | 'unsuccessful' | 'suspended' | 'expired' | 'permanently_rejected';
|
|
3960
5113
|
|
|
3961
5114
|
/**
|
|
3962
5115
|
* A person the carrier vetting team phones to confirm the business. Business references are senior contacts at a vendor, partner or client; the financial reference is a CPA or a bank contact. Calls are placed in the reference's local 8am-9pm window.
|
|
@@ -4188,7 +5341,7 @@ export type BusinessAgentEventStatus = {
|
|
|
4188
5341
|
updated_at: string;
|
|
4189
5342
|
};
|
|
4190
5343
|
|
|
4191
|
-
export type
|
|
5344
|
+
export type status13 = 'request_received' | 'processing' | 'sent' | 'failed' | 'skipped' | 'success';
|
|
4192
5345
|
|
|
4193
5346
|
export type BusinessAgentFaq = BusinessAgentFaqInput & {
|
|
4194
5347
|
id: string;
|
|
@@ -4285,7 +5438,7 @@ export type BusinessAgentSkill = BusinessAgentSkillInput & {
|
|
|
4285
5438
|
/**
|
|
4286
5439
|
* pending_review right after a write; blocked means Meta content review rejected it and the agent never applies it.
|
|
4287
5440
|
*/
|
|
4288
|
-
export type
|
|
5441
|
+
export type status14 = 'active' | 'pending_review' | 'blocked';
|
|
4289
5442
|
|
|
4290
5443
|
export type BusinessAgentSkillInput = {
|
|
4291
5444
|
/**
|
|
@@ -4387,7 +5540,7 @@ export type BusinessAgentUiSkillInput = {
|
|
|
4387
5540
|
|
|
4388
5541
|
export type component_type = 'carousel_quick_reply' | 'carousel_url' | 'cta_url' | 'flow' | 'image' | 'interactive_list' | 'interactive_reply_buttons' | 'location' | 'location_request';
|
|
4389
5542
|
|
|
4390
|
-
export type
|
|
5543
|
+
export type status15 = 'enabled' | 'disabled';
|
|
4391
5544
|
|
|
4392
5545
|
export type BusinessAgentWebsite = BusinessAgentWebsiteInput & {
|
|
4393
5546
|
id: string;
|
|
@@ -4510,9 +5663,9 @@ export type CalendarEvent = {
|
|
|
4510
5663
|
updatedAt?: (string) | null;
|
|
4511
5664
|
};
|
|
4512
5665
|
|
|
4513
|
-
export type
|
|
5666
|
+
export type visibility2 = 'default' | 'public' | 'private';
|
|
4514
5667
|
|
|
4515
|
-
export type
|
|
5668
|
+
export type status16 = 'confirmed' | 'tentative' | 'cancelled';
|
|
4516
5669
|
|
|
4517
5670
|
export type CalendarEventFields = {
|
|
4518
5671
|
title?: string;
|
|
@@ -4686,7 +5839,7 @@ export type channel = 'whatsapp' | 'pstn';
|
|
|
4686
5839
|
|
|
4687
5840
|
export type direction2 = 'inbound' | 'outbound';
|
|
4688
5841
|
|
|
4689
|
-
export type
|
|
5842
|
+
export type status17 = 'ringing' | 'answered' | 'ended' | 'failed';
|
|
4690
5843
|
|
|
4691
5844
|
/**
|
|
4692
5845
|
* Caller ID presented on the forwarded leg.
|
|
@@ -4710,7 +5863,7 @@ export type CampaignAdjustment = {
|
|
|
4710
5863
|
createdAt: string;
|
|
4711
5864
|
};
|
|
4712
5865
|
|
|
4713
|
-
export type
|
|
5866
|
+
export type kind4 = 'adjustment';
|
|
4714
5867
|
|
|
4715
5868
|
export type CampaignAnalyticsResponse = {
|
|
4716
5869
|
/**
|
|
@@ -4913,7 +6066,7 @@ export type CampaignLedgerEntry = {
|
|
|
4913
6066
|
createdAt: string;
|
|
4914
6067
|
};
|
|
4915
6068
|
|
|
4916
|
-
export type
|
|
6069
|
+
export type kind5 = 'accrual' | 'approval' | 'hold_release' | 'adjustment' | 'settling' | 'settlement' | 'reversal' | 'topup' | 'transfer' | 'fee' | 'usage' | 'grant';
|
|
4917
6070
|
|
|
4918
6071
|
export type CampaignParticipant = {
|
|
4919
6072
|
id: string;
|
|
@@ -4958,7 +6111,7 @@ export type CampaignParticipant = {
|
|
|
4958
6111
|
};
|
|
4959
6112
|
};
|
|
4960
6113
|
|
|
4961
|
-
export type
|
|
6114
|
+
export type status18 = 'invited' | 'active' | 'suspended' | 'removed';
|
|
4962
6115
|
|
|
4963
6116
|
/**
|
|
4964
6117
|
* USD cents in each state. accruing: earned on posts not yet approved. owed: approved and on hold. payable: past the hold, ready to pay. settling: a treasury payout in progress, no longer payable and not reversible by a reject. settled: paid out.
|
|
@@ -5062,7 +6215,7 @@ export type CampaignResultMetric = {
|
|
|
5062
6215
|
/**
|
|
5063
6216
|
* How the value reads: `percent` values are already multiplied by 100.
|
|
5064
6217
|
*/
|
|
5065
|
-
export type
|
|
6218
|
+
export type kind6 = 'count' | 'money' | 'percent' | 'ratio';
|
|
5066
6219
|
|
|
5067
6220
|
export type CampaignSettlement = {
|
|
5068
6221
|
/**
|
|
@@ -5205,7 +6358,7 @@ export type CampaignSubmission = {
|
|
|
5205
6358
|
|
|
5206
6359
|
export type platform4 = 'tiktok' | 'instagram' | 'youtube' | 'threads' | 'pinterest' | 'facebook' | 'twitter';
|
|
5207
6360
|
|
|
5208
|
-
export type
|
|
6361
|
+
export type status19 = 'received' | 'tracking' | 'pending_review' | 'approved' | 'rejected' | 'expired' | 'withdrawn';
|
|
5209
6362
|
|
|
5210
6363
|
/**
|
|
5211
6364
|
* Number of submissions in each status.
|
|
@@ -5349,7 +6502,7 @@ export type CommentAutomationDmMedia = {
|
|
|
5349
6502
|
url: string;
|
|
5350
6503
|
};
|
|
5351
6504
|
|
|
5352
|
-
export type
|
|
6505
|
+
export type type10 = 'image' | 'video' | 'audio' | 'file';
|
|
5353
6506
|
|
|
5354
6507
|
/**
|
|
5355
6508
|
* Copy for the follow gate. Sensible defaults are used for any field left empty.
|
|
@@ -5479,7 +6632,7 @@ export type source = 'comment' | 'live_comment' | 'story_reply' | 'story_mention
|
|
|
5479
6632
|
* - 'gated': the follow-gate confirmation DM went out and we are waiting for the tap. It flips to 'sent' or 'skipped' when they tap.
|
|
5480
6633
|
* - 'skipped': also covers repeatPolicy, cooldown and dedupeSameTextHours suppressions, with the reason in error.
|
|
5481
6634
|
*/
|
|
5482
|
-
export type
|
|
6635
|
+
export type status20 = 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
|
|
5483
6636
|
|
|
5484
6637
|
/**
|
|
5485
6638
|
* How the audience rule resolved. Null on automations without one.
|
|
@@ -5579,7 +6732,7 @@ export type CommentAutomationTemplate = {
|
|
|
5579
6732
|
elements: Array<CommentAutomationTemplateElement>;
|
|
5580
6733
|
};
|
|
5581
6734
|
|
|
5582
|
-
export type
|
|
6735
|
+
export type type11 = 'generic';
|
|
5583
6736
|
|
|
5584
6737
|
/**
|
|
5585
6738
|
* Facebook only. How Messenger renders each element imageUrl: horizontal (1.91:1, the default) or square (1:1). Instagram has no such setting, so an Instagram automation carrying it is a 400.
|
|
@@ -5767,9 +6920,9 @@ export type platform6 = 'shopify';
|
|
|
5767
6920
|
|
|
5768
6921
|
export type method = 'code' | 'automatic';
|
|
5769
6922
|
|
|
5770
|
-
export type
|
|
6923
|
+
export type type12 = 'percentage' | 'fixed_amount' | 'free_shipping' | 'buy_x_get_y' | 'app';
|
|
5771
6924
|
|
|
5772
|
-
export type
|
|
6925
|
+
export type status21 = 'active' | 'scheduled' | 'expired';
|
|
5773
6926
|
|
|
5774
6927
|
export type CommerceImage = {
|
|
5775
6928
|
/**
|
|
@@ -5824,7 +6977,7 @@ export type CommerceMarket = {
|
|
|
5824
6977
|
type?: string;
|
|
5825
6978
|
};
|
|
5826
6979
|
|
|
5827
|
-
export type
|
|
6980
|
+
export type status22 = 'active' | 'draft';
|
|
5828
6981
|
|
|
5829
6982
|
export type CommerceMenu = {
|
|
5830
6983
|
id?: string;
|
|
@@ -5845,7 +6998,7 @@ export type CommerceMenuItem = {
|
|
|
5845
6998
|
items?: Array<CommerceMenuItem>;
|
|
5846
6999
|
};
|
|
5847
7000
|
|
|
5848
|
-
export type
|
|
7001
|
+
export type type13 = 'frontpage' | 'collection' | 'collections' | 'product' | 'catalog' | 'page' | 'blog' | 'article' | 'search' | 'shop_policy' | 'http' | 'metaobject' | 'customer_account_page';
|
|
5849
7002
|
|
|
5850
7003
|
export type CommerceMenuItemInput = {
|
|
5851
7004
|
title: string;
|
|
@@ -6339,7 +7492,7 @@ export type ConnectHandoff = {
|
|
|
6339
7492
|
} | null;
|
|
6340
7493
|
};
|
|
6341
7494
|
|
|
6342
|
-
export type
|
|
7495
|
+
export type status23 = 'waiting' | 'opened' | 'connected' | 'failed' | 'expired';
|
|
6343
7496
|
|
|
6344
7497
|
/**
|
|
6345
7498
|
* Only with `handoff=true`: the link to show as a QR code.
|
|
@@ -6552,7 +7705,7 @@ export type ConversionDestination = {
|
|
|
6552
7705
|
* For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`).
|
|
6553
7706
|
*
|
|
6554
7707
|
*/
|
|
6555
|
-
export type
|
|
7708
|
+
export type status24 = 'active' | 'inactive';
|
|
6556
7709
|
|
|
6557
7710
|
/**
|
|
6558
7711
|
* A single conversion event to relay to the ad platform. All PII fields
|
|
@@ -7086,12 +8239,12 @@ export type CreatorCampaign = {
|
|
|
7086
8239
|
/**
|
|
7087
8240
|
* draft until activated; active accepts submissions and accrues; paused stops new submissions; closed is final.
|
|
7088
8241
|
*/
|
|
7089
|
-
export type
|
|
8242
|
+
export type status25 = 'draft' | 'active' | 'paused' | 'closed';
|
|
7090
8243
|
|
|
7091
8244
|
/**
|
|
7092
8245
|
* Same as economics.type.
|
|
7093
8246
|
*/
|
|
7094
|
-
export type
|
|
8247
|
+
export type type14 = 'cpm' | 'per_post' | 'pool';
|
|
7095
8248
|
|
|
7096
8249
|
/**
|
|
7097
8250
|
* Branding of the hosted join page, in the connect-link branding shape.
|
|
@@ -7270,14 +8423,14 @@ export type CreatorPortalEconomics = {
|
|
|
7270
8423
|
organicViewsOnly?: boolean;
|
|
7271
8424
|
};
|
|
7272
8425
|
|
|
7273
|
-
export type
|
|
8426
|
+
export type type15 = 'cpm';
|
|
7274
8427
|
|
|
7275
8428
|
export type CreatorPortalInvite = {
|
|
7276
8429
|
kind: 'invite';
|
|
7277
8430
|
campaign: CreatorPortalCampaign;
|
|
7278
8431
|
};
|
|
7279
8432
|
|
|
7280
|
-
export type
|
|
8433
|
+
export type kind7 = 'invite';
|
|
7281
8434
|
|
|
7282
8435
|
export type CreatorPortalParticipant = {
|
|
7283
8436
|
kind: 'participant';
|
|
@@ -7331,7 +8484,7 @@ export type CreatorPortalParticipant = {
|
|
|
7331
8484
|
payouts: CreatorPortalPayoutSetup;
|
|
7332
8485
|
};
|
|
7333
8486
|
|
|
7334
|
-
export type
|
|
8487
|
+
export type kind8 = 'participant';
|
|
7335
8488
|
|
|
7336
8489
|
export type CreatorPortalPayoutEntry = {
|
|
7337
8490
|
id: string;
|
|
@@ -7375,7 +8528,7 @@ export type CreatorPortalPayoutSetup = {
|
|
|
7375
8528
|
*/
|
|
7376
8529
|
export type mode2 = 'none' | 'external' | 'treasury';
|
|
7377
8530
|
|
|
7378
|
-
export type
|
|
8531
|
+
export type status26 = 'not_started' | 'pending' | 'enabled' | 'not_applicable';
|
|
7379
8532
|
|
|
7380
8533
|
export type CreatorPortalSubmission = {
|
|
7381
8534
|
id: string;
|
|
@@ -8113,7 +9266,7 @@ export type objective = 'OUTCOME_ENGAGEMENT' | 'OUTCOME_SALES' | 'OUTCOME_LEADS'
|
|
|
8113
9266
|
* `adSetId`, the new ads themselves.
|
|
8114
9267
|
*
|
|
8115
9268
|
*/
|
|
8116
|
-
export type
|
|
9269
|
+
export type status27 = 'ACTIVE' | 'PAUSED';
|
|
8117
9270
|
|
|
8118
9271
|
/**
|
|
8119
9272
|
* Campaign-level status, same semantics as `POST /v1/ads/create`. Defaults to `status`.
|
|
@@ -8527,7 +9680,7 @@ export type privacy_level = 2;
|
|
|
8527
9680
|
/**
|
|
8528
9681
|
* 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED
|
|
8529
9682
|
*/
|
|
8530
|
-
export type
|
|
9683
|
+
export type status28 = 1 | 2 | 3 | 4;
|
|
8531
9684
|
|
|
8532
9685
|
/**
|
|
8533
9686
|
* 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL
|
|
@@ -8561,7 +9714,7 @@ export type DmButton = {
|
|
|
8561
9714
|
phone?: string;
|
|
8562
9715
|
};
|
|
8563
9716
|
|
|
8564
|
-
export type
|
|
9717
|
+
export type type16 = 'url' | 'postback' | 'phone';
|
|
8565
9718
|
|
|
8566
9719
|
export type EmailAddress = {
|
|
8567
9720
|
email: string;
|
|
@@ -8836,7 +9989,7 @@ export type ErrorResponse = {
|
|
|
8836
9989
|
/**
|
|
8837
9990
|
* Error class for programmatic handling.
|
|
8838
9991
|
*/
|
|
8839
|
-
export type
|
|
9992
|
+
export type type17 = 'invalid_request_error' | 'authentication_error' | 'permission_error' | 'not_found' | 'rate_limit_error' | 'platform_error' | 'api_error';
|
|
8840
9993
|
|
|
8841
9994
|
/**
|
|
8842
9995
|
* Meta ad create failures only. The step that failed:
|
|
@@ -8862,6 +10015,46 @@ export type quotaScope = 'DEVELOPER' | 'ACCOUNT';
|
|
|
8862
10015
|
*/
|
|
8863
10016
|
export type budgetScope = 'account' | 'user';
|
|
8864
10017
|
|
|
10018
|
+
/**
|
|
10019
|
+
* One event that reached an event automation.
|
|
10020
|
+
*/
|
|
10021
|
+
export type EventAutomationCheck = {
|
|
10022
|
+
id: string;
|
|
10023
|
+
automationId: string;
|
|
10024
|
+
checkedAt: string;
|
|
10025
|
+
outcome: 'triggered' | 'no_match' | 'cooldown' | 'daily_limit' | 'failed';
|
|
10026
|
+
evaluated: number;
|
|
10027
|
+
event: (string) | null;
|
|
10028
|
+
eventId: (string) | null;
|
|
10029
|
+
/**
|
|
10030
|
+
* What the event was about.
|
|
10031
|
+
*/
|
|
10032
|
+
subject: {
|
|
10033
|
+
kind?: string;
|
|
10034
|
+
id?: string;
|
|
10035
|
+
accountId?: string;
|
|
10036
|
+
} | null;
|
|
10037
|
+
filter: Array<AutomationFactResult>;
|
|
10038
|
+
actions: Array<AutomationRunResult>;
|
|
10039
|
+
error: (string) | null;
|
|
10040
|
+
};
|
|
10041
|
+
|
|
10042
|
+
export type outcome2 = 'triggered' | 'no_match' | 'cooldown' | 'daily_limit' | 'failed';
|
|
10043
|
+
|
|
10044
|
+
/**
|
|
10045
|
+
* Runs when something happens in Zernio, such as a post failing, and notifies. Unknown fields are refused.
|
|
10046
|
+
*/
|
|
10047
|
+
export type EventAutomationDefinition = {
|
|
10048
|
+
name: string;
|
|
10049
|
+
/**
|
|
10050
|
+
* A new event automation is on unless `paused`.
|
|
10051
|
+
*/
|
|
10052
|
+
status?: 'active' | 'paused';
|
|
10053
|
+
trigger: AutomationEventTrigger;
|
|
10054
|
+
steps: Array<AutomationNotifyStep>;
|
|
10055
|
+
limits?: AutomationEventLimits;
|
|
10056
|
+
};
|
|
10057
|
+
|
|
8865
10058
|
export type EventDestination = {
|
|
8866
10059
|
/**
|
|
8867
10060
|
* Event destination ID, used to delete it.
|
|
@@ -8908,7 +10101,7 @@ export type ExternalPostMediaItem = {
|
|
|
8908
10101
|
unavailableReason?: 'platform_withheld';
|
|
8909
10102
|
};
|
|
8910
10103
|
|
|
8911
|
-
export type
|
|
10104
|
+
export type type18 = 'image' | 'video';
|
|
8912
10105
|
|
|
8913
10106
|
/**
|
|
8914
10107
|
* unavailable means the media file could not be retrieved (url is null or, for LinkedIn videos, a cover image standing in for the file). available or absent means the file is available at url (older synced items omit the field).
|
|
@@ -9375,7 +10568,7 @@ export type FeedbackReceipt = {
|
|
|
9375
10568
|
duplicate?: boolean;
|
|
9376
10569
|
};
|
|
9377
10570
|
|
|
9378
|
-
export type
|
|
10571
|
+
export type status29 = 'received';
|
|
9379
10572
|
|
|
9380
10573
|
/**
|
|
9381
10574
|
* A file or folder in a connected Google Drive or OneDrive. Ids are the provider's own.
|
|
@@ -9409,7 +10602,7 @@ export type FileItem = {
|
|
|
9409
10602
|
trashed: boolean;
|
|
9410
10603
|
};
|
|
9411
10604
|
|
|
9412
|
-
export type
|
|
10605
|
+
export type kind9 = 'file' | 'folder';
|
|
9413
10606
|
|
|
9414
10607
|
export type FilePickerSession = {
|
|
9415
10608
|
/**
|
|
@@ -9560,7 +10753,7 @@ export type GoogleAdLabel = {
|
|
|
9560
10753
|
description?: (string) | null;
|
|
9561
10754
|
};
|
|
9562
10755
|
|
|
9563
|
-
export type
|
|
10756
|
+
export type status30 = 'ENABLED' | 'REMOVED' | 'UNKNOWN';
|
|
9564
10757
|
|
|
9565
10758
|
/**
|
|
9566
10759
|
* At least one id across the four target lists. Up to 1000 ids per list.
|
|
@@ -9663,7 +10856,7 @@ export type GoogleAdsManagerLink = {
|
|
|
9663
10856
|
/**
|
|
9664
10857
|
* Status the link has after this call.
|
|
9665
10858
|
*/
|
|
9666
|
-
export type
|
|
10859
|
+
export type status31 = 'PENDING' | 'ACTIVE' | 'REFUSED' | 'CANCELED' | 'INACTIVE';
|
|
9667
10860
|
|
|
9668
10861
|
export type GoogleAdsUserAccessInvitation = {
|
|
9669
10862
|
invitationId?: string;
|
|
@@ -9678,7 +10871,7 @@ export type GoogleAdsUserAccessInvitation = {
|
|
|
9678
10871
|
|
|
9679
10872
|
export type accessRole = 'ADMIN' | 'STANDARD' | 'READ_ONLY' | 'EMAIL_ONLY' | 'UNKNOWN';
|
|
9680
10873
|
|
|
9681
|
-
export type
|
|
10874
|
+
export type status32 = 'PENDING' | 'DECLINED' | 'EXPIRED' | 'UNKNOWN';
|
|
9682
10875
|
|
|
9683
10876
|
export type GoogleAdsUserAccessInvitationResult = {
|
|
9684
10877
|
customerId?: string;
|
|
@@ -9702,7 +10895,7 @@ export type GoogleAdsUserAccessInvitationResult = {
|
|
|
9702
10895
|
/**
|
|
9703
10896
|
* PENDING once the email is sent; PENDING_APPROVAL while Google waits for a second admin's multi-party approval.
|
|
9704
10897
|
*/
|
|
9705
|
-
export type
|
|
10898
|
+
export type status33 = 'PENDING' | 'PENDING_APPROVAL';
|
|
9706
10899
|
|
|
9707
10900
|
export type GoogleAdsUserInvitationApproval = {
|
|
9708
10901
|
/**
|
|
@@ -9979,7 +11172,7 @@ export type topicType = 'STANDARD' | 'EVENT' | 'OFFER';
|
|
|
9979
11172
|
/**
|
|
9980
11173
|
* Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL
|
|
9981
11174
|
*/
|
|
9982
|
-
export type
|
|
11175
|
+
export type type19 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
|
|
9983
11176
|
|
|
9984
11177
|
/**
|
|
9985
11178
|
* A Google Business Profile review, as returned by every gmb-reviews read endpoint.
|
|
@@ -10298,7 +11491,7 @@ export type GoogleListingGroupFilterNode = {
|
|
|
10298
11491
|
} | null;
|
|
10299
11492
|
};
|
|
10300
11493
|
|
|
10301
|
-
export type
|
|
11494
|
+
export type type20 = 'SUBDIVISION' | 'UNIT_INCLUDED' | 'UNIT_EXCLUDED';
|
|
10302
11495
|
|
|
10303
11496
|
export type GoogleListingGroupNode = {
|
|
10304
11497
|
dimension: GoogleListingGroupDimension;
|
|
@@ -10552,7 +11745,7 @@ export type GoogleRecommendationResult = {
|
|
|
10552
11745
|
error?: string;
|
|
10553
11746
|
};
|
|
10554
11747
|
|
|
10555
|
-
export type
|
|
11748
|
+
export type status34 = 'applied' | 'dismissed' | 'failed';
|
|
10556
11749
|
|
|
10557
11750
|
export type GoogleRsaDescription = {
|
|
10558
11751
|
text: string;
|
|
@@ -10695,7 +11888,7 @@ export type ImessageSandboxContact = {
|
|
|
10695
11888
|
createdAt?: string;
|
|
10696
11889
|
};
|
|
10697
11890
|
|
|
10698
|
-
export type
|
|
11891
|
+
export type status35 = 'pending' | 'active';
|
|
10699
11892
|
|
|
10700
11893
|
/**
|
|
10701
11894
|
* An iMessage sender registered as an account on a profile.
|
|
@@ -10763,14 +11956,14 @@ export type ImessageSenderLifecycle = {
|
|
|
10763
11956
|
createdAt?: string;
|
|
10764
11957
|
};
|
|
10765
11958
|
|
|
10766
|
-
export type
|
|
11959
|
+
export type kind10 = 'phone' | 'email';
|
|
10767
11960
|
|
|
10768
11961
|
export type region = 'US' | 'GB';
|
|
10769
11962
|
|
|
10770
11963
|
/**
|
|
10771
11964
|
* `awaiting_payment`: the first-month charge is still being confirmed by the card; the number is ordered automatically once it is paid (usually under 5 minutes), or the order fails with `failureReason` when the card declines or nothing confirms within 30 minutes.
|
|
10772
11965
|
*/
|
|
10773
|
-
export type
|
|
11966
|
+
export type status36 = 'ordering' | 'awaiting_payment' | 'activating' | 'active' | 'suspended' | 'canceled' | 'failed';
|
|
10774
11967
|
|
|
10775
11968
|
/**
|
|
10776
11969
|
* When inbound messages and comments were first and last seen for the account. Only events matched to this account count. WhatsApp delivery statuses for outbound messages do not count, so the stamps of a number that only sends stay null. The stamps reset on every connect.
|
|
@@ -10978,7 +12171,7 @@ export type InboxWebhookConversation = {
|
|
|
10978
12171
|
contactId?: string;
|
|
10979
12172
|
};
|
|
10980
12173
|
|
|
10981
|
-
export type
|
|
12174
|
+
export type status37 = 'active' | 'archived';
|
|
10982
12175
|
|
|
10983
12176
|
/**
|
|
10984
12177
|
* The conversation object included in conversation lifecycle webhook payloads (conversation.started, conversation.control_changed).
|
|
@@ -11739,7 +12932,7 @@ export type InstagramVideoFallback = {
|
|
|
11739
12932
|
};
|
|
11740
12933
|
};
|
|
11741
12934
|
|
|
11742
|
-
export type
|
|
12935
|
+
export type kind11 = 'instagram_video_reuploaded' | 'instagram_video_rehosted_copy';
|
|
11743
12936
|
|
|
11744
12937
|
/**
|
|
11745
12938
|
* A Google Search keyword: a bare string (BROAD match), or an object naming the match type.
|
|
@@ -12403,7 +13596,7 @@ export type MediaItem = {
|
|
|
12403
13596
|
/**
|
|
12404
13597
|
* Optional when the item names a connected file (`fileId`): inferred from the file's MIME type.
|
|
12405
13598
|
*/
|
|
12406
|
-
export type
|
|
13599
|
+
export type type21 = 'image' | 'video' | 'gif' | 'document';
|
|
12407
13600
|
|
|
12408
13601
|
export type MediaSubtitle = {
|
|
12409
13602
|
/**
|
|
@@ -12658,7 +13851,7 @@ export type availability = 'in stock' | 'out of stock' | 'preorder' | 'available
|
|
|
12658
13851
|
|
|
12659
13852
|
export type condition2 = 'new' | 'refurbished' | 'used';
|
|
12660
13853
|
|
|
12661
|
-
export type
|
|
13854
|
+
export type visibility3 = 'published' | 'staging';
|
|
12662
13855
|
|
|
12663
13856
|
export type gender2 = 'female' | 'male' | 'unisex';
|
|
12664
13857
|
|
|
@@ -13127,7 +14320,7 @@ export type OAuthApp = {
|
|
|
13127
14320
|
/**
|
|
13128
14321
|
* `ok`: the platform accepted the keys at the last check. `unchecked`: the check could not reach a verdict (see lastError). `invalid`: the platform rejected the keys; connects and token refreshes through this app will fail until the secret is rotated.
|
|
13129
14322
|
*/
|
|
13130
|
-
export type
|
|
14323
|
+
export type status38 = 'ok' | 'unchecked' | 'invalid';
|
|
13131
14324
|
|
|
13132
14325
|
export type OAuthAppSetup = {
|
|
13133
14326
|
platform: string;
|
|
@@ -13342,7 +14535,7 @@ export type OwnedPhoneNumber = {
|
|
|
13342
14535
|
}>;
|
|
13343
14536
|
};
|
|
13344
14537
|
|
|
13345
|
-
export type
|
|
14538
|
+
export type status39 = 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'provisioning' | 'verifying' | 'active' | 'suspended' | 'releasing' | 'released';
|
|
13346
14539
|
|
|
13347
14540
|
export type metaVerificationStatus = 'pending' | 'code_requested' | 'verified' | 'expired';
|
|
13348
14541
|
|
|
@@ -13353,6 +14546,11 @@ export type Pagination = {
|
|
|
13353
14546
|
pages?: number;
|
|
13354
14547
|
};
|
|
13355
14548
|
|
|
14549
|
+
/**
|
|
14550
|
+
* How many whole days before today to replay. Today is not replayed.
|
|
14551
|
+
*/
|
|
14552
|
+
export type ParameterAutomationBacktestDays = number;
|
|
14553
|
+
|
|
13356
14554
|
/**
|
|
13357
14555
|
* WhatsApp social account id (the number must be managed through the Cloud API).
|
|
13358
14556
|
*/
|
|
@@ -13474,7 +14672,7 @@ export type PayoutBatch = {
|
|
|
13474
14672
|
/**
|
|
13475
14673
|
* `awaiting_payment` until the card charge succeeds (3D Secure included); `paying` while transfers go out; then `paid`, `partially_failed` (some items failed or were skipped), `failed` (the card was declined, or none paid) or `expired` (the payment was cancelled unpaid, every amount is payable again).
|
|
13476
14674
|
*/
|
|
13477
|
-
export type
|
|
14675
|
+
export type status40 = 'awaiting_payment' | 'paying' | 'paid' | 'partially_failed' | 'failed' | 'expired';
|
|
13478
14676
|
|
|
13479
14677
|
export type method2 = 'card';
|
|
13480
14678
|
|
|
@@ -13513,7 +14711,7 @@ export type PayoutBatchItem = {
|
|
|
13513
14711
|
/**
|
|
13514
14712
|
* `skipped`: not paid because payout setup was not finished, or the card payment never completed; the amount is payable again. `failed`: Stripe refused the transfer; the amount is payable again.
|
|
13515
14713
|
*/
|
|
13516
|
-
export type
|
|
14714
|
+
export type status41 = 'pending' | 'paid' | 'failed' | 'skipped';
|
|
13517
14715
|
|
|
13518
14716
|
export type PhoneNumberStockWatch = {
|
|
13519
14717
|
id: string;
|
|
@@ -13631,7 +14829,7 @@ export type PlatformAnalytics = {
|
|
|
13631
14829
|
isOwner?: (boolean) | null;
|
|
13632
14830
|
};
|
|
13633
14831
|
|
|
13634
|
-
export type
|
|
14832
|
+
export type status42 = 'published' | 'failed';
|
|
13635
14833
|
|
|
13636
14834
|
/**
|
|
13637
14835
|
* Sync state of analytics for this platform
|
|
@@ -13833,7 +15031,7 @@ export type PortfolioBidStrategy = {
|
|
|
13833
15031
|
targetImpressionShare?: (GoogleTargetImpressionShare | null);
|
|
13834
15032
|
};
|
|
13835
15033
|
|
|
13836
|
-
export type
|
|
15034
|
+
export type type22 = 'TARGET_CPA' | 'TARGET_ROAS' | 'MAXIMIZE_CONVERSIONS' | 'MAXIMIZE_CONVERSION_VALUE' | 'TARGET_IMPRESSION_SHARE';
|
|
13837
15035
|
|
|
13838
15036
|
export type Post = {
|
|
13839
15037
|
_id?: string;
|
|
@@ -13894,9 +15092,9 @@ export type Post = {
|
|
|
13894
15092
|
/**
|
|
13895
15093
|
* `cancelled` is set by POST /v1/posts/{postId}/unpublish once every platform entry has been removed from its platform (a post with published entries left becomes `partial`); cancelled posts can be edited and rescheduled like drafts. `pending_approval` (set by `requiresApproval: true`) never publishes until POST /v1/posts/{postId}/review approves it.
|
|
13896
15094
|
*/
|
|
13897
|
-
export type
|
|
15095
|
+
export type status43 = 'draft' | 'pending_approval' | 'scheduled' | 'publishing' | 'published' | 'partial' | 'failed' | 'cancelled';
|
|
13898
15096
|
|
|
13899
|
-
export type
|
|
15097
|
+
export type visibility4 = 'public' | 'private' | 'unlisted';
|
|
13900
15098
|
|
|
13901
15099
|
export type PostAnalytics = {
|
|
13902
15100
|
impressions?: number;
|
|
@@ -14245,7 +15443,7 @@ export type Product = {
|
|
|
14245
15443
|
publishedAt?: (string) | null;
|
|
14246
15444
|
};
|
|
14247
15445
|
|
|
14248
|
-
export type
|
|
15446
|
+
export type status44 = 'active' | 'draft' | 'archived';
|
|
14249
15447
|
|
|
14250
15448
|
export type ProductImage = {
|
|
14251
15449
|
url?: string;
|
|
@@ -14464,7 +15662,7 @@ export type RcsAgent = {
|
|
|
14464
15662
|
createdAt?: string;
|
|
14465
15663
|
};
|
|
14466
15664
|
|
|
14467
|
-
export type
|
|
15665
|
+
export type status45 = 'requested' | 'changes_requested' | 'brand_vetting' | 'agent_review' | 'testing' | 'launch_review' | 'launching' | 'live' | 'rejected' | 'deactivated';
|
|
14468
15666
|
|
|
14469
15667
|
export type useCase = 'MULTI_USE' | 'PROMOTIONAL' | 'TRANSACTIONAL' | 'OTP';
|
|
14470
15668
|
|
|
@@ -14516,7 +15714,7 @@ export type RcsBrand = RcsBrandInput & {
|
|
|
14516
15714
|
/**
|
|
14517
15715
|
* draft = not filed yet (still editable).
|
|
14518
15716
|
*/
|
|
14519
|
-
export type
|
|
15717
|
+
export type status46 = 'draft' | 'vetting' | 'verified' | 'rejected';
|
|
14520
15718
|
|
|
14521
15719
|
export type RcsBrandInput = {
|
|
14522
15720
|
displayName: string;
|
|
@@ -14603,7 +15801,7 @@ export type RcsCarrierApproval = {
|
|
|
14603
15801
|
|
|
14604
15802
|
export type scope3 = 'carrier' | 'hub' | 'bot';
|
|
14605
15803
|
|
|
14606
|
-
export type
|
|
15804
|
+
export type status47 = 'PENDING' | 'SUBMITTED' | 'APPROVED' | 'REJECTED';
|
|
14607
15805
|
|
|
14608
15806
|
/**
|
|
14609
15807
|
* Message content. `suggestions` (max 11) render as chips under the message.
|
|
@@ -14629,7 +15827,7 @@ export type RcsContent = {
|
|
|
14629
15827
|
suggestions?: Array<RcsSuggestion>;
|
|
14630
15828
|
};
|
|
14631
15829
|
|
|
14632
|
-
export type
|
|
15830
|
+
export type type23 = 'text';
|
|
14633
15831
|
|
|
14634
15832
|
export type orientation = 'VERTICAL' | 'HORIZONTAL';
|
|
14635
15833
|
|
|
@@ -14742,7 +15940,7 @@ export type RcsSuggestion = {
|
|
|
14742
15940
|
postbackData?: string;
|
|
14743
15941
|
};
|
|
14744
15942
|
|
|
14745
|
-
export type
|
|
15943
|
+
export type type24 = 'reply';
|
|
14746
15944
|
|
|
14747
15945
|
export type application = 'BROWSER' | 'WEBVIEW';
|
|
14748
15946
|
|
|
@@ -15102,6 +16300,55 @@ export type RfPrediction = {
|
|
|
15102
16300
|
expiresAt?: (string) | null;
|
|
15103
16301
|
};
|
|
15104
16302
|
|
|
16303
|
+
/**
|
|
16304
|
+
* One check of a scheduled automation.
|
|
16305
|
+
*/
|
|
16306
|
+
export type ScheduledAutomationCheck = {
|
|
16307
|
+
id: string;
|
|
16308
|
+
automationId: string;
|
|
16309
|
+
checkedAt: string;
|
|
16310
|
+
outcome: 'triggered' | 'no_match' | 'cooldown' | 'daily_limit' | 'failed';
|
|
16311
|
+
/**
|
|
16312
|
+
* Posts judged.
|
|
16313
|
+
*/
|
|
16314
|
+
evaluated: number;
|
|
16315
|
+
/**
|
|
16316
|
+
* The oldest analytics sync among the posts judged: their numbers are as of then.
|
|
16317
|
+
*/
|
|
16318
|
+
analyticsSyncedAt: (string) | null;
|
|
16319
|
+
/**
|
|
16320
|
+
* Up to 20 matching posts.
|
|
16321
|
+
*/
|
|
16322
|
+
matched: Array<{
|
|
16323
|
+
postId?: string;
|
|
16324
|
+
accountId?: string;
|
|
16325
|
+
platform?: string;
|
|
16326
|
+
url?: (string) | null;
|
|
16327
|
+
filter?: Array<AutomationFactResult>;
|
|
16328
|
+
}>;
|
|
16329
|
+
actions: Array<(AutomationRunResult & {
|
|
16330
|
+
postId?: string;
|
|
16331
|
+
})>;
|
|
16332
|
+
error: (string) | null;
|
|
16333
|
+
};
|
|
16334
|
+
|
|
16335
|
+
/**
|
|
16336
|
+
* Checks a profile's recent posts on a schedule. Each post that matches `filter` is notified about, and can be boosted. At most 20 posts are acted on per check. Unknown fields are refused.
|
|
16337
|
+
*
|
|
16338
|
+
*/
|
|
16339
|
+
export type ScheduledAutomationDefinition = {
|
|
16340
|
+
name: string;
|
|
16341
|
+
/**
|
|
16342
|
+
* A new scheduled automation is on unless `paused`.
|
|
16343
|
+
*/
|
|
16344
|
+
status?: 'active' | 'paused';
|
|
16345
|
+
trigger: AutomationPostSchedule;
|
|
16346
|
+
subjects: AutomationPostSubjects;
|
|
16347
|
+
filter?: AutomationFactCondition;
|
|
16348
|
+
steps: Array<(AutomationNotifyStep | AutomationBoostStep)>;
|
|
16349
|
+
limits?: AutomationEventLimits;
|
|
16350
|
+
};
|
|
16351
|
+
|
|
15105
16352
|
export type SendEmailRequest = {
|
|
15106
16353
|
accountId: string;
|
|
15107
16354
|
to: Array<EmailAddress>;
|
|
@@ -15535,7 +16782,7 @@ export type SupportRun = {
|
|
|
15535
16782
|
/**
|
|
15536
16783
|
* queued and running are in progress. needs_human means the assistant handed the question to a person instead of answering; when `supportTicket` is set, a Zernio teammate has been notified and will follow up by email.
|
|
15537
16784
|
*/
|
|
15538
|
-
export type
|
|
16785
|
+
export type status48 = 'queued' | 'running' | 'completed' | 'needs_human' | 'failed';
|
|
15539
16786
|
|
|
15540
16787
|
/**
|
|
15541
16788
|
* Why the run stopped. Null while it is in progress.
|
|
@@ -16311,7 +17558,7 @@ export type platform15 = 'metaads' | 'openaiads' | 'tiktokads' | 'googleads' | '
|
|
|
16311
17558
|
/**
|
|
16312
17559
|
* Platform-native flavor of the tag (Meta: `pixel`).
|
|
16313
17560
|
*/
|
|
16314
|
-
export type
|
|
17561
|
+
export type kind12 = 'pixel' | 'tag' | 'insight_tag';
|
|
16315
17562
|
|
|
16316
17563
|
/**
|
|
16317
17564
|
* One health check the platform runs on a tracking tag.
|
|
@@ -16498,7 +17745,7 @@ export type TrackingWindow = {
|
|
|
16498
17745
|
} | null;
|
|
16499
17746
|
};
|
|
16500
17747
|
|
|
16501
|
-
export type
|
|
17748
|
+
export type status49 = 'open' | 'completing' | 'completed' | 'cancelled';
|
|
16502
17749
|
|
|
16503
17750
|
/**
|
|
16504
17751
|
* How the window closed. Null while it is open.
|
|
@@ -16588,7 +17835,7 @@ export type purpose = 'balance' | 'payout_batch';
|
|
|
16588
17835
|
/**
|
|
16589
17836
|
* `pending` until the card is charged (or 3D Secure is finished) and credited. `expired` means it ended unpaid: cancelled, or 3D Secure left unfinished for 30 minutes. Only `pending` counts toward pendingTopupCents.
|
|
16590
17837
|
*/
|
|
16591
|
-
export type
|
|
17838
|
+
export type status50 = 'pending' | 'succeeded' | 'failed' | 'expired';
|
|
16592
17839
|
|
|
16593
17840
|
export type TreasuryTransfer = {
|
|
16594
17841
|
id?: string;
|
|
@@ -16629,7 +17876,7 @@ export type TreasuryTransfer = {
|
|
|
16629
17876
|
|
|
16630
17877
|
export type destinationType = 'creator' | 'ad_account';
|
|
16631
17878
|
|
|
16632
|
-
export type
|
|
17879
|
+
export type status51 = 'pending' | 'paid' | 'failed' | 'reversed';
|
|
16633
17880
|
|
|
16634
17881
|
/**
|
|
16635
17882
|
* X-specific post options. The article field creates a long-form X Article and is mutually exclusive with tweet media and tweet-only options. Geo-restriction applies at the media level: media is hidden outside the specified countries while tweet text remains visible.
|
|
@@ -16754,7 +18001,7 @@ export type UploadedFile = {
|
|
|
16754
18001
|
mimeType?: string;
|
|
16755
18002
|
};
|
|
16756
18003
|
|
|
16757
|
-
export type
|
|
18004
|
+
export type type25 = 'image' | 'video' | 'document';
|
|
16758
18005
|
|
|
16759
18006
|
export type UploadTokenResponse = {
|
|
16760
18007
|
token?: string;
|
|
@@ -16763,7 +18010,7 @@ export type UploadTokenResponse = {
|
|
|
16763
18010
|
status?: 'pending' | 'completed' | 'expired';
|
|
16764
18011
|
};
|
|
16765
18012
|
|
|
16766
|
-
export type
|
|
18013
|
+
export type status52 = 'pending' | 'completed' | 'expired';
|
|
16767
18014
|
|
|
16768
18015
|
export type UploadTokenStatusResponse = {
|
|
16769
18016
|
token?: string;
|
|
@@ -17272,7 +18519,7 @@ export type Verification = {
|
|
|
17272
18519
|
resend?: boolean;
|
|
17273
18520
|
};
|
|
17274
18521
|
|
|
17275
|
-
export type
|
|
18522
|
+
export type status53 = 'pending' | 'approved' | 'expired' | 'max_attempts_reached' | 'canceled' | 'delivery_failed';
|
|
17276
18523
|
|
|
17277
18524
|
export type channel5 = 'sms' | 'whatsapp';
|
|
17278
18525
|
|
|
@@ -17487,7 +18734,7 @@ export type WebhookLog = {
|
|
|
17487
18734
|
/**
|
|
17488
18735
|
* Delivery outcome
|
|
17489
18736
|
*/
|
|
17490
|
-
export type
|
|
18737
|
+
export type status54 = 'success' | 'failed';
|
|
17491
18738
|
|
|
17492
18739
|
/**
|
|
17493
18740
|
* Webhook payload for `account.ads.initial_sync_completed` events.
|
|
@@ -17601,7 +18848,7 @@ export type event = 'account.ads.initial_sync_completed';
|
|
|
17601
18848
|
/**
|
|
17602
18849
|
* Overall outcome of the initial sync.
|
|
17603
18850
|
*/
|
|
17604
|
-
export type
|
|
18851
|
+
export type status55 = 'success' | 'failure';
|
|
17605
18852
|
|
|
17606
18853
|
/**
|
|
17607
18854
|
* Stable category for UX branching. New values may be added; existing ones are stable.
|
|
@@ -18111,7 +19358,7 @@ export type WebhookPayloadAdReview = {
|
|
|
18111
19358
|
|
|
18112
19359
|
export type event11 = 'ad.review.approved' | 'ad.review.rejected';
|
|
18113
19360
|
|
|
18114
|
-
export type
|
|
19361
|
+
export type status56 = 'approved' | 'rejected';
|
|
18115
19362
|
|
|
18116
19363
|
/**
|
|
18117
19364
|
* Webhook payload for the `ad_rule.triggered` event.
|
|
@@ -18566,7 +19813,7 @@ export type event15 = 'ad.video.processed';
|
|
|
18566
19813
|
/**
|
|
18567
19814
|
* `ready`: usable as `video.id` on the create endpoints. `error`: Meta could not process it; upload again.
|
|
18568
19815
|
*/
|
|
18569
|
-
export type
|
|
19816
|
+
export type status57 = 'ready' | 'error';
|
|
18570
19817
|
|
|
18571
19818
|
/**
|
|
18572
19819
|
* Webhook payload for `analytics.synced`. Fired once per connected account each time its analytics sync cycle completes successfully. Poll-driven (roughly hourly per account), not real-time, and never fired for a skipped or failed cycle.
|
|
@@ -18707,7 +19954,7 @@ export type WebhookPayloadAutomationAction = {
|
|
|
18707
19954
|
|
|
18708
19955
|
export type event18 = 'automation.action.applied' | 'automation.action.failed' | 'automation.action.unknown';
|
|
18709
19956
|
|
|
18710
|
-
export type
|
|
19957
|
+
export type status58 = 'applied' | 'skipped' | 'failed' | 'unknown';
|
|
18711
19958
|
|
|
18712
19959
|
/**
|
|
18713
19960
|
* Webhook payload for `automation.alert.opened`, `automation.alert.escalated` and `automation.alert.resolved`: an alert episode of an automation with a lifecycle (an ad rule's `lifecycle`).
|
|
@@ -18805,8 +20052,6 @@ export type WebhookPayloadAutomationCheckCompleted = {
|
|
|
18805
20052
|
|
|
18806
20053
|
export type event20 = 'automation.check.completed';
|
|
18807
20054
|
|
|
18808
|
-
export type outcome2 = 'triggered' | 'no_match' | 'cooldown' | 'daily_limit' | 'failed';
|
|
18809
|
-
|
|
18810
20055
|
/**
|
|
18811
20056
|
* Webhook payload for calendar.event.created, calendar.event.updated and calendar.event.deleted. Carries the provider event id and the change only; read the event with `GET /v1/calendar/events/{id}` (deleted ids answer 404).
|
|
18812
20057
|
*/
|
|
@@ -19626,7 +20871,7 @@ export type WebhookPayloadCommerceOrder = {
|
|
|
19626
20871
|
|
|
19627
20872
|
export type event33 = 'commerce.order.created' | 'commerce.order.updated' | 'commerce.order.refunded';
|
|
19628
20873
|
|
|
19629
|
-
export type
|
|
20874
|
+
export type type26 = 'order';
|
|
19630
20875
|
|
|
19631
20876
|
export type WebhookPayloadCommerceProduct = {
|
|
19632
20877
|
/**
|
|
@@ -19669,7 +20914,7 @@ export type WebhookPayloadCommerceProduct = {
|
|
|
19669
20914
|
|
|
19670
20915
|
export type event34 = 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted';
|
|
19671
20916
|
|
|
19672
|
-
export type
|
|
20917
|
+
export type type27 = 'product';
|
|
19673
20918
|
|
|
19674
20919
|
/**
|
|
19675
20920
|
* Webhook payload for contact.updated and contact.deleted, fired after a provider contacts sync (Google Contacts, Outlook) changed a contact. contact.updated also fires after a WhatsApp coexistence address-book change (WhatsApp never fires contact.deleted). Read the contact with `GET /v1/contacts/{id}`.
|
|
@@ -21383,7 +22628,7 @@ export type event53 = 'post.platform.published' | 'post.platform.failed' | 'post
|
|
|
21383
22628
|
/**
|
|
21384
22629
|
* Terminal status this event fires on. Matches the event suffix.
|
|
21385
22630
|
*/
|
|
21386
|
-
export type
|
|
22631
|
+
export type status59 = 'published' | 'failed' | 'deleted';
|
|
21387
22632
|
|
|
21388
22633
|
/**
|
|
21389
22634
|
* Webhook payload for `post.tracking_completed`. Fired once when a post's tracking window ends and its final analytics read has run.
|
|
@@ -21949,7 +23194,7 @@ export type event65 = 'whatsapp.account.name_status_updated';
|
|
|
21949
23194
|
/**
|
|
21950
23195
|
* Normalized from Meta's `decision` (REJECTED -> DECLINED, DEFERRED -> PENDING_REVIEW; the review is still open on DEFERRED, not a rejection).
|
|
21951
23196
|
*/
|
|
21952
|
-
export type
|
|
23197
|
+
export type status60 = 'APPROVED' | 'DECLINED' | 'PENDING_REVIEW';
|
|
21953
23198
|
|
|
21954
23199
|
/**
|
|
21955
23200
|
* Webhook payload for `whatsapp.account.quality_updated`. Fired when a connected
|
|
@@ -22083,7 +23328,7 @@ export type event67 = 'whatsapp.account.status_updated';
|
|
|
22083
23328
|
/**
|
|
22084
23329
|
* `active` only on a reinstatement (DISABLED_UPDATE with ban state REINSTATE).
|
|
22085
23330
|
*/
|
|
22086
|
-
export type
|
|
23331
|
+
export type status61 = 'restricted' | 'active';
|
|
22087
23332
|
|
|
22088
23333
|
/**
|
|
22089
23334
|
* Webhook payload for the `whatsapp.contact.identity_changed` event. Fired when
|
|
@@ -22299,7 +23544,7 @@ export type event70 = 'whatsapp.template.status_updated';
|
|
|
22299
23544
|
* request before the template is actually removed.
|
|
22300
23545
|
*
|
|
22301
23546
|
*/
|
|
22302
|
-
export type
|
|
23547
|
+
export type status62 = 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
|
|
22303
23548
|
|
|
22304
23549
|
export type WebhookPayloadWorkflowRun = {
|
|
22305
23550
|
/**
|
|
@@ -22363,7 +23608,7 @@ export type event71 = 'workflow.run.started' | 'workflow.run.completed' | 'workf
|
|
|
22363
23608
|
/**
|
|
22364
23609
|
* running on workflow.run.started; completed or exited (ended on purpose before the last node, e.g. a handoff) on workflow.run.completed; failed on workflow.run.failed.
|
|
22365
23610
|
*/
|
|
22366
|
-
export type
|
|
23611
|
+
export type status63 = 'running' | 'waiting' | 'completed' | 'exited' | 'failed';
|
|
22367
23612
|
|
|
22368
23613
|
/**
|
|
22369
23614
|
* The profiles this event belongs to, each with the externalId you set on it (null when none is set). Use it to route the event to your tenant without storing Zernio profile ids.
|
|
@@ -22639,7 +23884,7 @@ export type WhatsAppTemplateButton = {
|
|
|
22639
23884
|
navigate_screen?: string;
|
|
22640
23885
|
};
|
|
22641
23886
|
|
|
22642
|
-
export type
|
|
23887
|
+
export type type28 = 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog';
|
|
22643
23888
|
|
|
22644
23889
|
/**
|
|
22645
23890
|
* Required when type is otp
|
|
@@ -22681,7 +23926,7 @@ export type WhatsAppTemplateLookupError = {
|
|
|
22681
23926
|
};
|
|
22682
23927
|
};
|
|
22683
23928
|
|
|
22684
|
-
export type
|
|
23929
|
+
export type type29 = 'platform_error';
|
|
22685
23930
|
|
|
22686
23931
|
export type code3 = 'platform_api_error';
|
|
22687
23932
|
|
|
@@ -22763,7 +24008,7 @@ export type WorkflowExecutionEvent = {
|
|
|
22763
24008
|
|
|
22764
24009
|
export type action2 = 'execution_started' | 'execution_completed' | 'execution_exited' | 'execution_paused' | 'execution_resumed' | 'node_started' | 'node_completed' | 'node_failed' | 'node_skipped';
|
|
22765
24010
|
|
|
22766
|
-
export type
|
|
24011
|
+
export type status64 = 'success' | 'failed' | 'pending';
|
|
22767
24012
|
|
|
22768
24013
|
/**
|
|
22769
24014
|
* A node in a workflow graph. `config` shape depends on `type`.
|
|
@@ -22909,7 +24154,7 @@ export type WorkflowNode = {
|
|
|
22909
24154
|
* integrations (webhook, hubspot_upsert_contact, ai, handoff, start_call).
|
|
22910
24155
|
*
|
|
22911
24156
|
*/
|
|
22912
|
-
export type
|
|
24157
|
+
export type type30 = 'trigger' | 'send_message' | 'wait_for_reply' | 'condition' | 'set_variable' | 'delay' | 'webhook' | 'hubspot_upsert_contact' | 'ai' | 'handoff' | 'start_call' | 'a_b_split' | 'set_field' | 'enroll_sequence' | 'add_tag' | 'remove_tag' | 'end';
|
|
22913
24158
|
|
|
22914
24159
|
/**
|
|
22915
24160
|
* A single X API operation with its per-call price and the Zernio platform methods that trigger it.
|
|
@@ -23045,7 +24290,7 @@ export type XArticleBlock = {
|
|
|
23045
24290
|
entity_ranges?: Array<XArticleEntityRange>;
|
|
23046
24291
|
};
|
|
23047
24292
|
|
|
23048
|
-
export type
|
|
24293
|
+
export type type31 = 'unstyled' | 'header-one' | 'header-two' | 'header-three' | 'unordered-list-item' | 'ordered-list-item' | 'blockquote' | 'atomic';
|
|
23049
24294
|
|
|
23050
24295
|
/**
|
|
23051
24296
|
* X's snake_case content-state shape. Standard DraftJS camelCase fields such as entityMap, inlineStyleRanges, and entityRanges are rejected.
|
|
@@ -23124,7 +24369,7 @@ export type XArticleEntity = {
|
|
|
23124
24369
|
|
|
23125
24370
|
export type mutability = 'immutable' | 'mutable' | 'segmented';
|
|
23126
24371
|
|
|
23127
|
-
export type
|
|
24372
|
+
export type type32 = 'divider' | 'latex';
|
|
23128
24373
|
|
|
23129
24374
|
/**
|
|
23130
24375
|
* The referenced entity must exist, and offset plus length must not exceed the containing block's text length.
|
|
@@ -52608,6 +53853,739 @@ export type RemoveAdKeywordResponse = ({
|
|
|
52608
53853
|
|
|
52609
53854
|
export type RemoveAdKeywordError = (ErrorResponse);
|
|
52610
53855
|
|
|
53856
|
+
export type ListAutomationsData = {
|
|
53857
|
+
query?: {
|
|
53858
|
+
/**
|
|
53859
|
+
* Only automations on this account: the ads connection of an ad rule, or one of the `accountIds` of an event or scheduled automation.
|
|
53860
|
+
*/
|
|
53861
|
+
accountId?: string;
|
|
53862
|
+
/**
|
|
53863
|
+
* Only ad rules checking this platform ad account.
|
|
53864
|
+
*/
|
|
53865
|
+
adAccountId?: string;
|
|
53866
|
+
/**
|
|
53867
|
+
* `nextCursor` from the previous page.
|
|
53868
|
+
*/
|
|
53869
|
+
cursor?: string;
|
|
53870
|
+
limit?: number;
|
|
53871
|
+
};
|
|
53872
|
+
};
|
|
53873
|
+
|
|
53874
|
+
export type ListAutomationsResponse = ({
|
|
53875
|
+
automations: Array<Automation>;
|
|
53876
|
+
/**
|
|
53877
|
+
* Null on the last page.
|
|
53878
|
+
*/
|
|
53879
|
+
nextCursor: (string) | null;
|
|
53880
|
+
});
|
|
53881
|
+
|
|
53882
|
+
export type ListAutomationsError = (ErrorResponse);
|
|
53883
|
+
|
|
53884
|
+
export type CreateAutomationData = {
|
|
53885
|
+
body: AutomationDefinition;
|
|
53886
|
+
headers?: {
|
|
53887
|
+
/**
|
|
53888
|
+
* Optional client-generated unique key (e.g. a UUID) that makes retries safe.
|
|
53889
|
+
*
|
|
53890
|
+
* - Same key + same body: replays the original response.
|
|
53891
|
+
* - Same key + different body: 422.
|
|
53892
|
+
* - Key still processing: 409.
|
|
53893
|
+
*
|
|
53894
|
+
* A request cut off mid-handler (e.g. by a function timeout) can leave its key in progress, answering 409 until the key expires after 24 hours.
|
|
53895
|
+
*
|
|
53896
|
+
* On the Ads create, boost and duplicate endpoints, a same-body retry runs again once the cut-off request started more than 15 minutes ago.
|
|
53897
|
+
*
|
|
53898
|
+
*/
|
|
53899
|
+
'Idempotency-Key'?: string;
|
|
53900
|
+
};
|
|
53901
|
+
};
|
|
53902
|
+
|
|
53903
|
+
export type CreateAutomationResponse = ({
|
|
53904
|
+
automation: Automation;
|
|
53905
|
+
});
|
|
53906
|
+
|
|
53907
|
+
export type CreateAutomationError = ((ErrorResponse & {
|
|
53908
|
+
details?: AutomationProblems;
|
|
53909
|
+
}) | ErrorResponse | unknown);
|
|
53910
|
+
|
|
53911
|
+
export type GetAutomationCatalogResponse = ({
|
|
53912
|
+
/**
|
|
53913
|
+
* JSON Schema of the body of `POST /v1/automations`.
|
|
53914
|
+
*/
|
|
53915
|
+
schema: {
|
|
53916
|
+
[key: string]: unknown;
|
|
53917
|
+
};
|
|
53918
|
+
triggers: Array<{
|
|
53919
|
+
kind: 'ad_rule' | 'event' | 'scheduled';
|
|
53920
|
+
/**
|
|
53921
|
+
* `schedule`, or the Zernio event name.
|
|
53922
|
+
*/
|
|
53923
|
+
type: string;
|
|
53924
|
+
/**
|
|
53925
|
+
* Event triggers only.
|
|
53926
|
+
*/
|
|
53927
|
+
label?: string;
|
|
53928
|
+
/**
|
|
53929
|
+
* What an event is about, such as `post` or `account`.
|
|
53930
|
+
*/
|
|
53931
|
+
subject?: string;
|
|
53932
|
+
/**
|
|
53933
|
+
* Which of `profileId` and `accountIds` an event trigger needs.
|
|
53934
|
+
*/
|
|
53935
|
+
scope?: {
|
|
53936
|
+
[key: string]: unknown;
|
|
53937
|
+
};
|
|
53938
|
+
/**
|
|
53939
|
+
* The facts a `filter` can compare, for an event trigger.
|
|
53940
|
+
*/
|
|
53941
|
+
facts?: Array<{
|
|
53942
|
+
name?: string;
|
|
53943
|
+
type?: 'string' | 'number' | 'boolean';
|
|
53944
|
+
description?: string;
|
|
53945
|
+
}>;
|
|
53946
|
+
/**
|
|
53947
|
+
* Scheduled trigger only: what it can check (`post`), with the facts of each.
|
|
53948
|
+
*/
|
|
53949
|
+
subjects?: Array<{
|
|
53950
|
+
[key: string]: unknown;
|
|
53951
|
+
}>;
|
|
53952
|
+
every?: Array<(string)>;
|
|
53953
|
+
/**
|
|
53954
|
+
* Ad rule trigger only: the weekly set times it takes.
|
|
53955
|
+
*/
|
|
53956
|
+
times?: {
|
|
53957
|
+
[key: string]: unknown;
|
|
53958
|
+
};
|
|
53959
|
+
filterOperators?: Array<(string)>;
|
|
53960
|
+
steps?: Array<(string)>;
|
|
53961
|
+
/**
|
|
53962
|
+
* Scheduled trigger only: the platforms, goals, most days and most boosts a day of `ads.boost_post`.
|
|
53963
|
+
*/
|
|
53964
|
+
boost?: {
|
|
53965
|
+
[key: string]: unknown;
|
|
53966
|
+
};
|
|
53967
|
+
limits?: Array<(string)>;
|
|
53968
|
+
}>;
|
|
53969
|
+
/**
|
|
53970
|
+
* Ad rule subjects.
|
|
53971
|
+
*/
|
|
53972
|
+
subjects: Array<{
|
|
53973
|
+
each?: 'campaign' | 'adset' | 'ad';
|
|
53974
|
+
platforms?: Array<(string)>;
|
|
53975
|
+
metrics?: Array<{
|
|
53976
|
+
metric?: string;
|
|
53977
|
+
platforms?: Array<(string)>;
|
|
53978
|
+
}>;
|
|
53979
|
+
steps?: Array<{
|
|
53980
|
+
type?: string;
|
|
53981
|
+
platforms?: Array<(string)>;
|
|
53982
|
+
}>;
|
|
53983
|
+
}>;
|
|
53984
|
+
/**
|
|
53985
|
+
* The fields and operators `subjects.filters` takes, and which fields each subject accepts.
|
|
53986
|
+
*/
|
|
53987
|
+
filters: {
|
|
53988
|
+
[key: string]: unknown;
|
|
53989
|
+
};
|
|
53990
|
+
/**
|
|
53991
|
+
* What `subjects.groups` takes.
|
|
53992
|
+
*/
|
|
53993
|
+
groups: {
|
|
53994
|
+
[key: string]: unknown;
|
|
53995
|
+
};
|
|
53996
|
+
/**
|
|
53997
|
+
* The most checks `alert.confirmChecks` can ask for.
|
|
53998
|
+
*/
|
|
53999
|
+
alert: {
|
|
54000
|
+
[key: string]: unknown;
|
|
54001
|
+
};
|
|
54002
|
+
/**
|
|
54003
|
+
* Condition operators, windows, `compareTo` options and size limits.
|
|
54004
|
+
*/
|
|
54005
|
+
conditions: {
|
|
54006
|
+
[key: string]: unknown;
|
|
54007
|
+
};
|
|
54008
|
+
limits: Array<(string)>;
|
|
54009
|
+
/**
|
|
54010
|
+
* Where `approval.request` goes, how many approvers and how long it can wait.
|
|
54011
|
+
*/
|
|
54012
|
+
approval: {
|
|
54013
|
+
[key: string]: unknown;
|
|
54014
|
+
};
|
|
54015
|
+
});
|
|
54016
|
+
|
|
54017
|
+
export type GetAutomationCatalogError = (ErrorResponse);
|
|
54018
|
+
|
|
54019
|
+
export type ListAutomationActionsData = {
|
|
54020
|
+
query?: {
|
|
54021
|
+
/**
|
|
54022
|
+
* Only actions on this ads connection.
|
|
54023
|
+
*/
|
|
54024
|
+
accountId?: string;
|
|
54025
|
+
automationId?: string;
|
|
54026
|
+
/**
|
|
54027
|
+
* `nextCursor` from the previous page.
|
|
54028
|
+
*/
|
|
54029
|
+
cursor?: string;
|
|
54030
|
+
from?: string;
|
|
54031
|
+
limit?: number;
|
|
54032
|
+
to?: string;
|
|
54033
|
+
/**
|
|
54034
|
+
* A change reads as the value it set, so budget changes filter as `ads.set_budget`.
|
|
54035
|
+
*/
|
|
54036
|
+
type?: 'ads.pause' | 'ads.activate' | 'ads.set_budget' | 'ads.duplicate' | 'ads.edit_name' | 'ads.set_bid' | 'ads.set_target' | 'ads.reallocate_budget';
|
|
54037
|
+
};
|
|
54038
|
+
};
|
|
54039
|
+
|
|
54040
|
+
export type ListAutomationActionsResponse = ({
|
|
54041
|
+
actions: Array<AutomationAction>;
|
|
54042
|
+
nextCursor: (string) | null;
|
|
54043
|
+
});
|
|
54044
|
+
|
|
54045
|
+
export type ListAutomationActionsError = (ErrorResponse);
|
|
54046
|
+
|
|
54047
|
+
export type ListAutomationChecksData = {
|
|
54048
|
+
path: {
|
|
54049
|
+
automationId: string;
|
|
54050
|
+
};
|
|
54051
|
+
query?: {
|
|
54052
|
+
/**
|
|
54053
|
+
* `nextCursor` from the previous page.
|
|
54054
|
+
*/
|
|
54055
|
+
cursor?: string;
|
|
54056
|
+
limit?: number;
|
|
54057
|
+
};
|
|
54058
|
+
};
|
|
54059
|
+
|
|
54060
|
+
export type ListAutomationChecksResponse = ({
|
|
54061
|
+
checks: Array<AutomationCheck>;
|
|
54062
|
+
/**
|
|
54063
|
+
* Null on the last page.
|
|
54064
|
+
*/
|
|
54065
|
+
nextCursor: (string) | null;
|
|
54066
|
+
});
|
|
54067
|
+
|
|
54068
|
+
export type ListAutomationChecksError = (ErrorResponse | {
|
|
54069
|
+
error?: string;
|
|
54070
|
+
});
|
|
54071
|
+
|
|
54072
|
+
export type PreviewAutomationDraftData = {
|
|
54073
|
+
body: AutomationDefinition;
|
|
54074
|
+
query?: {
|
|
54075
|
+
/**
|
|
54076
|
+
* How many subjects to list, matches first. `evaluated` and `matched` always count them all.
|
|
54077
|
+
*/
|
|
54078
|
+
limit?: number;
|
|
54079
|
+
};
|
|
54080
|
+
};
|
|
54081
|
+
|
|
54082
|
+
export type PreviewAutomationDraftResponse = (AutomationPreview);
|
|
54083
|
+
|
|
54084
|
+
export type PreviewAutomationDraftError = ((ErrorResponse & {
|
|
54085
|
+
details?: AutomationProblems;
|
|
54086
|
+
}) | ErrorResponse);
|
|
54087
|
+
|
|
54088
|
+
export type GetAutomationData = {
|
|
54089
|
+
path: {
|
|
54090
|
+
automationId: string;
|
|
54091
|
+
};
|
|
54092
|
+
};
|
|
54093
|
+
|
|
54094
|
+
export type GetAutomationResponse = ({
|
|
54095
|
+
automation: Automation;
|
|
54096
|
+
});
|
|
54097
|
+
|
|
54098
|
+
export type GetAutomationError = (ErrorResponse | {
|
|
54099
|
+
error?: string;
|
|
54100
|
+
});
|
|
54101
|
+
|
|
54102
|
+
export type UpdateAutomationData = {
|
|
54103
|
+
body: {
|
|
54104
|
+
name?: string;
|
|
54105
|
+
status?: 'active' | 'paused';
|
|
54106
|
+
trigger?: AutomationTrigger;
|
|
54107
|
+
subjects?: (AutomationSubjects | AutomationPostSubjects);
|
|
54108
|
+
filter?: AutomationFactCondition;
|
|
54109
|
+
conditions?: AdRuleConditions;
|
|
54110
|
+
alert?: (AutomationAlert | null);
|
|
54111
|
+
/**
|
|
54112
|
+
* The steps the automation's kind takes.
|
|
54113
|
+
*/
|
|
54114
|
+
steps?: Array<(AutomationStep | AutomationBoostStep)>;
|
|
54115
|
+
limits?: (AutomationLimits | AutomationEventLimits);
|
|
54116
|
+
};
|
|
54117
|
+
headers?: {
|
|
54118
|
+
/**
|
|
54119
|
+
* The automation's `version` when you read it.
|
|
54120
|
+
*/
|
|
54121
|
+
'If-Match'?: string;
|
|
54122
|
+
};
|
|
54123
|
+
path: {
|
|
54124
|
+
automationId: string;
|
|
54125
|
+
};
|
|
54126
|
+
};
|
|
54127
|
+
|
|
54128
|
+
export type UpdateAutomationResponse = ({
|
|
54129
|
+
automation: Automation;
|
|
54130
|
+
});
|
|
54131
|
+
|
|
54132
|
+
export type UpdateAutomationError = ((ErrorResponse & {
|
|
54133
|
+
details?: AutomationProblems;
|
|
54134
|
+
}) | ErrorResponse | {
|
|
54135
|
+
error?: string;
|
|
54136
|
+
});
|
|
54137
|
+
|
|
54138
|
+
export type DeleteAutomationData = {
|
|
54139
|
+
path: {
|
|
54140
|
+
automationId: string;
|
|
54141
|
+
};
|
|
54142
|
+
};
|
|
54143
|
+
|
|
54144
|
+
export type DeleteAutomationResponse = ({
|
|
54145
|
+
success?: boolean;
|
|
54146
|
+
});
|
|
54147
|
+
|
|
54148
|
+
export type DeleteAutomationError = (ErrorResponse | {
|
|
54149
|
+
error?: string;
|
|
54150
|
+
});
|
|
54151
|
+
|
|
54152
|
+
export type ActivateAutomationData = {
|
|
54153
|
+
path: {
|
|
54154
|
+
automationId: string;
|
|
54155
|
+
};
|
|
54156
|
+
};
|
|
54157
|
+
|
|
54158
|
+
export type ActivateAutomationResponse = ({
|
|
54159
|
+
automation: Automation;
|
|
54160
|
+
});
|
|
54161
|
+
|
|
54162
|
+
export type ActivateAutomationError = (ErrorResponse | {
|
|
54163
|
+
error?: string;
|
|
54164
|
+
});
|
|
54165
|
+
|
|
54166
|
+
export type PauseAutomationData = {
|
|
54167
|
+
path: {
|
|
54168
|
+
automationId: string;
|
|
54169
|
+
};
|
|
54170
|
+
};
|
|
54171
|
+
|
|
54172
|
+
export type PauseAutomationResponse = ({
|
|
54173
|
+
automation: Automation;
|
|
54174
|
+
});
|
|
54175
|
+
|
|
54176
|
+
export type PauseAutomationError = (ErrorResponse | {
|
|
54177
|
+
error?: string;
|
|
54178
|
+
});
|
|
54179
|
+
|
|
54180
|
+
export type PreviewAutomationData = {
|
|
54181
|
+
path: {
|
|
54182
|
+
automationId: string;
|
|
54183
|
+
};
|
|
54184
|
+
query?: {
|
|
54185
|
+
/**
|
|
54186
|
+
* How many subjects to list, matches first. `evaluated` and `matched` always count them all.
|
|
54187
|
+
*/
|
|
54188
|
+
limit?: number;
|
|
54189
|
+
};
|
|
54190
|
+
};
|
|
54191
|
+
|
|
54192
|
+
export type PreviewAutomationResponse = (AutomationPreview);
|
|
54193
|
+
|
|
54194
|
+
export type PreviewAutomationError = ((ErrorResponse & {
|
|
54195
|
+
details?: AutomationProblems;
|
|
54196
|
+
}) | ErrorResponse | {
|
|
54197
|
+
error?: string;
|
|
54198
|
+
});
|
|
54199
|
+
|
|
54200
|
+
export type ListAutomationTemplatesData = {
|
|
54201
|
+
query?: {
|
|
54202
|
+
/**
|
|
54203
|
+
* Which templates to list. Only `team` today.
|
|
54204
|
+
*/
|
|
54205
|
+
scope?: 'team';
|
|
54206
|
+
};
|
|
54207
|
+
};
|
|
54208
|
+
|
|
54209
|
+
export type ListAutomationTemplatesResponse = ({
|
|
54210
|
+
templates: Array<AutomationTemplate>;
|
|
54211
|
+
});
|
|
54212
|
+
|
|
54213
|
+
export type ListAutomationTemplatesError = (ErrorResponse);
|
|
54214
|
+
|
|
54215
|
+
export type CreateAutomationTemplateData = {
|
|
54216
|
+
body: ({
|
|
54217
|
+
name: string;
|
|
54218
|
+
description?: string;
|
|
54219
|
+
} & AutomationTemplateContent);
|
|
54220
|
+
headers?: {
|
|
54221
|
+
/**
|
|
54222
|
+
* Optional client-generated unique key (e.g. a UUID) that makes retries safe.
|
|
54223
|
+
*
|
|
54224
|
+
* - Same key + same body: replays the original response.
|
|
54225
|
+
* - Same key + different body: 422.
|
|
54226
|
+
* - Key still processing: 409.
|
|
54227
|
+
*
|
|
54228
|
+
* A request cut off mid-handler (e.g. by a function timeout) can leave its key in progress, answering 409 until the key expires after 24 hours.
|
|
54229
|
+
*
|
|
54230
|
+
* On the Ads create, boost and duplicate endpoints, a same-body retry runs again once the cut-off request started more than 15 minutes ago.
|
|
54231
|
+
*
|
|
54232
|
+
*/
|
|
54233
|
+
'Idempotency-Key'?: string;
|
|
54234
|
+
};
|
|
54235
|
+
};
|
|
54236
|
+
|
|
54237
|
+
export type CreateAutomationTemplateResponse = ({
|
|
54238
|
+
template: AutomationTemplate;
|
|
54239
|
+
});
|
|
54240
|
+
|
|
54241
|
+
export type CreateAutomationTemplateError = ((ErrorResponse & {
|
|
54242
|
+
details?: AutomationProblems;
|
|
54243
|
+
}) | ErrorResponse | unknown);
|
|
54244
|
+
|
|
54245
|
+
export type GetAutomationTemplateData = {
|
|
54246
|
+
path: {
|
|
54247
|
+
/**
|
|
54248
|
+
* The template's id.
|
|
54249
|
+
*/
|
|
54250
|
+
templateId: string;
|
|
54251
|
+
};
|
|
54252
|
+
};
|
|
54253
|
+
|
|
54254
|
+
export type GetAutomationTemplateResponse = ({
|
|
54255
|
+
template: AutomationTemplate;
|
|
54256
|
+
});
|
|
54257
|
+
|
|
54258
|
+
export type GetAutomationTemplateError = (ErrorResponse);
|
|
54259
|
+
|
|
54260
|
+
export type UpdateAutomationTemplateData = {
|
|
54261
|
+
body: ({
|
|
54262
|
+
name?: string;
|
|
54263
|
+
description?: string;
|
|
54264
|
+
visibility?: 'team' | 'link';
|
|
54265
|
+
} & AutomationTemplateContent);
|
|
54266
|
+
path: {
|
|
54267
|
+
/**
|
|
54268
|
+
* The template's id.
|
|
54269
|
+
*/
|
|
54270
|
+
templateId: string;
|
|
54271
|
+
};
|
|
54272
|
+
};
|
|
54273
|
+
|
|
54274
|
+
export type UpdateAutomationTemplateResponse = ({
|
|
54275
|
+
template: AutomationTemplate;
|
|
54276
|
+
});
|
|
54277
|
+
|
|
54278
|
+
export type UpdateAutomationTemplateError = ((ErrorResponse & {
|
|
54279
|
+
details?: AutomationProblems;
|
|
54280
|
+
}) | ErrorResponse);
|
|
54281
|
+
|
|
54282
|
+
export type DeleteAutomationTemplateData = {
|
|
54283
|
+
path: {
|
|
54284
|
+
/**
|
|
54285
|
+
* The template's id.
|
|
54286
|
+
*/
|
|
54287
|
+
templateId: string;
|
|
54288
|
+
};
|
|
54289
|
+
};
|
|
54290
|
+
|
|
54291
|
+
export type DeleteAutomationTemplateResponse = ({
|
|
54292
|
+
/**
|
|
54293
|
+
* Always true.
|
|
54294
|
+
*/
|
|
54295
|
+
deleted: boolean;
|
|
54296
|
+
});
|
|
54297
|
+
|
|
54298
|
+
export type DeleteAutomationTemplateError = (ErrorResponse);
|
|
54299
|
+
|
|
54300
|
+
export type InstallAutomationTemplateData = {
|
|
54301
|
+
body: AutomationTemplateInstallRequest;
|
|
54302
|
+
headers?: {
|
|
54303
|
+
/**
|
|
54304
|
+
* Optional client-generated unique key (e.g. a UUID) that makes retries safe.
|
|
54305
|
+
*
|
|
54306
|
+
* - Same key + same body: replays the original response.
|
|
54307
|
+
* - Same key + different body: 422.
|
|
54308
|
+
* - Key still processing: 409.
|
|
54309
|
+
*
|
|
54310
|
+
* A request cut off mid-handler (e.g. by a function timeout) can leave its key in progress, answering 409 until the key expires after 24 hours.
|
|
54311
|
+
*
|
|
54312
|
+
* On the Ads create, boost and duplicate endpoints, a same-body retry runs again once the cut-off request started more than 15 minutes ago.
|
|
54313
|
+
*
|
|
54314
|
+
*/
|
|
54315
|
+
'Idempotency-Key'?: string;
|
|
54316
|
+
};
|
|
54317
|
+
path: {
|
|
54318
|
+
/**
|
|
54319
|
+
* The template's id.
|
|
54320
|
+
*/
|
|
54321
|
+
templateId: string;
|
|
54322
|
+
};
|
|
54323
|
+
};
|
|
54324
|
+
|
|
54325
|
+
export type InstallAutomationTemplateResponse = (AutomationTemplateInstallResponse | {
|
|
54326
|
+
installations: Array<AutomationTemplateTargetResult>;
|
|
54327
|
+
});
|
|
54328
|
+
|
|
54329
|
+
export type InstallAutomationTemplateError = ((ErrorResponse & {
|
|
54330
|
+
details?: AutomationProblems;
|
|
54331
|
+
}) | ErrorResponse | unknown);
|
|
54332
|
+
|
|
54333
|
+
export type GetSharedAutomationTemplateData = {
|
|
54334
|
+
path: {
|
|
54335
|
+
/**
|
|
54336
|
+
* The token from the template's `share.token`.
|
|
54337
|
+
*/
|
|
54338
|
+
shareToken: string;
|
|
54339
|
+
};
|
|
54340
|
+
};
|
|
54341
|
+
|
|
54342
|
+
export type GetSharedAutomationTemplateResponse = ({
|
|
54343
|
+
template: AutomationTemplate;
|
|
54344
|
+
});
|
|
54345
|
+
|
|
54346
|
+
export type GetSharedAutomationTemplateError = (ErrorResponse);
|
|
54347
|
+
|
|
54348
|
+
export type InstallSharedAutomationTemplateData = {
|
|
54349
|
+
body: AutomationTemplateInstallRequest;
|
|
54350
|
+
headers?: {
|
|
54351
|
+
/**
|
|
54352
|
+
* Optional client-generated unique key (e.g. a UUID) that makes retries safe.
|
|
54353
|
+
*
|
|
54354
|
+
* - Same key + same body: replays the original response.
|
|
54355
|
+
* - Same key + different body: 422.
|
|
54356
|
+
* - Key still processing: 409.
|
|
54357
|
+
*
|
|
54358
|
+
* A request cut off mid-handler (e.g. by a function timeout) can leave its key in progress, answering 409 until the key expires after 24 hours.
|
|
54359
|
+
*
|
|
54360
|
+
* On the Ads create, boost and duplicate endpoints, a same-body retry runs again once the cut-off request started more than 15 minutes ago.
|
|
54361
|
+
*
|
|
54362
|
+
*/
|
|
54363
|
+
'Idempotency-Key'?: string;
|
|
54364
|
+
};
|
|
54365
|
+
path: {
|
|
54366
|
+
/**
|
|
54367
|
+
* The token from the template's `share.token`.
|
|
54368
|
+
*/
|
|
54369
|
+
shareToken: string;
|
|
54370
|
+
};
|
|
54371
|
+
};
|
|
54372
|
+
|
|
54373
|
+
export type InstallSharedAutomationTemplateResponse = (AutomationTemplateInstallResponse | {
|
|
54374
|
+
installations: Array<AutomationTemplateTargetResult>;
|
|
54375
|
+
});
|
|
54376
|
+
|
|
54377
|
+
export type InstallSharedAutomationTemplateError = ((ErrorResponse & {
|
|
54378
|
+
details?: AutomationProblems;
|
|
54379
|
+
}) | ErrorResponse | unknown);
|
|
54380
|
+
|
|
54381
|
+
export type GetZernioAutomationTemplateData = {
|
|
54382
|
+
path: {
|
|
54383
|
+
/**
|
|
54384
|
+
* The id of one of Zernio's templates, for example `stop_losers`.
|
|
54385
|
+
*/
|
|
54386
|
+
templateId: string;
|
|
54387
|
+
};
|
|
54388
|
+
};
|
|
54389
|
+
|
|
54390
|
+
export type GetZernioAutomationTemplateResponse = ({
|
|
54391
|
+
template: AutomationTemplate;
|
|
54392
|
+
});
|
|
54393
|
+
|
|
54394
|
+
export type GetZernioAutomationTemplateError = (ErrorResponse);
|
|
54395
|
+
|
|
54396
|
+
export type InstallZernioAutomationTemplateData = {
|
|
54397
|
+
body: AutomationTemplateInstallRequest;
|
|
54398
|
+
headers?: {
|
|
54399
|
+
/**
|
|
54400
|
+
* Optional client-generated unique key (e.g. a UUID) that makes retries safe.
|
|
54401
|
+
*
|
|
54402
|
+
* - Same key + same body: replays the original response.
|
|
54403
|
+
* - Same key + different body: 422.
|
|
54404
|
+
* - Key still processing: 409.
|
|
54405
|
+
*
|
|
54406
|
+
* A request cut off mid-handler (e.g. by a function timeout) can leave its key in progress, answering 409 until the key expires after 24 hours.
|
|
54407
|
+
*
|
|
54408
|
+
* On the Ads create, boost and duplicate endpoints, a same-body retry runs again once the cut-off request started more than 15 minutes ago.
|
|
54409
|
+
*
|
|
54410
|
+
*/
|
|
54411
|
+
'Idempotency-Key'?: string;
|
|
54412
|
+
};
|
|
54413
|
+
path: {
|
|
54414
|
+
/**
|
|
54415
|
+
* The id of one of Zernio's templates, for example `stop_losers`.
|
|
54416
|
+
*/
|
|
54417
|
+
templateId: string;
|
|
54418
|
+
};
|
|
54419
|
+
};
|
|
54420
|
+
|
|
54421
|
+
export type InstallZernioAutomationTemplateResponse = (AutomationTemplateInstallResponse | {
|
|
54422
|
+
installations: Array<AutomationTemplateTargetResult>;
|
|
54423
|
+
});
|
|
54424
|
+
|
|
54425
|
+
export type InstallZernioAutomationTemplateError = ((ErrorResponse & {
|
|
54426
|
+
details?: AutomationProblems;
|
|
54427
|
+
}) | ErrorResponse | unknown);
|
|
54428
|
+
|
|
54429
|
+
export type GetAutomationControlsResponse = ({
|
|
54430
|
+
controls: AutomationControls;
|
|
54431
|
+
});
|
|
54432
|
+
|
|
54433
|
+
export type GetAutomationControlsError = (ErrorResponse);
|
|
54434
|
+
|
|
54435
|
+
export type UpdateAutomationControlsData = {
|
|
54436
|
+
body: {
|
|
54437
|
+
/**
|
|
54438
|
+
* True stops every ad automation of the team; false lets them run again.
|
|
54439
|
+
*/
|
|
54440
|
+
paused: boolean;
|
|
54441
|
+
};
|
|
54442
|
+
};
|
|
54443
|
+
|
|
54444
|
+
export type UpdateAutomationControlsResponse = ({
|
|
54445
|
+
controls: AutomationControls;
|
|
54446
|
+
});
|
|
54447
|
+
|
|
54448
|
+
export type UpdateAutomationControlsError = (ErrorResponse);
|
|
54449
|
+
|
|
54450
|
+
export type UpdateAutomationAdAccountControlsData = {
|
|
54451
|
+
body: {
|
|
54452
|
+
/**
|
|
54453
|
+
* The ads connection that reaches the ad account.
|
|
54454
|
+
*/
|
|
54455
|
+
accountId: string;
|
|
54456
|
+
/**
|
|
54457
|
+
* The platform's ad account id.
|
|
54458
|
+
*/
|
|
54459
|
+
adAccountId: string;
|
|
54460
|
+
/**
|
|
54461
|
+
* True stops every automation on this ad account; false lets them run again.
|
|
54462
|
+
*/
|
|
54463
|
+
paused?: boolean;
|
|
54464
|
+
/**
|
|
54465
|
+
* The most automations may raise budgets on this ad account in any 24 hours, in the ad account's currency. A raise past it is cut to the room left.
|
|
54466
|
+
*
|
|
54467
|
+
* Send null to remove the limit.
|
|
54468
|
+
*
|
|
54469
|
+
*/
|
|
54470
|
+
dailyRaiseLimit?: (number) | null;
|
|
54471
|
+
};
|
|
54472
|
+
};
|
|
54473
|
+
|
|
54474
|
+
export type UpdateAutomationAdAccountControlsResponse = ({
|
|
54475
|
+
controls: AutomationControls;
|
|
54476
|
+
});
|
|
54477
|
+
|
|
54478
|
+
export type UpdateAutomationAdAccountControlsError = (ErrorResponse | {
|
|
54479
|
+
error?: string;
|
|
54480
|
+
});
|
|
54481
|
+
|
|
54482
|
+
export type ListAutomationApprovalsData = {
|
|
54483
|
+
path: {
|
|
54484
|
+
automationId: string;
|
|
54485
|
+
};
|
|
54486
|
+
query?: {
|
|
54487
|
+
/**
|
|
54488
|
+
* How many requests to return. There is no cursor; the newest come first.
|
|
54489
|
+
*/
|
|
54490
|
+
limit?: number;
|
|
54491
|
+
/**
|
|
54492
|
+
* Only requests in this status.
|
|
54493
|
+
*/
|
|
54494
|
+
status?: 'pending' | 'approved' | 'rejected' | 'expired' | 'cancelled';
|
|
54495
|
+
};
|
|
54496
|
+
};
|
|
54497
|
+
|
|
54498
|
+
export type ListAutomationApprovalsResponse = ({
|
|
54499
|
+
approvals: Array<AutomationApproval>;
|
|
54500
|
+
});
|
|
54501
|
+
|
|
54502
|
+
export type ListAutomationApprovalsError = (ErrorResponse | {
|
|
54503
|
+
error?: string;
|
|
54504
|
+
});
|
|
54505
|
+
|
|
54506
|
+
export type GetAutomationApprovalData = {
|
|
54507
|
+
path: {
|
|
54508
|
+
approvalId: string;
|
|
54509
|
+
automationId: string;
|
|
54510
|
+
};
|
|
54511
|
+
};
|
|
54512
|
+
|
|
54513
|
+
export type GetAutomationApprovalResponse = ({
|
|
54514
|
+
approval: AutomationApproval;
|
|
54515
|
+
});
|
|
54516
|
+
|
|
54517
|
+
export type GetAutomationApprovalError = (ErrorResponse | {
|
|
54518
|
+
error?: string;
|
|
54519
|
+
});
|
|
54520
|
+
|
|
54521
|
+
export type ApproveAutomationApprovalData = {
|
|
54522
|
+
body?: AutomationApprovalDecision;
|
|
54523
|
+
path: {
|
|
54524
|
+
approvalId: string;
|
|
54525
|
+
automationId: string;
|
|
54526
|
+
};
|
|
54527
|
+
};
|
|
54528
|
+
|
|
54529
|
+
export type ApproveAutomationApprovalResponse = ({
|
|
54530
|
+
approval: AutomationApproval;
|
|
54531
|
+
});
|
|
54532
|
+
|
|
54533
|
+
export type ApproveAutomationApprovalError = (ErrorResponse | {
|
|
54534
|
+
error?: string;
|
|
54535
|
+
});
|
|
54536
|
+
|
|
54537
|
+
export type RejectAutomationApprovalData = {
|
|
54538
|
+
body?: AutomationApprovalDecision;
|
|
54539
|
+
path: {
|
|
54540
|
+
approvalId: string;
|
|
54541
|
+
automationId: string;
|
|
54542
|
+
};
|
|
54543
|
+
};
|
|
54544
|
+
|
|
54545
|
+
export type RejectAutomationApprovalResponse = ({
|
|
54546
|
+
approval: AutomationApproval;
|
|
54547
|
+
});
|
|
54548
|
+
|
|
54549
|
+
export type RejectAutomationApprovalError = (ErrorResponse | {
|
|
54550
|
+
error?: string;
|
|
54551
|
+
});
|
|
54552
|
+
|
|
54553
|
+
export type BacktestAutomationDraftData = {
|
|
54554
|
+
body: AutomationDefinition;
|
|
54555
|
+
query?: {
|
|
54556
|
+
/**
|
|
54557
|
+
* How many whole days before today to replay. Today is not replayed.
|
|
54558
|
+
*/
|
|
54559
|
+
days?: number;
|
|
54560
|
+
};
|
|
54561
|
+
};
|
|
54562
|
+
|
|
54563
|
+
export type BacktestAutomationDraftResponse = (AutomationBacktest);
|
|
54564
|
+
|
|
54565
|
+
export type BacktestAutomationDraftError = ((ErrorResponse & {
|
|
54566
|
+
details?: AutomationProblems;
|
|
54567
|
+
}) | ErrorResponse);
|
|
54568
|
+
|
|
54569
|
+
export type BacktestAutomationData = {
|
|
54570
|
+
path: {
|
|
54571
|
+
automationId: string;
|
|
54572
|
+
};
|
|
54573
|
+
query?: {
|
|
54574
|
+
/**
|
|
54575
|
+
* How many whole days before today to replay. Today is not replayed.
|
|
54576
|
+
*/
|
|
54577
|
+
days?: number;
|
|
54578
|
+
};
|
|
54579
|
+
};
|
|
54580
|
+
|
|
54581
|
+
export type BacktestAutomationResponse = (AutomationBacktest);
|
|
54582
|
+
|
|
54583
|
+
export type BacktestAutomationError = ((ErrorResponse & {
|
|
54584
|
+
details?: AutomationProblems;
|
|
54585
|
+
}) | ErrorResponse | {
|
|
54586
|
+
error?: string;
|
|
54587
|
+
});
|
|
54588
|
+
|
|
52611
54589
|
export type ListAdRulesData = {
|
|
52612
54590
|
query?: {
|
|
52613
54591
|
/**
|
|
@@ -54338,7 +56316,10 @@ export type CreateAdSetData = {
|
|
|
54338
56316
|
* Reddit only. ISO 8601 end of the ad group. Defaults to the campaign end.
|
|
54339
56317
|
*/
|
|
54340
56318
|
endDate?: string;
|
|
54341
|
-
|
|
56319
|
+
/**
|
|
56320
|
+
* Reddit: the full targeting object. Google: locations and languages only, on a Demand Gen campaign.
|
|
56321
|
+
*/
|
|
56322
|
+
targeting?: (TargetingSpec);
|
|
54342
56323
|
/**
|
|
54343
56324
|
* Reddit only. The pixel and the conversion event the ad group optimizes toward.
|
|
54344
56325
|
*/
|
|
@@ -61540,12 +63521,14 @@ export type CreateStandaloneAdData = {
|
|
|
61540
63521
|
/**
|
|
61541
63522
|
* Meta only. Where the budget lives, which selects the Meta budget model:
|
|
61542
63523
|
*
|
|
61543
|
-
* - `adset` (
|
|
63524
|
+
* - `adset` (used when omitted): ABO (Ad-set Budget Optimization). The budget is set on the ad set.
|
|
61544
63525
|
* - `campaign`: CBO (Campaign Budget Optimization / Advantage Campaign Budget). The budget AND `bidStrategy` are set on the CAMPAIGN, and Meta distributes spend across ad sets automatically.
|
|
61545
63526
|
*
|
|
61546
63527
|
* The returned ad stores the applied `budgetLevel`, and the budget in `campaignBudget` (CBO) or `adSetBudget` (ABO). Edit CBO budgets with `PUT /v1/ads/campaigns/{campaignId}` and ABO budgets with `PUT /v1/ads/ad-sets/{adSetId}`.
|
|
61547
63528
|
*
|
|
61548
|
-
* Meta requires the budget at exactly one level, never both.
|
|
63529
|
+
* Meta requires the budget at exactly one level, never both. Ignored on the Meta attach shape (`adSetId`), which inherits the existing budget.
|
|
63530
|
+
*
|
|
63531
|
+
* Google Demand Gen also reads it. A new Demand Gen campaign accepts only `campaign` or no value. With `existingCampaignId` or `adSetId`, omit it: the budget stays on the existing campaign. Other platforms ignore it.
|
|
61549
63532
|
*
|
|
61550
63533
|
*/
|
|
61551
63534
|
budgetLevel?: 'adset' | 'campaign';
|
|
@@ -62304,7 +64287,7 @@ export type CreateStandaloneAdData = {
|
|
|
62304
64287
|
*/
|
|
62305
64288
|
audienceId?: string;
|
|
62306
64289
|
/**
|
|
62307
|
-
* Google only.
|
|
64290
|
+
* Google only. Omitted, it is display on a new campaign, and the existing campaign's own type with `existingCampaignId` or `adSetId` (Search, Display or Demand Gen; other types return 422). Performance Max requires assetGroup and Demand Gen requires demandGen; both are always created PAUSED.
|
|
62308
64291
|
*/
|
|
62309
64292
|
campaignType?: 'display' | 'search' | 'pmax' | 'demand_gen';
|
|
62310
64293
|
/**
|