@dinghy-chat/sdk 0.35.0 → 0.37.0

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/dist/openapi.d.ts CHANGED
@@ -1037,7 +1037,7 @@ export interface paths {
1037
1037
  content: {
1038
1038
  "application/json": {
1039
1039
  url: string;
1040
- events: ("conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired")[];
1040
+ events: ("conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired" | "campaign.updated")[];
1041
1041
  /** @default true */
1042
1042
  enabled?: boolean;
1043
1043
  };
@@ -1270,7 +1270,7 @@ export interface paths {
1270
1270
  content: {
1271
1271
  "application/json": {
1272
1272
  url?: string;
1273
- events?: ("conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired")[];
1273
+ events?: ("conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired" | "campaign.updated")[];
1274
1274
  enabled?: boolean;
1275
1275
  };
1276
1276
  };
@@ -2992,7 +2992,7 @@ export interface paths {
2992
2992
  get: {
2993
2993
  parameters: {
2994
2994
  query?: {
2995
- /** @description A comma list of conversation.created, message.created, message.updated, message.deleted, conversation.closed, conversation.reopened, conversation.assigned, conversation.handoff, conversation.given_back, conversation.labeled, outbound_message.sent, outbound_message.delivered, outbound_message.read, outbound_message.clicked, outbound_message.replied, outbound_message.dismissed, outbound_message.cancelled, outbound_message.expired. All by default. */
2995
+ /** @description A comma list of conversation.created, message.created, message.updated, message.deleted, conversation.closed, conversation.reopened, conversation.assigned, conversation.handoff, conversation.given_back, conversation.labeled, outbound_message.sent, outbound_message.delivered, outbound_message.read, outbound_message.clicked, outbound_message.replied, outbound_message.dismissed, outbound_message.cancelled, outbound_message.expired, campaign.updated. All by default. */
2996
2996
  types?: string;
2997
2997
  after?: string;
2998
2998
  };
@@ -3535,6 +3535,7 @@ export interface paths {
3535
3535
  dedupeKey?: string;
3536
3536
  status?: "scheduled" | "sent" | "delivered" | "read" | "replied" | "dismissed" | "cancelled" | "expired";
3537
3537
  apiKeyId?: string;
3538
+ campaignId?: string;
3538
3539
  /** @description The `next` of the page before */
3539
3540
  cursor?: string;
3540
3541
  limit?: number;
@@ -4096,6 +4097,2393 @@ export interface paths {
4096
4097
  patch?: never;
4097
4098
  trace?: never;
4098
4099
  };
4100
+ "/v1/operator/workspaces/{workspaceId}/campaigns": {
4101
+ parameters: {
4102
+ query?: never;
4103
+ header?: never;
4104
+ path?: never;
4105
+ cookie?: never;
4106
+ };
4107
+ /** List the campaigns, oldest first, with their results since they started */
4108
+ get: {
4109
+ parameters: {
4110
+ query?: {
4111
+ status?: "draft" | "live" | "paused" | "ended";
4112
+ };
4113
+ header?: never;
4114
+ path: {
4115
+ workspaceId: string;
4116
+ };
4117
+ cookie?: never;
4118
+ };
4119
+ requestBody?: never;
4120
+ responses: {
4121
+ /** @description The campaigns */
4122
+ 200: {
4123
+ headers: {
4124
+ [name: string]: unknown;
4125
+ };
4126
+ content: {
4127
+ "application/json": {
4128
+ campaigns: components["schemas"]["Campaign"][];
4129
+ /** @description The messages every campaign sent in the last 7 days, whatever the status */
4130
+ sentLastWeek: number;
4131
+ };
4132
+ };
4133
+ };
4134
+ /** @description invalid_request: the request is not valid */
4135
+ 400: {
4136
+ headers: {
4137
+ [name: string]: unknown;
4138
+ };
4139
+ content: {
4140
+ "application/json": components["schemas"]["Error"];
4141
+ };
4142
+ };
4143
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4144
+ 401: {
4145
+ headers: {
4146
+ [name: string]: unknown;
4147
+ };
4148
+ content: {
4149
+ "application/json": components["schemas"]["Error"];
4150
+ };
4151
+ };
4152
+ /** @description payment_required: the workspace waits for payment */
4153
+ 402: {
4154
+ headers: {
4155
+ [name: string]: unknown;
4156
+ };
4157
+ content: {
4158
+ "application/json": components["schemas"]["Error"];
4159
+ };
4160
+ };
4161
+ /** @description not_found: it does not exist, or this operator is not a member */
4162
+ 404: {
4163
+ headers: {
4164
+ [name: string]: unknown;
4165
+ };
4166
+ content: {
4167
+ "application/json": components["schemas"]["Error"];
4168
+ };
4169
+ };
4170
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4171
+ 429: {
4172
+ headers: {
4173
+ [name: string]: unknown;
4174
+ };
4175
+ content: {
4176
+ "application/json": components["schemas"]["Error"];
4177
+ };
4178
+ };
4179
+ };
4180
+ };
4181
+ put?: never;
4182
+ /**
4183
+ * Create a campaign, as a draft. Owners, admins and Full access keys only
4184
+ * @description The body is the whole definition. A new campaign is a draft until `/resume`. Its messages carry the member or key that saved it last, so a key needs the permissions its messages use.
4185
+ */
4186
+ post: {
4187
+ parameters: {
4188
+ query?: never;
4189
+ header?: never;
4190
+ path: {
4191
+ workspaceId: string;
4192
+ };
4193
+ cookie?: never;
4194
+ };
4195
+ requestBody: {
4196
+ content: {
4197
+ "application/json": components["schemas"]["CampaignDefinition"];
4198
+ };
4199
+ };
4200
+ responses: {
4201
+ /** @description The new campaign */
4202
+ 201: {
4203
+ headers: {
4204
+ [name: string]: unknown;
4205
+ };
4206
+ content: {
4207
+ "application/json": {
4208
+ campaign: components["schemas"]["Campaign"];
4209
+ };
4210
+ };
4211
+ };
4212
+ /** @description invalid_request: the request is not valid */
4213
+ 400: {
4214
+ headers: {
4215
+ [name: string]: unknown;
4216
+ };
4217
+ content: {
4218
+ "application/json": components["schemas"]["Error"];
4219
+ };
4220
+ };
4221
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4222
+ 401: {
4223
+ headers: {
4224
+ [name: string]: unknown;
4225
+ };
4226
+ content: {
4227
+ "application/json": components["schemas"]["Error"];
4228
+ };
4229
+ };
4230
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
4231
+ 402: {
4232
+ headers: {
4233
+ [name: string]: unknown;
4234
+ };
4235
+ content: {
4236
+ "application/json": components["schemas"]["Error"];
4237
+ };
4238
+ };
4239
+ /** @description forbidden: this role or key may not. send_mode_required, send_as_member_required, send_email_required: this key may not stand behind the campaign's messages */
4240
+ 403: {
4241
+ headers: {
4242
+ [name: string]: unknown;
4243
+ };
4244
+ content: {
4245
+ "application/json": components["schemas"]["Error"];
4246
+ };
4247
+ };
4248
+ /** @description not_found: it does not exist, or this operator is not a member */
4249
+ 404: {
4250
+ headers: {
4251
+ [name: string]: unknown;
4252
+ };
4253
+ content: {
4254
+ "application/json": components["schemas"]["Error"];
4255
+ };
4256
+ };
4257
+ /** @description campaign_key_taken: another campaign has this key. campaign_ended: an ended campaign does not change */
4258
+ 409: {
4259
+ headers: {
4260
+ [name: string]: unknown;
4261
+ };
4262
+ content: {
4263
+ "application/json": components["schemas"]["Error"];
4264
+ };
4265
+ };
4266
+ /** @description too_large: the body is over 64 KB */
4267
+ 413: {
4268
+ headers: {
4269
+ [name: string]: unknown;
4270
+ };
4271
+ content: {
4272
+ "application/json": components["schemas"]["Error"];
4273
+ };
4274
+ };
4275
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4276
+ 429: {
4277
+ headers: {
4278
+ [name: string]: unknown;
4279
+ };
4280
+ content: {
4281
+ "application/json": components["schemas"]["Error"];
4282
+ };
4283
+ };
4284
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
4285
+ 503: {
4286
+ headers: {
4287
+ [name: string]: unknown;
4288
+ };
4289
+ content: {
4290
+ "application/json": components["schemas"]["Error"];
4291
+ };
4292
+ };
4293
+ };
4294
+ };
4295
+ delete?: never;
4296
+ options?: never;
4297
+ head?: never;
4298
+ patch?: never;
4299
+ trace?: never;
4300
+ };
4301
+ "/v1/operator/workspaces/{workspaceId}/campaigns/estimate": {
4302
+ parameters: {
4303
+ query?: never;
4304
+ header?: never;
4305
+ path?: never;
4306
+ cookie?: never;
4307
+ };
4308
+ get?: never;
4309
+ put?: never;
4310
+ /**
4311
+ * Count the contacts an audience matches now, and those a trigger reached lately
4312
+ * @description `matching` counts the contacts who match `audience` now. `lastWeek` counts those a `match` or `event` trigger would have reached in the last 7 days, and is null for another trigger. Each count stops at 10,000 with `more: true`.
4313
+ */
4314
+ post: {
4315
+ parameters: {
4316
+ query?: never;
4317
+ header?: never;
4318
+ path: {
4319
+ workspaceId: string;
4320
+ };
4321
+ cookie?: never;
4322
+ };
4323
+ requestBody: {
4324
+ content: {
4325
+ "application/json": {
4326
+ audience?: components["schemas"]["Condition"];
4327
+ trigger?: components["schemas"]["CampaignTrigger"];
4328
+ };
4329
+ };
4330
+ };
4331
+ responses: {
4332
+ /** @description The counts */
4333
+ 200: {
4334
+ headers: {
4335
+ [name: string]: unknown;
4336
+ };
4337
+ content: {
4338
+ "application/json": {
4339
+ matching: {
4340
+ count: number;
4341
+ more: boolean;
4342
+ };
4343
+ lastWeek: {
4344
+ count: number;
4345
+ more: boolean;
4346
+ } | null;
4347
+ };
4348
+ };
4349
+ };
4350
+ /** @description invalid_request: the request is not valid */
4351
+ 400: {
4352
+ headers: {
4353
+ [name: string]: unknown;
4354
+ };
4355
+ content: {
4356
+ "application/json": components["schemas"]["Error"];
4357
+ };
4358
+ };
4359
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4360
+ 401: {
4361
+ headers: {
4362
+ [name: string]: unknown;
4363
+ };
4364
+ content: {
4365
+ "application/json": components["schemas"]["Error"];
4366
+ };
4367
+ };
4368
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
4369
+ 402: {
4370
+ headers: {
4371
+ [name: string]: unknown;
4372
+ };
4373
+ content: {
4374
+ "application/json": components["schemas"]["Error"];
4375
+ };
4376
+ };
4377
+ /** @description suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
4378
+ 403: {
4379
+ headers: {
4380
+ [name: string]: unknown;
4381
+ };
4382
+ content: {
4383
+ "application/json": components["schemas"]["Error"];
4384
+ };
4385
+ };
4386
+ /** @description not_found: it does not exist, or this operator is not a member */
4387
+ 404: {
4388
+ headers: {
4389
+ [name: string]: unknown;
4390
+ };
4391
+ content: {
4392
+ "application/json": components["schemas"]["Error"];
4393
+ };
4394
+ };
4395
+ /** @description too_large: the body is over 64 KB */
4396
+ 413: {
4397
+ headers: {
4398
+ [name: string]: unknown;
4399
+ };
4400
+ content: {
4401
+ "application/json": components["schemas"]["Error"];
4402
+ };
4403
+ };
4404
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4405
+ 429: {
4406
+ headers: {
4407
+ [name: string]: unknown;
4408
+ };
4409
+ content: {
4410
+ "application/json": components["schemas"]["Error"];
4411
+ };
4412
+ };
4413
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
4414
+ 503: {
4415
+ headers: {
4416
+ [name: string]: unknown;
4417
+ };
4418
+ content: {
4419
+ "application/json": components["schemas"]["Error"];
4420
+ };
4421
+ };
4422
+ };
4423
+ };
4424
+ delete?: never;
4425
+ options?: never;
4426
+ head?: never;
4427
+ patch?: never;
4428
+ trace?: never;
4429
+ };
4430
+ "/v1/operator/workspaces/{workspaceId}/campaign-settings": {
4431
+ parameters: {
4432
+ query?: never;
4433
+ header?: never;
4434
+ path?: never;
4435
+ cookie?: never;
4436
+ };
4437
+ /** Read the settings for every campaign */
4438
+ get: {
4439
+ parameters: {
4440
+ query?: never;
4441
+ header?: never;
4442
+ path: {
4443
+ workspaceId: string;
4444
+ };
4445
+ cookie?: never;
4446
+ };
4447
+ requestBody?: never;
4448
+ responses: {
4449
+ /** @description The settings for every campaign */
4450
+ 200: {
4451
+ headers: {
4452
+ [name: string]: unknown;
4453
+ };
4454
+ content: {
4455
+ "application/json": components["schemas"]["CampaignSettingsView"];
4456
+ };
4457
+ };
4458
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4459
+ 401: {
4460
+ headers: {
4461
+ [name: string]: unknown;
4462
+ };
4463
+ content: {
4464
+ "application/json": components["schemas"]["Error"];
4465
+ };
4466
+ };
4467
+ /** @description payment_required: the workspace waits for payment */
4468
+ 402: {
4469
+ headers: {
4470
+ [name: string]: unknown;
4471
+ };
4472
+ content: {
4473
+ "application/json": components["schemas"]["Error"];
4474
+ };
4475
+ };
4476
+ /** @description not_found: it does not exist, or this operator is not a member */
4477
+ 404: {
4478
+ headers: {
4479
+ [name: string]: unknown;
4480
+ };
4481
+ content: {
4482
+ "application/json": components["schemas"]["Error"];
4483
+ };
4484
+ };
4485
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4486
+ 429: {
4487
+ headers: {
4488
+ [name: string]: unknown;
4489
+ };
4490
+ content: {
4491
+ "application/json": components["schemas"]["Error"];
4492
+ };
4493
+ };
4494
+ };
4495
+ };
4496
+ /**
4497
+ * Pause every campaign, or set the gap between two campaign messages to one visitor
4498
+ * @description `paused` holds every campaign's messages until it is false again. It is apart from pausing the bots. `gapHours` is checked when a campaign's message is about to go: one that comes sooner after another is cancelled with `frequency_capped`. Owners, admins and Full access keys only.
4499
+ */
4500
+ put: {
4501
+ parameters: {
4502
+ query?: never;
4503
+ header?: never;
4504
+ path: {
4505
+ workspaceId: string;
4506
+ };
4507
+ cookie?: never;
4508
+ };
4509
+ requestBody: {
4510
+ content: {
4511
+ "application/json": components["schemas"]["CampaignSettings"];
4512
+ };
4513
+ };
4514
+ responses: {
4515
+ /** @description The settings for every campaign */
4516
+ 200: {
4517
+ headers: {
4518
+ [name: string]: unknown;
4519
+ };
4520
+ content: {
4521
+ "application/json": components["schemas"]["CampaignSettingsView"];
4522
+ };
4523
+ };
4524
+ /** @description invalid_request: the request is not valid */
4525
+ 400: {
4526
+ headers: {
4527
+ [name: string]: unknown;
4528
+ };
4529
+ content: {
4530
+ "application/json": components["schemas"]["Error"];
4531
+ };
4532
+ };
4533
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4534
+ 401: {
4535
+ headers: {
4536
+ [name: string]: unknown;
4537
+ };
4538
+ content: {
4539
+ "application/json": components["schemas"]["Error"];
4540
+ };
4541
+ };
4542
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
4543
+ 402: {
4544
+ headers: {
4545
+ [name: string]: unknown;
4546
+ };
4547
+ content: {
4548
+ "application/json": components["schemas"]["Error"];
4549
+ };
4550
+ };
4551
+ /** @description forbidden: this role may not do this. suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
4552
+ 403: {
4553
+ headers: {
4554
+ [name: string]: unknown;
4555
+ };
4556
+ content: {
4557
+ "application/json": components["schemas"]["Error"];
4558
+ };
4559
+ };
4560
+ /** @description not_found: it does not exist, or this operator is not a member */
4561
+ 404: {
4562
+ headers: {
4563
+ [name: string]: unknown;
4564
+ };
4565
+ content: {
4566
+ "application/json": components["schemas"]["Error"];
4567
+ };
4568
+ };
4569
+ /** @description too_large: the body is over 64 KB */
4570
+ 413: {
4571
+ headers: {
4572
+ [name: string]: unknown;
4573
+ };
4574
+ content: {
4575
+ "application/json": components["schemas"]["Error"];
4576
+ };
4577
+ };
4578
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4579
+ 429: {
4580
+ headers: {
4581
+ [name: string]: unknown;
4582
+ };
4583
+ content: {
4584
+ "application/json": components["schemas"]["Error"];
4585
+ };
4586
+ };
4587
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
4588
+ 503: {
4589
+ headers: {
4590
+ [name: string]: unknown;
4591
+ };
4592
+ content: {
4593
+ "application/json": components["schemas"]["Error"];
4594
+ };
4595
+ };
4596
+ };
4597
+ };
4598
+ post?: never;
4599
+ delete?: never;
4600
+ options?: never;
4601
+ head?: never;
4602
+ patch?: never;
4603
+ trace?: never;
4604
+ };
4605
+ "/v1/operator/workspaces/{workspaceId}/campaigns/by-key/{key}": {
4606
+ parameters: {
4607
+ query?: never;
4608
+ header?: never;
4609
+ path?: never;
4610
+ cookie?: never;
4611
+ };
4612
+ get?: never;
4613
+ /**
4614
+ * Create or replace the campaign with this key. Owners, admins and Full access keys only
4615
+ * @description The body is the whole definition, with this key or none. A new campaign is a draft. A save never changes the status, so a deploy never resumes a campaign that support paused. A live campaign keeps its changes for new messages only.
4616
+ */
4617
+ put: {
4618
+ parameters: {
4619
+ query?: never;
4620
+ header?: never;
4621
+ path: {
4622
+ workspaceId: string;
4623
+ /** @description Lowercase letters, digits, - and _, unique in the workspace */
4624
+ key: string;
4625
+ };
4626
+ cookie?: never;
4627
+ };
4628
+ requestBody: {
4629
+ content: {
4630
+ "application/json": components["schemas"]["CampaignDefinition"];
4631
+ };
4632
+ };
4633
+ responses: {
4634
+ /** @description The campaign, replaced */
4635
+ 200: {
4636
+ headers: {
4637
+ [name: string]: unknown;
4638
+ };
4639
+ content: {
4640
+ "application/json": {
4641
+ campaign: components["schemas"]["Campaign"];
4642
+ };
4643
+ };
4644
+ };
4645
+ /** @description The new campaign */
4646
+ 201: {
4647
+ headers: {
4648
+ [name: string]: unknown;
4649
+ };
4650
+ content: {
4651
+ "application/json": {
4652
+ campaign: components["schemas"]["Campaign"];
4653
+ };
4654
+ };
4655
+ };
4656
+ /** @description invalid_request: the request is not valid */
4657
+ 400: {
4658
+ headers: {
4659
+ [name: string]: unknown;
4660
+ };
4661
+ content: {
4662
+ "application/json": components["schemas"]["Error"];
4663
+ };
4664
+ };
4665
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4666
+ 401: {
4667
+ headers: {
4668
+ [name: string]: unknown;
4669
+ };
4670
+ content: {
4671
+ "application/json": components["schemas"]["Error"];
4672
+ };
4673
+ };
4674
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
4675
+ 402: {
4676
+ headers: {
4677
+ [name: string]: unknown;
4678
+ };
4679
+ content: {
4680
+ "application/json": components["schemas"]["Error"];
4681
+ };
4682
+ };
4683
+ /** @description forbidden: this role or key may not. send_mode_required, send_as_member_required, send_email_required: this key may not stand behind the campaign's messages */
4684
+ 403: {
4685
+ headers: {
4686
+ [name: string]: unknown;
4687
+ };
4688
+ content: {
4689
+ "application/json": components["schemas"]["Error"];
4690
+ };
4691
+ };
4692
+ /** @description not_found: it does not exist, or this operator is not a member */
4693
+ 404: {
4694
+ headers: {
4695
+ [name: string]: unknown;
4696
+ };
4697
+ content: {
4698
+ "application/json": components["schemas"]["Error"];
4699
+ };
4700
+ };
4701
+ /** @description campaign_key_taken: another campaign has this key. campaign_ended: an ended campaign does not change */
4702
+ 409: {
4703
+ headers: {
4704
+ [name: string]: unknown;
4705
+ };
4706
+ content: {
4707
+ "application/json": components["schemas"]["Error"];
4708
+ };
4709
+ };
4710
+ /** @description too_large: the body is over 64 KB */
4711
+ 413: {
4712
+ headers: {
4713
+ [name: string]: unknown;
4714
+ };
4715
+ content: {
4716
+ "application/json": components["schemas"]["Error"];
4717
+ };
4718
+ };
4719
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4720
+ 429: {
4721
+ headers: {
4722
+ [name: string]: unknown;
4723
+ };
4724
+ content: {
4725
+ "application/json": components["schemas"]["Error"];
4726
+ };
4727
+ };
4728
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
4729
+ 503: {
4730
+ headers: {
4731
+ [name: string]: unknown;
4732
+ };
4733
+ content: {
4734
+ "application/json": components["schemas"]["Error"];
4735
+ };
4736
+ };
4737
+ };
4738
+ };
4739
+ post?: never;
4740
+ delete?: never;
4741
+ options?: never;
4742
+ head?: never;
4743
+ patch?: never;
4744
+ trace?: never;
4745
+ };
4746
+ "/v1/operator/workspaces/{workspaceId}/campaigns/{ref}": {
4747
+ parameters: {
4748
+ query?: never;
4749
+ header?: never;
4750
+ path?: never;
4751
+ cookie?: never;
4752
+ };
4753
+ /** Get one campaign */
4754
+ get: {
4755
+ parameters: {
4756
+ query?: never;
4757
+ header?: never;
4758
+ path: {
4759
+ workspaceId: string;
4760
+ /** @description The campaign's ID */
4761
+ ref: string;
4762
+ };
4763
+ cookie?: never;
4764
+ };
4765
+ requestBody?: never;
4766
+ responses: {
4767
+ /** @description The campaign */
4768
+ 200: {
4769
+ headers: {
4770
+ [name: string]: unknown;
4771
+ };
4772
+ content: {
4773
+ "application/json": {
4774
+ campaign: components["schemas"]["Campaign"];
4775
+ };
4776
+ };
4777
+ };
4778
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4779
+ 401: {
4780
+ headers: {
4781
+ [name: string]: unknown;
4782
+ };
4783
+ content: {
4784
+ "application/json": components["schemas"]["Error"];
4785
+ };
4786
+ };
4787
+ /** @description payment_required: the workspace waits for payment */
4788
+ 402: {
4789
+ headers: {
4790
+ [name: string]: unknown;
4791
+ };
4792
+ content: {
4793
+ "application/json": components["schemas"]["Error"];
4794
+ };
4795
+ };
4796
+ /** @description not_found: it does not exist, or this operator is not a member */
4797
+ 404: {
4798
+ headers: {
4799
+ [name: string]: unknown;
4800
+ };
4801
+ content: {
4802
+ "application/json": components["schemas"]["Error"];
4803
+ };
4804
+ };
4805
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4806
+ 429: {
4807
+ headers: {
4808
+ [name: string]: unknown;
4809
+ };
4810
+ content: {
4811
+ "application/json": components["schemas"]["Error"];
4812
+ };
4813
+ };
4814
+ };
4815
+ };
4816
+ put?: never;
4817
+ post?: never;
4818
+ delete?: never;
4819
+ options?: never;
4820
+ head?: never;
4821
+ /**
4822
+ * Change parts of a campaign. Owners, admins and Full access keys only
4823
+ * @description Each part the body gives, such as `message` or `rules`, replaces that part whole, and the whole definition is checked again.
4824
+ */
4825
+ patch: {
4826
+ parameters: {
4827
+ query?: never;
4828
+ header?: never;
4829
+ path: {
4830
+ workspaceId: string;
4831
+ /** @description The campaign's ID */
4832
+ ref: string;
4833
+ };
4834
+ cookie?: never;
4835
+ };
4836
+ requestBody: {
4837
+ content: {
4838
+ "application/json": components["schemas"]["CampaignPatch"];
4839
+ };
4840
+ };
4841
+ responses: {
4842
+ /** @description The campaign after the change */
4843
+ 200: {
4844
+ headers: {
4845
+ [name: string]: unknown;
4846
+ };
4847
+ content: {
4848
+ "application/json": {
4849
+ campaign: components["schemas"]["Campaign"];
4850
+ };
4851
+ };
4852
+ };
4853
+ /** @description invalid_request: the request is not valid */
4854
+ 400: {
4855
+ headers: {
4856
+ [name: string]: unknown;
4857
+ };
4858
+ content: {
4859
+ "application/json": components["schemas"]["Error"];
4860
+ };
4861
+ };
4862
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4863
+ 401: {
4864
+ headers: {
4865
+ [name: string]: unknown;
4866
+ };
4867
+ content: {
4868
+ "application/json": components["schemas"]["Error"];
4869
+ };
4870
+ };
4871
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
4872
+ 402: {
4873
+ headers: {
4874
+ [name: string]: unknown;
4875
+ };
4876
+ content: {
4877
+ "application/json": components["schemas"]["Error"];
4878
+ };
4879
+ };
4880
+ /** @description forbidden: this role or key may not. send_mode_required, send_as_member_required, send_email_required: this key may not stand behind the campaign's messages */
4881
+ 403: {
4882
+ headers: {
4883
+ [name: string]: unknown;
4884
+ };
4885
+ content: {
4886
+ "application/json": components["schemas"]["Error"];
4887
+ };
4888
+ };
4889
+ /** @description not_found: it does not exist, or this operator is not a member */
4890
+ 404: {
4891
+ headers: {
4892
+ [name: string]: unknown;
4893
+ };
4894
+ content: {
4895
+ "application/json": components["schemas"]["Error"];
4896
+ };
4897
+ };
4898
+ /** @description campaign_key_taken: another campaign has this key. campaign_ended: an ended campaign does not change */
4899
+ 409: {
4900
+ headers: {
4901
+ [name: string]: unknown;
4902
+ };
4903
+ content: {
4904
+ "application/json": components["schemas"]["Error"];
4905
+ };
4906
+ };
4907
+ /** @description too_large: the body is over 64 KB */
4908
+ 413: {
4909
+ headers: {
4910
+ [name: string]: unknown;
4911
+ };
4912
+ content: {
4913
+ "application/json": components["schemas"]["Error"];
4914
+ };
4915
+ };
4916
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4917
+ 429: {
4918
+ headers: {
4919
+ [name: string]: unknown;
4920
+ };
4921
+ content: {
4922
+ "application/json": components["schemas"]["Error"];
4923
+ };
4924
+ };
4925
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
4926
+ 503: {
4927
+ headers: {
4928
+ [name: string]: unknown;
4929
+ };
4930
+ content: {
4931
+ "application/json": components["schemas"]["Error"];
4932
+ };
4933
+ };
4934
+ };
4935
+ };
4936
+ trace?: never;
4937
+ };
4938
+ "/v1/operator/workspaces/{workspaceId}/campaigns/by-key/{ref}": {
4939
+ parameters: {
4940
+ query?: never;
4941
+ header?: never;
4942
+ path?: never;
4943
+ cookie?: never;
4944
+ };
4945
+ /** Get one campaign */
4946
+ get: {
4947
+ parameters: {
4948
+ query?: never;
4949
+ header?: never;
4950
+ path: {
4951
+ workspaceId: string;
4952
+ /** @description The campaign's key */
4953
+ ref: string;
4954
+ };
4955
+ cookie?: never;
4956
+ };
4957
+ requestBody?: never;
4958
+ responses: {
4959
+ /** @description The campaign */
4960
+ 200: {
4961
+ headers: {
4962
+ [name: string]: unknown;
4963
+ };
4964
+ content: {
4965
+ "application/json": {
4966
+ campaign: components["schemas"]["Campaign"];
4967
+ };
4968
+ };
4969
+ };
4970
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
4971
+ 401: {
4972
+ headers: {
4973
+ [name: string]: unknown;
4974
+ };
4975
+ content: {
4976
+ "application/json": components["schemas"]["Error"];
4977
+ };
4978
+ };
4979
+ /** @description payment_required: the workspace waits for payment */
4980
+ 402: {
4981
+ headers: {
4982
+ [name: string]: unknown;
4983
+ };
4984
+ content: {
4985
+ "application/json": components["schemas"]["Error"];
4986
+ };
4987
+ };
4988
+ /** @description not_found: it does not exist, or this operator is not a member */
4989
+ 404: {
4990
+ headers: {
4991
+ [name: string]: unknown;
4992
+ };
4993
+ content: {
4994
+ "application/json": components["schemas"]["Error"];
4995
+ };
4996
+ };
4997
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
4998
+ 429: {
4999
+ headers: {
5000
+ [name: string]: unknown;
5001
+ };
5002
+ content: {
5003
+ "application/json": components["schemas"]["Error"];
5004
+ };
5005
+ };
5006
+ };
5007
+ };
5008
+ put?: never;
5009
+ post?: never;
5010
+ delete?: never;
5011
+ options?: never;
5012
+ head?: never;
5013
+ /**
5014
+ * Change parts of a campaign. Owners, admins and Full access keys only
5015
+ * @description Each part the body gives, such as `message` or `rules`, replaces that part whole, and the whole definition is checked again.
5016
+ */
5017
+ patch: {
5018
+ parameters: {
5019
+ query?: never;
5020
+ header?: never;
5021
+ path: {
5022
+ workspaceId: string;
5023
+ /** @description The campaign's key */
5024
+ ref: string;
5025
+ };
5026
+ cookie?: never;
5027
+ };
5028
+ requestBody: {
5029
+ content: {
5030
+ "application/json": components["schemas"]["CampaignPatch"];
5031
+ };
5032
+ };
5033
+ responses: {
5034
+ /** @description The campaign after the change */
5035
+ 200: {
5036
+ headers: {
5037
+ [name: string]: unknown;
5038
+ };
5039
+ content: {
5040
+ "application/json": {
5041
+ campaign: components["schemas"]["Campaign"];
5042
+ };
5043
+ };
5044
+ };
5045
+ /** @description invalid_request: the request is not valid */
5046
+ 400: {
5047
+ headers: {
5048
+ [name: string]: unknown;
5049
+ };
5050
+ content: {
5051
+ "application/json": components["schemas"]["Error"];
5052
+ };
5053
+ };
5054
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5055
+ 401: {
5056
+ headers: {
5057
+ [name: string]: unknown;
5058
+ };
5059
+ content: {
5060
+ "application/json": components["schemas"]["Error"];
5061
+ };
5062
+ };
5063
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
5064
+ 402: {
5065
+ headers: {
5066
+ [name: string]: unknown;
5067
+ };
5068
+ content: {
5069
+ "application/json": components["schemas"]["Error"];
5070
+ };
5071
+ };
5072
+ /** @description forbidden: this role or key may not. send_mode_required, send_as_member_required, send_email_required: this key may not stand behind the campaign's messages */
5073
+ 403: {
5074
+ headers: {
5075
+ [name: string]: unknown;
5076
+ };
5077
+ content: {
5078
+ "application/json": components["schemas"]["Error"];
5079
+ };
5080
+ };
5081
+ /** @description not_found: it does not exist, or this operator is not a member */
5082
+ 404: {
5083
+ headers: {
5084
+ [name: string]: unknown;
5085
+ };
5086
+ content: {
5087
+ "application/json": components["schemas"]["Error"];
5088
+ };
5089
+ };
5090
+ /** @description campaign_key_taken: another campaign has this key. campaign_ended: an ended campaign does not change */
5091
+ 409: {
5092
+ headers: {
5093
+ [name: string]: unknown;
5094
+ };
5095
+ content: {
5096
+ "application/json": components["schemas"]["Error"];
5097
+ };
5098
+ };
5099
+ /** @description too_large: the body is over 64 KB */
5100
+ 413: {
5101
+ headers: {
5102
+ [name: string]: unknown;
5103
+ };
5104
+ content: {
5105
+ "application/json": components["schemas"]["Error"];
5106
+ };
5107
+ };
5108
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5109
+ 429: {
5110
+ headers: {
5111
+ [name: string]: unknown;
5112
+ };
5113
+ content: {
5114
+ "application/json": components["schemas"]["Error"];
5115
+ };
5116
+ };
5117
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
5118
+ 503: {
5119
+ headers: {
5120
+ [name: string]: unknown;
5121
+ };
5122
+ content: {
5123
+ "application/json": components["schemas"]["Error"];
5124
+ };
5125
+ };
5126
+ };
5127
+ };
5128
+ trace?: never;
5129
+ };
5130
+ "/v1/operator/workspaces/{workspaceId}/campaigns/{ref}/pause": {
5131
+ parameters: {
5132
+ query?: never;
5133
+ header?: never;
5134
+ path?: never;
5135
+ cookie?: never;
5136
+ };
5137
+ get?: never;
5138
+ put?: never;
5139
+ /** Pause a live campaign: its waiting messages wait, and it makes no new ones. Owners, admins and Full access keys only */
5140
+ post: {
5141
+ parameters: {
5142
+ query?: never;
5143
+ header?: never;
5144
+ path: {
5145
+ workspaceId: string;
5146
+ /** @description The campaign's ID */
5147
+ ref: string;
5148
+ };
5149
+ cookie?: never;
5150
+ };
5151
+ requestBody?: never;
5152
+ responses: {
5153
+ /** @description The campaign as it is now */
5154
+ 200: {
5155
+ headers: {
5156
+ [name: string]: unknown;
5157
+ };
5158
+ content: {
5159
+ "application/json": {
5160
+ campaign: components["schemas"]["Campaign"];
5161
+ };
5162
+ };
5163
+ };
5164
+ /** @description invalid_request: the request is not valid */
5165
+ 400: {
5166
+ headers: {
5167
+ [name: string]: unknown;
5168
+ };
5169
+ content: {
5170
+ "application/json": components["schemas"]["Error"];
5171
+ };
5172
+ };
5173
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5174
+ 401: {
5175
+ headers: {
5176
+ [name: string]: unknown;
5177
+ };
5178
+ content: {
5179
+ "application/json": components["schemas"]["Error"];
5180
+ };
5181
+ };
5182
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
5183
+ 402: {
5184
+ headers: {
5185
+ [name: string]: unknown;
5186
+ };
5187
+ content: {
5188
+ "application/json": components["schemas"]["Error"];
5189
+ };
5190
+ };
5191
+ /** @description forbidden: this role may not do this. suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
5192
+ 403: {
5193
+ headers: {
5194
+ [name: string]: unknown;
5195
+ };
5196
+ content: {
5197
+ "application/json": components["schemas"]["Error"];
5198
+ };
5199
+ };
5200
+ /** @description not_found: it does not exist, or this operator is not a member */
5201
+ 404: {
5202
+ headers: {
5203
+ [name: string]: unknown;
5204
+ };
5205
+ content: {
5206
+ "application/json": components["schemas"]["Error"];
5207
+ };
5208
+ };
5209
+ /** @description campaign_ended: an ended campaign does not change */
5210
+ 409: {
5211
+ headers: {
5212
+ [name: string]: unknown;
5213
+ };
5214
+ content: {
5215
+ "application/json": components["schemas"]["Error"];
5216
+ };
5217
+ };
5218
+ /** @description too_large: the body is over 64 KB */
5219
+ 413: {
5220
+ headers: {
5221
+ [name: string]: unknown;
5222
+ };
5223
+ content: {
5224
+ "application/json": components["schemas"]["Error"];
5225
+ };
5226
+ };
5227
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5228
+ 429: {
5229
+ headers: {
5230
+ [name: string]: unknown;
5231
+ };
5232
+ content: {
5233
+ "application/json": components["schemas"]["Error"];
5234
+ };
5235
+ };
5236
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
5237
+ 503: {
5238
+ headers: {
5239
+ [name: string]: unknown;
5240
+ };
5241
+ content: {
5242
+ "application/json": components["schemas"]["Error"];
5243
+ };
5244
+ };
5245
+ };
5246
+ };
5247
+ delete?: never;
5248
+ options?: never;
5249
+ head?: never;
5250
+ patch?: never;
5251
+ trace?: never;
5252
+ };
5253
+ "/v1/operator/workspaces/{workspaceId}/campaigns/by-key/{ref}/pause": {
5254
+ parameters: {
5255
+ query?: never;
5256
+ header?: never;
5257
+ path?: never;
5258
+ cookie?: never;
5259
+ };
5260
+ get?: never;
5261
+ put?: never;
5262
+ /** Pause a live campaign: its waiting messages wait, and it makes no new ones. Owners, admins and Full access keys only */
5263
+ post: {
5264
+ parameters: {
5265
+ query?: never;
5266
+ header?: never;
5267
+ path: {
5268
+ workspaceId: string;
5269
+ /** @description The campaign's key */
5270
+ ref: string;
5271
+ };
5272
+ cookie?: never;
5273
+ };
5274
+ requestBody?: never;
5275
+ responses: {
5276
+ /** @description The campaign as it is now */
5277
+ 200: {
5278
+ headers: {
5279
+ [name: string]: unknown;
5280
+ };
5281
+ content: {
5282
+ "application/json": {
5283
+ campaign: components["schemas"]["Campaign"];
5284
+ };
5285
+ };
5286
+ };
5287
+ /** @description invalid_request: the request is not valid */
5288
+ 400: {
5289
+ headers: {
5290
+ [name: string]: unknown;
5291
+ };
5292
+ content: {
5293
+ "application/json": components["schemas"]["Error"];
5294
+ };
5295
+ };
5296
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5297
+ 401: {
5298
+ headers: {
5299
+ [name: string]: unknown;
5300
+ };
5301
+ content: {
5302
+ "application/json": components["schemas"]["Error"];
5303
+ };
5304
+ };
5305
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
5306
+ 402: {
5307
+ headers: {
5308
+ [name: string]: unknown;
5309
+ };
5310
+ content: {
5311
+ "application/json": components["schemas"]["Error"];
5312
+ };
5313
+ };
5314
+ /** @description forbidden: this role may not do this. suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
5315
+ 403: {
5316
+ headers: {
5317
+ [name: string]: unknown;
5318
+ };
5319
+ content: {
5320
+ "application/json": components["schemas"]["Error"];
5321
+ };
5322
+ };
5323
+ /** @description not_found: it does not exist, or this operator is not a member */
5324
+ 404: {
5325
+ headers: {
5326
+ [name: string]: unknown;
5327
+ };
5328
+ content: {
5329
+ "application/json": components["schemas"]["Error"];
5330
+ };
5331
+ };
5332
+ /** @description campaign_ended: an ended campaign does not change */
5333
+ 409: {
5334
+ headers: {
5335
+ [name: string]: unknown;
5336
+ };
5337
+ content: {
5338
+ "application/json": components["schemas"]["Error"];
5339
+ };
5340
+ };
5341
+ /** @description too_large: the body is over 64 KB */
5342
+ 413: {
5343
+ headers: {
5344
+ [name: string]: unknown;
5345
+ };
5346
+ content: {
5347
+ "application/json": components["schemas"]["Error"];
5348
+ };
5349
+ };
5350
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5351
+ 429: {
5352
+ headers: {
5353
+ [name: string]: unknown;
5354
+ };
5355
+ content: {
5356
+ "application/json": components["schemas"]["Error"];
5357
+ };
5358
+ };
5359
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
5360
+ 503: {
5361
+ headers: {
5362
+ [name: string]: unknown;
5363
+ };
5364
+ content: {
5365
+ "application/json": components["schemas"]["Error"];
5366
+ };
5367
+ };
5368
+ };
5369
+ };
5370
+ delete?: never;
5371
+ options?: never;
5372
+ head?: never;
5373
+ patch?: never;
5374
+ trace?: never;
5375
+ };
5376
+ "/v1/operator/workspaces/{workspaceId}/campaigns/{ref}/resume": {
5377
+ parameters: {
5378
+ query?: never;
5379
+ header?: never;
5380
+ path?: never;
5381
+ cookie?: never;
5382
+ };
5383
+ get?: never;
5384
+ put?: never;
5385
+ /** Start a draft, or resume a paused campaign. Owners, admins and Full access keys only */
5386
+ post: {
5387
+ parameters: {
5388
+ query?: never;
5389
+ header?: never;
5390
+ path: {
5391
+ workspaceId: string;
5392
+ /** @description The campaign's ID */
5393
+ ref: string;
5394
+ };
5395
+ cookie?: never;
5396
+ };
5397
+ requestBody?: never;
5398
+ responses: {
5399
+ /** @description The campaign as it is now */
5400
+ 200: {
5401
+ headers: {
5402
+ [name: string]: unknown;
5403
+ };
5404
+ content: {
5405
+ "application/json": {
5406
+ campaign: components["schemas"]["Campaign"];
5407
+ };
5408
+ };
5409
+ };
5410
+ /** @description invalid_request: the request is not valid */
5411
+ 400: {
5412
+ headers: {
5413
+ [name: string]: unknown;
5414
+ };
5415
+ content: {
5416
+ "application/json": components["schemas"]["Error"];
5417
+ };
5418
+ };
5419
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5420
+ 401: {
5421
+ headers: {
5422
+ [name: string]: unknown;
5423
+ };
5424
+ content: {
5425
+ "application/json": components["schemas"]["Error"];
5426
+ };
5427
+ };
5428
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
5429
+ 402: {
5430
+ headers: {
5431
+ [name: string]: unknown;
5432
+ };
5433
+ content: {
5434
+ "application/json": components["schemas"]["Error"];
5435
+ };
5436
+ };
5437
+ /** @description forbidden: this role may not do this. suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
5438
+ 403: {
5439
+ headers: {
5440
+ [name: string]: unknown;
5441
+ };
5442
+ content: {
5443
+ "application/json": components["schemas"]["Error"];
5444
+ };
5445
+ };
5446
+ /** @description not_found: it does not exist, or this operator is not a member */
5447
+ 404: {
5448
+ headers: {
5449
+ [name: string]: unknown;
5450
+ };
5451
+ content: {
5452
+ "application/json": components["schemas"]["Error"];
5453
+ };
5454
+ };
5455
+ /** @description campaign_ended: an ended campaign does not change */
5456
+ 409: {
5457
+ headers: {
5458
+ [name: string]: unknown;
5459
+ };
5460
+ content: {
5461
+ "application/json": components["schemas"]["Error"];
5462
+ };
5463
+ };
5464
+ /** @description too_large: the body is over 64 KB */
5465
+ 413: {
5466
+ headers: {
5467
+ [name: string]: unknown;
5468
+ };
5469
+ content: {
5470
+ "application/json": components["schemas"]["Error"];
5471
+ };
5472
+ };
5473
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5474
+ 429: {
5475
+ headers: {
5476
+ [name: string]: unknown;
5477
+ };
5478
+ content: {
5479
+ "application/json": components["schemas"]["Error"];
5480
+ };
5481
+ };
5482
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
5483
+ 503: {
5484
+ headers: {
5485
+ [name: string]: unknown;
5486
+ };
5487
+ content: {
5488
+ "application/json": components["schemas"]["Error"];
5489
+ };
5490
+ };
5491
+ };
5492
+ };
5493
+ delete?: never;
5494
+ options?: never;
5495
+ head?: never;
5496
+ patch?: never;
5497
+ trace?: never;
5498
+ };
5499
+ "/v1/operator/workspaces/{workspaceId}/campaigns/by-key/{ref}/resume": {
5500
+ parameters: {
5501
+ query?: never;
5502
+ header?: never;
5503
+ path?: never;
5504
+ cookie?: never;
5505
+ };
5506
+ get?: never;
5507
+ put?: never;
5508
+ /** Start a draft, or resume a paused campaign. Owners, admins and Full access keys only */
5509
+ post: {
5510
+ parameters: {
5511
+ query?: never;
5512
+ header?: never;
5513
+ path: {
5514
+ workspaceId: string;
5515
+ /** @description The campaign's key */
5516
+ ref: string;
5517
+ };
5518
+ cookie?: never;
5519
+ };
5520
+ requestBody?: never;
5521
+ responses: {
5522
+ /** @description The campaign as it is now */
5523
+ 200: {
5524
+ headers: {
5525
+ [name: string]: unknown;
5526
+ };
5527
+ content: {
5528
+ "application/json": {
5529
+ campaign: components["schemas"]["Campaign"];
5530
+ };
5531
+ };
5532
+ };
5533
+ /** @description invalid_request: the request is not valid */
5534
+ 400: {
5535
+ headers: {
5536
+ [name: string]: unknown;
5537
+ };
5538
+ content: {
5539
+ "application/json": components["schemas"]["Error"];
5540
+ };
5541
+ };
5542
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5543
+ 401: {
5544
+ headers: {
5545
+ [name: string]: unknown;
5546
+ };
5547
+ content: {
5548
+ "application/json": components["schemas"]["Error"];
5549
+ };
5550
+ };
5551
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
5552
+ 402: {
5553
+ headers: {
5554
+ [name: string]: unknown;
5555
+ };
5556
+ content: {
5557
+ "application/json": components["schemas"]["Error"];
5558
+ };
5559
+ };
5560
+ /** @description forbidden: this role may not do this. suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
5561
+ 403: {
5562
+ headers: {
5563
+ [name: string]: unknown;
5564
+ };
5565
+ content: {
5566
+ "application/json": components["schemas"]["Error"];
5567
+ };
5568
+ };
5569
+ /** @description not_found: it does not exist, or this operator is not a member */
5570
+ 404: {
5571
+ headers: {
5572
+ [name: string]: unknown;
5573
+ };
5574
+ content: {
5575
+ "application/json": components["schemas"]["Error"];
5576
+ };
5577
+ };
5578
+ /** @description campaign_ended: an ended campaign does not change */
5579
+ 409: {
5580
+ headers: {
5581
+ [name: string]: unknown;
5582
+ };
5583
+ content: {
5584
+ "application/json": components["schemas"]["Error"];
5585
+ };
5586
+ };
5587
+ /** @description too_large: the body is over 64 KB */
5588
+ 413: {
5589
+ headers: {
5590
+ [name: string]: unknown;
5591
+ };
5592
+ content: {
5593
+ "application/json": components["schemas"]["Error"];
5594
+ };
5595
+ };
5596
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5597
+ 429: {
5598
+ headers: {
5599
+ [name: string]: unknown;
5600
+ };
5601
+ content: {
5602
+ "application/json": components["schemas"]["Error"];
5603
+ };
5604
+ };
5605
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
5606
+ 503: {
5607
+ headers: {
5608
+ [name: string]: unknown;
5609
+ };
5610
+ content: {
5611
+ "application/json": components["schemas"]["Error"];
5612
+ };
5613
+ };
5614
+ };
5615
+ };
5616
+ delete?: never;
5617
+ options?: never;
5618
+ head?: never;
5619
+ patch?: never;
5620
+ trace?: never;
5621
+ };
5622
+ "/v1/operator/workspaces/{workspaceId}/campaigns/{ref}/end": {
5623
+ parameters: {
5624
+ query?: never;
5625
+ header?: never;
5626
+ path?: never;
5627
+ cookie?: never;
5628
+ };
5629
+ get?: never;
5630
+ put?: never;
5631
+ /** End a campaign for good: its messages that wait are cancelled with `campaign_ended`. Owners, admins and Full access keys only */
5632
+ post: {
5633
+ parameters: {
5634
+ query?: never;
5635
+ header?: never;
5636
+ path: {
5637
+ workspaceId: string;
5638
+ /** @description The campaign's ID */
5639
+ ref: string;
5640
+ };
5641
+ cookie?: never;
5642
+ };
5643
+ requestBody?: never;
5644
+ responses: {
5645
+ /** @description The campaign as it is now */
5646
+ 200: {
5647
+ headers: {
5648
+ [name: string]: unknown;
5649
+ };
5650
+ content: {
5651
+ "application/json": {
5652
+ campaign: components["schemas"]["Campaign"];
5653
+ };
5654
+ };
5655
+ };
5656
+ /** @description invalid_request: the request is not valid */
5657
+ 400: {
5658
+ headers: {
5659
+ [name: string]: unknown;
5660
+ };
5661
+ content: {
5662
+ "application/json": components["schemas"]["Error"];
5663
+ };
5664
+ };
5665
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5666
+ 401: {
5667
+ headers: {
5668
+ [name: string]: unknown;
5669
+ };
5670
+ content: {
5671
+ "application/json": components["schemas"]["Error"];
5672
+ };
5673
+ };
5674
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
5675
+ 402: {
5676
+ headers: {
5677
+ [name: string]: unknown;
5678
+ };
5679
+ content: {
5680
+ "application/json": components["schemas"]["Error"];
5681
+ };
5682
+ };
5683
+ /** @description forbidden: this role may not do this. suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
5684
+ 403: {
5685
+ headers: {
5686
+ [name: string]: unknown;
5687
+ };
5688
+ content: {
5689
+ "application/json": components["schemas"]["Error"];
5690
+ };
5691
+ };
5692
+ /** @description not_found: it does not exist, or this operator is not a member */
5693
+ 404: {
5694
+ headers: {
5695
+ [name: string]: unknown;
5696
+ };
5697
+ content: {
5698
+ "application/json": components["schemas"]["Error"];
5699
+ };
5700
+ };
5701
+ /** @description campaign_ended: an ended campaign does not change */
5702
+ 409: {
5703
+ headers: {
5704
+ [name: string]: unknown;
5705
+ };
5706
+ content: {
5707
+ "application/json": components["schemas"]["Error"];
5708
+ };
5709
+ };
5710
+ /** @description too_large: the body is over 64 KB */
5711
+ 413: {
5712
+ headers: {
5713
+ [name: string]: unknown;
5714
+ };
5715
+ content: {
5716
+ "application/json": components["schemas"]["Error"];
5717
+ };
5718
+ };
5719
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5720
+ 429: {
5721
+ headers: {
5722
+ [name: string]: unknown;
5723
+ };
5724
+ content: {
5725
+ "application/json": components["schemas"]["Error"];
5726
+ };
5727
+ };
5728
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
5729
+ 503: {
5730
+ headers: {
5731
+ [name: string]: unknown;
5732
+ };
5733
+ content: {
5734
+ "application/json": components["schemas"]["Error"];
5735
+ };
5736
+ };
5737
+ };
5738
+ };
5739
+ delete?: never;
5740
+ options?: never;
5741
+ head?: never;
5742
+ patch?: never;
5743
+ trace?: never;
5744
+ };
5745
+ "/v1/operator/workspaces/{workspaceId}/campaigns/by-key/{ref}/end": {
5746
+ parameters: {
5747
+ query?: never;
5748
+ header?: never;
5749
+ path?: never;
5750
+ cookie?: never;
5751
+ };
5752
+ get?: never;
5753
+ put?: never;
5754
+ /** End a campaign for good: its messages that wait are cancelled with `campaign_ended`. Owners, admins and Full access keys only */
5755
+ post: {
5756
+ parameters: {
5757
+ query?: never;
5758
+ header?: never;
5759
+ path: {
5760
+ workspaceId: string;
5761
+ /** @description The campaign's key */
5762
+ ref: string;
5763
+ };
5764
+ cookie?: never;
5765
+ };
5766
+ requestBody?: never;
5767
+ responses: {
5768
+ /** @description The campaign as it is now */
5769
+ 200: {
5770
+ headers: {
5771
+ [name: string]: unknown;
5772
+ };
5773
+ content: {
5774
+ "application/json": {
5775
+ campaign: components["schemas"]["Campaign"];
5776
+ };
5777
+ };
5778
+ };
5779
+ /** @description invalid_request: the request is not valid */
5780
+ 400: {
5781
+ headers: {
5782
+ [name: string]: unknown;
5783
+ };
5784
+ content: {
5785
+ "application/json": components["schemas"]["Error"];
5786
+ };
5787
+ };
5788
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5789
+ 401: {
5790
+ headers: {
5791
+ [name: string]: unknown;
5792
+ };
5793
+ content: {
5794
+ "application/json": components["schemas"]["Error"];
5795
+ };
5796
+ };
5797
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
5798
+ 402: {
5799
+ headers: {
5800
+ [name: string]: unknown;
5801
+ };
5802
+ content: {
5803
+ "application/json": components["schemas"]["Error"];
5804
+ };
5805
+ };
5806
+ /** @description forbidden: this role may not do this. suspended: the server's admin suspended the workspace. origin_not_allowed: the request did not come from this server's own pages */
5807
+ 403: {
5808
+ headers: {
5809
+ [name: string]: unknown;
5810
+ };
5811
+ content: {
5812
+ "application/json": components["schemas"]["Error"];
5813
+ };
5814
+ };
5815
+ /** @description not_found: it does not exist, or this operator is not a member */
5816
+ 404: {
5817
+ headers: {
5818
+ [name: string]: unknown;
5819
+ };
5820
+ content: {
5821
+ "application/json": components["schemas"]["Error"];
5822
+ };
5823
+ };
5824
+ /** @description campaign_ended: an ended campaign does not change */
5825
+ 409: {
5826
+ headers: {
5827
+ [name: string]: unknown;
5828
+ };
5829
+ content: {
5830
+ "application/json": components["schemas"]["Error"];
5831
+ };
5832
+ };
5833
+ /** @description too_large: the body is over 64 KB */
5834
+ 413: {
5835
+ headers: {
5836
+ [name: string]: unknown;
5837
+ };
5838
+ content: {
5839
+ "application/json": components["schemas"]["Error"];
5840
+ };
5841
+ };
5842
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5843
+ 429: {
5844
+ headers: {
5845
+ [name: string]: unknown;
5846
+ };
5847
+ content: {
5848
+ "application/json": components["schemas"]["Error"];
5849
+ };
5850
+ };
5851
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
5852
+ 503: {
5853
+ headers: {
5854
+ [name: string]: unknown;
5855
+ };
5856
+ content: {
5857
+ "application/json": components["schemas"]["Error"];
5858
+ };
5859
+ };
5860
+ };
5861
+ };
5862
+ delete?: never;
5863
+ options?: never;
5864
+ head?: never;
5865
+ patch?: never;
5866
+ trace?: never;
5867
+ };
5868
+ "/v1/operator/workspaces/{workspaceId}/campaigns/{ref}/results": {
5869
+ parameters: {
5870
+ query?: never;
5871
+ header?: never;
5872
+ path?: never;
5873
+ cookie?: never;
5874
+ };
5875
+ /**
5876
+ * A campaign's results per day in UTC and per A/B variant
5877
+ * @description Each day counts the contacts it reached (`entered`, the control group too), and its messages sent, delivered, read, replied and dismissed, the clicks by button value, the goals reached and the conversations started. Test visitors are left out. The days outlive the messages' text.
5878
+ */
5879
+ get: {
5880
+ parameters: {
5881
+ query?: {
5882
+ /** @description The first day, in UTC */
5883
+ from?: string;
5884
+ /** @description The last day, in UTC */
5885
+ to?: string;
5886
+ };
5887
+ header?: never;
5888
+ path: {
5889
+ workspaceId: string;
5890
+ /** @description The campaign's ID */
5891
+ ref: string;
5892
+ };
5893
+ cookie?: never;
5894
+ };
5895
+ requestBody?: never;
5896
+ responses: {
5897
+ /** @description The results */
5898
+ 200: {
5899
+ headers: {
5900
+ [name: string]: unknown;
5901
+ };
5902
+ content: {
5903
+ "application/json": components["schemas"]["CampaignResults"];
5904
+ };
5905
+ };
5906
+ /** @description invalid_request: the request is not valid */
5907
+ 400: {
5908
+ headers: {
5909
+ [name: string]: unknown;
5910
+ };
5911
+ content: {
5912
+ "application/json": components["schemas"]["Error"];
5913
+ };
5914
+ };
5915
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
5916
+ 401: {
5917
+ headers: {
5918
+ [name: string]: unknown;
5919
+ };
5920
+ content: {
5921
+ "application/json": components["schemas"]["Error"];
5922
+ };
5923
+ };
5924
+ /** @description payment_required: the workspace waits for payment */
5925
+ 402: {
5926
+ headers: {
5927
+ [name: string]: unknown;
5928
+ };
5929
+ content: {
5930
+ "application/json": components["schemas"]["Error"];
5931
+ };
5932
+ };
5933
+ /** @description not_found: it does not exist, or this operator is not a member */
5934
+ 404: {
5935
+ headers: {
5936
+ [name: string]: unknown;
5937
+ };
5938
+ content: {
5939
+ "application/json": components["schemas"]["Error"];
5940
+ };
5941
+ };
5942
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
5943
+ 429: {
5944
+ headers: {
5945
+ [name: string]: unknown;
5946
+ };
5947
+ content: {
5948
+ "application/json": components["schemas"]["Error"];
5949
+ };
5950
+ };
5951
+ };
5952
+ };
5953
+ put?: never;
5954
+ post?: never;
5955
+ delete?: never;
5956
+ options?: never;
5957
+ head?: never;
5958
+ patch?: never;
5959
+ trace?: never;
5960
+ };
5961
+ "/v1/operator/workspaces/{workspaceId}/campaigns/by-key/{ref}/results": {
5962
+ parameters: {
5963
+ query?: never;
5964
+ header?: never;
5965
+ path?: never;
5966
+ cookie?: never;
5967
+ };
5968
+ /**
5969
+ * A campaign's results per day in UTC and per A/B variant
5970
+ * @description Each day counts the contacts it reached (`entered`, the control group too), and its messages sent, delivered, read, replied and dismissed, the clicks by button value, the goals reached and the conversations started. Test visitors are left out. The days outlive the messages' text.
5971
+ */
5972
+ get: {
5973
+ parameters: {
5974
+ query?: {
5975
+ /** @description The first day, in UTC */
5976
+ from?: string;
5977
+ /** @description The last day, in UTC */
5978
+ to?: string;
5979
+ };
5980
+ header?: never;
5981
+ path: {
5982
+ workspaceId: string;
5983
+ /** @description The campaign's key */
5984
+ ref: string;
5985
+ };
5986
+ cookie?: never;
5987
+ };
5988
+ requestBody?: never;
5989
+ responses: {
5990
+ /** @description The results */
5991
+ 200: {
5992
+ headers: {
5993
+ [name: string]: unknown;
5994
+ };
5995
+ content: {
5996
+ "application/json": components["schemas"]["CampaignResults"];
5997
+ };
5998
+ };
5999
+ /** @description invalid_request: the request is not valid */
6000
+ 400: {
6001
+ headers: {
6002
+ [name: string]: unknown;
6003
+ };
6004
+ content: {
6005
+ "application/json": components["schemas"]["Error"];
6006
+ };
6007
+ };
6008
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
6009
+ 401: {
6010
+ headers: {
6011
+ [name: string]: unknown;
6012
+ };
6013
+ content: {
6014
+ "application/json": components["schemas"]["Error"];
6015
+ };
6016
+ };
6017
+ /** @description payment_required: the workspace waits for payment */
6018
+ 402: {
6019
+ headers: {
6020
+ [name: string]: unknown;
6021
+ };
6022
+ content: {
6023
+ "application/json": components["schemas"]["Error"];
6024
+ };
6025
+ };
6026
+ /** @description not_found: it does not exist, or this operator is not a member */
6027
+ 404: {
6028
+ headers: {
6029
+ [name: string]: unknown;
6030
+ };
6031
+ content: {
6032
+ "application/json": components["schemas"]["Error"];
6033
+ };
6034
+ };
6035
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
6036
+ 429: {
6037
+ headers: {
6038
+ [name: string]: unknown;
6039
+ };
6040
+ content: {
6041
+ "application/json": components["schemas"]["Error"];
6042
+ };
6043
+ };
6044
+ };
6045
+ };
6046
+ put?: never;
6047
+ post?: never;
6048
+ delete?: never;
6049
+ options?: never;
6050
+ head?: never;
6051
+ patch?: never;
6052
+ trace?: never;
6053
+ };
6054
+ "/v1/operator/workspaces/{workspaceId}/campaigns/{ref}/send": {
6055
+ parameters: {
6056
+ query?: never;
6057
+ header?: never;
6058
+ path?: never;
6059
+ cookie?: never;
6060
+ };
6061
+ get?: never;
6062
+ put?: never;
6063
+ /**
6064
+ * Run a live campaign for one person, from your code
6065
+ * @description It skips the audience and the trigger, because your code chose the person, and keeps the frequency and the visitor's opt-out. `data` fills `{{ data.<key> }}` in the text. A retry with the same `clientId`, and a send that the frequency keeps out, answer 200 with the message that is there.
6066
+ */
6067
+ post: {
6068
+ parameters: {
6069
+ query?: never;
6070
+ header?: never;
6071
+ path: {
6072
+ workspaceId: string;
6073
+ /** @description The campaign's ID */
6074
+ ref: string;
6075
+ };
6076
+ cookie?: never;
6077
+ };
6078
+ requestBody: {
6079
+ content: {
6080
+ "application/json": {
6081
+ /** @description Your own ID for this send. A retry with the same one answers the first result */
6082
+ clientId: string;
6083
+ visitor: components["schemas"]["VisitorSelector"];
6084
+ /** @description Values for `{{ data.<key> }}` in the text */
6085
+ data?: {
6086
+ [key: string]: string | number | boolean;
6087
+ };
6088
+ };
6089
+ };
6090
+ };
6091
+ responses: {
6092
+ /** @description A retry, or a message the frequency keeps: the one that is there */
6093
+ 200: {
6094
+ headers: {
6095
+ [name: string]: unknown;
6096
+ };
6097
+ content: {
6098
+ "application/json": {
6099
+ outboundMessage: components["schemas"]["OutboundMessage"];
6100
+ };
6101
+ };
6102
+ };
6103
+ /** @description The new outbound message */
6104
+ 201: {
6105
+ headers: {
6106
+ [name: string]: unknown;
6107
+ };
6108
+ content: {
6109
+ "application/json": {
6110
+ outboundMessage: components["schemas"]["OutboundMessage"];
6111
+ };
6112
+ };
6113
+ };
6114
+ /** @description invalid_request: the request is not valid */
6115
+ 400: {
6116
+ headers: {
6117
+ [name: string]: unknown;
6118
+ };
6119
+ content: {
6120
+ "application/json": components["schemas"]["Error"];
6121
+ };
6122
+ };
6123
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
6124
+ 401: {
6125
+ headers: {
6126
+ [name: string]: unknown;
6127
+ };
6128
+ content: {
6129
+ "application/json": components["schemas"]["Error"];
6130
+ };
6131
+ };
6132
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
6133
+ 402: {
6134
+ headers: {
6135
+ [name: string]: unknown;
6136
+ };
6137
+ content: {
6138
+ "application/json": components["schemas"]["Error"];
6139
+ };
6140
+ };
6141
+ /** @description blocked: the team blocked this visitor */
6142
+ 403: {
6143
+ headers: {
6144
+ [name: string]: unknown;
6145
+ };
6146
+ content: {
6147
+ "application/json": components["schemas"]["Error"];
6148
+ };
6149
+ };
6150
+ /** @description not_found: no such campaign, or no visitor has this `id` */
6151
+ 404: {
6152
+ headers: {
6153
+ [name: string]: unknown;
6154
+ };
6155
+ content: {
6156
+ "application/json": components["schemas"]["Error"];
6157
+ };
6158
+ };
6159
+ /** @description campaign_not_live: the campaign is a draft, paused or ended. opted_out: the visitor turned off automatic messages */
6160
+ 409: {
6161
+ headers: {
6162
+ [name: string]: unknown;
6163
+ };
6164
+ content: {
6165
+ "application/json": components["schemas"]["Error"];
6166
+ };
6167
+ };
6168
+ /** @description too_large: the body is over 64 KB */
6169
+ 413: {
6170
+ headers: {
6171
+ [name: string]: unknown;
6172
+ };
6173
+ content: {
6174
+ "application/json": components["schemas"]["Error"];
6175
+ };
6176
+ };
6177
+ /** @description too_many_requests: over the key's rate limit. too_many_waiting: the visitor has too many outbound messages waiting */
6178
+ 429: {
6179
+ headers: {
6180
+ [name: string]: unknown;
6181
+ };
6182
+ content: {
6183
+ "application/json": components["schemas"]["Error"];
6184
+ };
6185
+ };
6186
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
6187
+ 503: {
6188
+ headers: {
6189
+ [name: string]: unknown;
6190
+ };
6191
+ content: {
6192
+ "application/json": components["schemas"]["Error"];
6193
+ };
6194
+ };
6195
+ };
6196
+ };
6197
+ delete?: never;
6198
+ options?: never;
6199
+ head?: never;
6200
+ patch?: never;
6201
+ trace?: never;
6202
+ };
6203
+ "/v1/operator/workspaces/{workspaceId}/campaigns/by-key/{ref}/send": {
6204
+ parameters: {
6205
+ query?: never;
6206
+ header?: never;
6207
+ path?: never;
6208
+ cookie?: never;
6209
+ };
6210
+ get?: never;
6211
+ put?: never;
6212
+ /**
6213
+ * Run a live campaign for one person, from your code
6214
+ * @description It skips the audience and the trigger, because your code chose the person, and keeps the frequency and the visitor's opt-out. `data` fills `{{ data.<key> }}` in the text. A retry with the same `clientId`, and a send that the frequency keeps out, answer 200 with the message that is there.
6215
+ */
6216
+ post: {
6217
+ parameters: {
6218
+ query?: never;
6219
+ header?: never;
6220
+ path: {
6221
+ workspaceId: string;
6222
+ /** @description The campaign's key */
6223
+ ref: string;
6224
+ };
6225
+ cookie?: never;
6226
+ };
6227
+ requestBody: {
6228
+ content: {
6229
+ "application/json": {
6230
+ /** @description Your own ID for this send. A retry with the same one answers the first result */
6231
+ clientId: string;
6232
+ visitor: components["schemas"]["VisitorSelector"];
6233
+ /** @description Values for `{{ data.<key> }}` in the text */
6234
+ data?: {
6235
+ [key: string]: string | number | boolean;
6236
+ };
6237
+ };
6238
+ };
6239
+ };
6240
+ responses: {
6241
+ /** @description A retry, or a message the frequency keeps: the one that is there */
6242
+ 200: {
6243
+ headers: {
6244
+ [name: string]: unknown;
6245
+ };
6246
+ content: {
6247
+ "application/json": {
6248
+ outboundMessage: components["schemas"]["OutboundMessage"];
6249
+ };
6250
+ };
6251
+ };
6252
+ /** @description The new outbound message */
6253
+ 201: {
6254
+ headers: {
6255
+ [name: string]: unknown;
6256
+ };
6257
+ content: {
6258
+ "application/json": {
6259
+ outboundMessage: components["schemas"]["OutboundMessage"];
6260
+ };
6261
+ };
6262
+ };
6263
+ /** @description invalid_request: the request is not valid */
6264
+ 400: {
6265
+ headers: {
6266
+ [name: string]: unknown;
6267
+ };
6268
+ content: {
6269
+ "application/json": components["schemas"]["Error"];
6270
+ };
6271
+ };
6272
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
6273
+ 401: {
6274
+ headers: {
6275
+ [name: string]: unknown;
6276
+ };
6277
+ content: {
6278
+ "application/json": components["schemas"]["Error"];
6279
+ };
6280
+ };
6281
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
6282
+ 402: {
6283
+ headers: {
6284
+ [name: string]: unknown;
6285
+ };
6286
+ content: {
6287
+ "application/json": components["schemas"]["Error"];
6288
+ };
6289
+ };
6290
+ /** @description blocked: the team blocked this visitor */
6291
+ 403: {
6292
+ headers: {
6293
+ [name: string]: unknown;
6294
+ };
6295
+ content: {
6296
+ "application/json": components["schemas"]["Error"];
6297
+ };
6298
+ };
6299
+ /** @description not_found: no such campaign, or no visitor has this `id` */
6300
+ 404: {
6301
+ headers: {
6302
+ [name: string]: unknown;
6303
+ };
6304
+ content: {
6305
+ "application/json": components["schemas"]["Error"];
6306
+ };
6307
+ };
6308
+ /** @description campaign_not_live: the campaign is a draft, paused or ended. opted_out: the visitor turned off automatic messages */
6309
+ 409: {
6310
+ headers: {
6311
+ [name: string]: unknown;
6312
+ };
6313
+ content: {
6314
+ "application/json": components["schemas"]["Error"];
6315
+ };
6316
+ };
6317
+ /** @description too_large: the body is over 64 KB */
6318
+ 413: {
6319
+ headers: {
6320
+ [name: string]: unknown;
6321
+ };
6322
+ content: {
6323
+ "application/json": components["schemas"]["Error"];
6324
+ };
6325
+ };
6326
+ /** @description too_many_requests: over the key's rate limit. too_many_waiting: the visitor has too many outbound messages waiting */
6327
+ 429: {
6328
+ headers: {
6329
+ [name: string]: unknown;
6330
+ };
6331
+ content: {
6332
+ "application/json": components["schemas"]["Error"];
6333
+ };
6334
+ };
6335
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
6336
+ 503: {
6337
+ headers: {
6338
+ [name: string]: unknown;
6339
+ };
6340
+ content: {
6341
+ "application/json": components["schemas"]["Error"];
6342
+ };
6343
+ };
6344
+ };
6345
+ };
6346
+ delete?: never;
6347
+ options?: never;
6348
+ head?: never;
6349
+ patch?: never;
6350
+ trace?: never;
6351
+ };
6352
+ "/v1/operator/workspaces/{workspaceId}/track": {
6353
+ parameters: {
6354
+ query?: never;
6355
+ header?: never;
6356
+ path?: never;
6357
+ cookie?: never;
6358
+ };
6359
+ get?: never;
6360
+ put?: never;
6361
+ /**
6362
+ * Track an event about a contact, from your server. API keys only
6363
+ * @description Counts the event `name` on the contact that `visitor` names, which it creates or updates. Each contact keeps, per name, how often it happened and when, first and last, and no log. Conditions read `events.<name>.count` and `events.<name>.lastAt`, and a live campaign with the trigger `{ type: "event", name }` runs for the contact, with `properties` in its text. Properties are never stored. A repeat of a recent `id` counts once.
6364
+ */
6365
+ post: {
6366
+ parameters: {
6367
+ query?: never;
6368
+ header?: never;
6369
+ path: {
6370
+ workspaceId: string;
6371
+ };
6372
+ cookie?: never;
6373
+ };
6374
+ requestBody: {
6375
+ content: {
6376
+ "application/json": {
6377
+ visitor: components["schemas"]["VisitorSelector"];
6378
+ /** @example export.finished */
6379
+ name: string;
6380
+ /** @description Values for `{{ event.properties.<key> }}` in an `event` campaign's text. Never stored */
6381
+ properties?: {
6382
+ [key: string]: unknown;
6383
+ };
6384
+ /**
6385
+ * Format: date-time
6386
+ * @description When it happened. Now if left out
6387
+ */
6388
+ occurredAt?: string;
6389
+ /** @description Your own ID for this event, so a retry soon after counts once */
6390
+ id?: string;
6391
+ };
6392
+ };
6393
+ };
6394
+ responses: {
6395
+ /** @description Tracked. `counted` is false for a repeat of a recent `id` */
6396
+ 200: {
6397
+ headers: {
6398
+ [name: string]: unknown;
6399
+ };
6400
+ content: {
6401
+ "application/json": {
6402
+ visitorId: string;
6403
+ counted: boolean;
6404
+ };
6405
+ };
6406
+ };
6407
+ /** @description invalid_request: the request is not valid */
6408
+ 400: {
6409
+ headers: {
6410
+ [name: string]: unknown;
6411
+ };
6412
+ content: {
6413
+ "application/json": components["schemas"]["Error"];
6414
+ };
6415
+ };
6416
+ /** @description unauthorized: no valid session, or the API key is not valid or was revoked. two_factor_required: the session has not passed two-step sign-in yet */
6417
+ 401: {
6418
+ headers: {
6419
+ [name: string]: unknown;
6420
+ };
6421
+ content: {
6422
+ "application/json": components["schemas"]["Error"];
6423
+ };
6424
+ };
6425
+ /** @description payment_required: the workspace waits for payment. read_only: the subscription ended, so operators can only read and export */
6426
+ 402: {
6427
+ headers: {
6428
+ [name: string]: unknown;
6429
+ };
6430
+ content: {
6431
+ "application/json": components["schemas"]["Error"];
6432
+ };
6433
+ };
6434
+ /** @description forbidden: a member sent it. Only your server tracks events, with a key */
6435
+ 403: {
6436
+ headers: {
6437
+ [name: string]: unknown;
6438
+ };
6439
+ content: {
6440
+ "application/json": components["schemas"]["Error"];
6441
+ };
6442
+ };
6443
+ /** @description not_found: no visitor has this `id` */
6444
+ 404: {
6445
+ headers: {
6446
+ [name: string]: unknown;
6447
+ };
6448
+ content: {
6449
+ "application/json": components["schemas"]["Error"];
6450
+ };
6451
+ };
6452
+ /** @description too_large: the body is over 64 KB */
6453
+ 413: {
6454
+ headers: {
6455
+ [name: string]: unknown;
6456
+ };
6457
+ content: {
6458
+ "application/json": components["schemas"]["Error"];
6459
+ };
6460
+ };
6461
+ /** @description too_many_requests: over an API key's 300 requests a minute. Retry after `retry-after` */
6462
+ 429: {
6463
+ headers: {
6464
+ [name: string]: unknown;
6465
+ };
6466
+ content: {
6467
+ "application/json": components["schemas"]["Error"];
6468
+ };
6469
+ };
6470
+ /** @description busy: the workspace is busy. Retry after `retry-after` */
6471
+ 503: {
6472
+ headers: {
6473
+ [name: string]: unknown;
6474
+ };
6475
+ content: {
6476
+ "application/json": components["schemas"]["Error"];
6477
+ };
6478
+ };
6479
+ };
6480
+ };
6481
+ delete?: never;
6482
+ options?: never;
6483
+ head?: never;
6484
+ patch?: never;
6485
+ trace?: never;
6486
+ };
4099
6487
  "/v1/operator/workspaces/{workspaceId}/saved-replies": {
4100
6488
  parameters: {
4101
6489
  query?: never;
@@ -4945,7 +7333,7 @@ export interface components {
4945
7333
  Error: {
4946
7334
  error: {
4947
7335
  /** @enum {string} */
4948
- code: "already_active" | "already_member" | "bad_endpoint" | "bad_origin" | "bad_signature" | "billing_unavailable" | "blocked" | "bots_paused" | "busy" | "check_unavailable" | "checkout_retry_later" | "conversation_closed" | "drafts_text_only" | "email_mismatch" | "email_rejected" | "email_taken" | "email_unavailable" | "forbidden" | "human_handling" | "grant_limit" | "internal_error" | "invalid_client" | "invalid_name" | "invalid_redirect_uri" | "invalid_reply_to" | "invalid_request" | "invite_invalid" | "invite_other_email" | "label_limit" | "label_name_taken" | "last_owner" | "last_workspace" | "manual_review" | "length_required" | "link_invalid" | "mail_failed" | "message_seen" | "name_mismatch" | "no_setup" | "no_customer" | "no_email" | "no_removal" | "not_a_member" | "not_an_image" | "not_found" | "operator_limit" | "origin_not_allowed" | "payment_pending" | "payment_required" | "push_unavailable" | "read_only" | "removal_blocked" | "removal_not_needed" | "saved_reply_limit" | "saved_reply_shortcut_taken" | "send_as_member_required" | "send_email_required" | "send_mode_required" | "signed_in" | "sign_in_again" | "site_limit" | "storage_full" | "suspended" | "team_changed" | "too_large" | "too_many_attempts" | "too_many_pixels" | "too_many_requests" | "too_many_streams" | "too_many_waiting" | "too_slow" | "two_factor_off" | "two_factor_on" | "two_factor_required" | "two_factor_unreadable" | "type_not_allowed" | "unauthorized" | "unsupported_media_type" | "webhook_limit" | "workspace_deleted" | "wrong_code";
7336
+ code: "already_active" | "already_member" | "bad_endpoint" | "bad_origin" | "bad_signature" | "billing_unavailable" | "blocked" | "bots_paused" | "busy" | "campaign_ended" | "campaign_key_taken" | "campaign_not_live" | "check_unavailable" | "checkout_retry_later" | "conversation_closed" | "drafts_text_only" | "email_mismatch" | "email_rejected" | "email_taken" | "email_unavailable" | "forbidden" | "human_handling" | "grant_limit" | "internal_error" | "invalid_client" | "invalid_name" | "invalid_redirect_uri" | "invalid_reply_to" | "invalid_request" | "invite_invalid" | "invite_other_email" | "label_limit" | "label_name_taken" | "last_owner" | "last_workspace" | "manual_review" | "length_required" | "link_invalid" | "mail_failed" | "message_seen" | "name_mismatch" | "no_setup" | "no_customer" | "no_email" | "no_removal" | "not_a_member" | "not_an_image" | "not_found" | "operator_limit" | "opted_out" | "origin_not_allowed" | "payment_pending" | "payment_required" | "push_unavailable" | "read_only" | "removal_blocked" | "removal_not_needed" | "saved_reply_limit" | "saved_reply_shortcut_taken" | "send_as_member_required" | "send_email_required" | "send_mode_required" | "signed_in" | "sign_in_again" | "site_limit" | "storage_full" | "suspended" | "team_changed" | "too_large" | "too_many_attempts" | "too_many_pixels" | "too_many_requests" | "too_many_streams" | "too_many_waiting" | "too_slow" | "two_factor_off" | "two_factor_on" | "two_factor_required" | "two_factor_unreadable" | "type_not_allowed" | "unauthorized" | "unsupported_media_type" | "webhook_limit" | "workspace_deleted" | "wrong_code";
4949
7337
  message: string;
4950
7338
  requestId?: string;
4951
7339
  };
@@ -5126,6 +7514,7 @@ export interface components {
5126
7514
  authorName: string | null;
5127
7515
  authorPictureUrl: string | null;
5128
7516
  authorId: string | null;
7517
+ campaignId: string | null;
5129
7518
  createdAt: string;
5130
7519
  };
5131
7520
  Visitor: {
@@ -5137,6 +7526,7 @@ export interface components {
5137
7526
  lastReadSeq: string;
5138
7527
  unread: number;
5139
7528
  readCursor: string;
7529
+ optedOut: boolean;
5140
7530
  };
5141
7531
  /**
5142
7532
  * @example {
@@ -5410,7 +7800,7 @@ export interface components {
5410
7800
  Webhook: {
5411
7801
  id: string;
5412
7802
  url: string;
5413
- events: ("conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired")[];
7803
+ events: ("conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired" | "campaign.updated")[];
5414
7804
  enabled: boolean;
5415
7805
  createdBy: {
5416
7806
  /** @enum {string} */
@@ -5423,7 +7813,7 @@ export interface components {
5423
7813
  id: string;
5424
7814
  eventId: string;
5425
7815
  /** @enum {string} */
5426
- type: "conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired";
7816
+ type: "conversation.created" | "message.created" | "message.updated" | "message.deleted" | "conversation.closed" | "conversation.reopened" | "conversation.assigned" | "conversation.handoff" | "conversation.given_back" | "conversation.labeled" | "outbound_message.sent" | "outbound_message.delivered" | "outbound_message.read" | "outbound_message.clicked" | "outbound_message.replied" | "outbound_message.dismissed" | "outbound_message.cancelled" | "outbound_message.expired" | "campaign.updated";
5427
7817
  /** @enum {string} */
5428
7818
  status: "pending" | "sent" | "failed";
5429
7819
  attempts: number;
@@ -5585,7 +7975,7 @@ export interface components {
5585
7975
  /** @enum {string} */
5586
7976
  status: "scheduled" | "sent" | "delivered" | "read" | "replied" | "dismissed" | "cancelled" | "expired";
5587
7977
  /** @enum {string|null} */
5588
- statusReason: "open_conversation" | "open_conversation_skipped" | "human_handling" | "bots_paused" | "blocked" | "permission_revoked" | "workspace_inactive" | "unless_matched" | "cancelled_by_request" | "conversation_deleted" | null;
7978
+ statusReason: "open_conversation" | "open_conversation_skipped" | "human_handling" | "bots_paused" | "blocked" | "permission_revoked" | "workspace_inactive" | "unless_matched" | "cancelled_by_request" | "conversation_deleted" | "opted_out" | "audience_unmatched" | "frequency_capped" | "goal_reached" | "outside_business_hours" | "outside_send_window" | "campaign_paused" | "campaign_ended" | "control_group" | null;
5589
7979
  visitorId: string;
5590
7980
  body: string | null;
5591
7981
  buttons: components["schemas"]["OutboundButton"][];
@@ -5613,6 +8003,9 @@ export interface components {
5613
8003
  sendEmail: boolean;
5614
8004
  conversationId: string | null;
5615
8005
  messageId: string | null;
8006
+ campaignId: string | null;
8007
+ campaignRunId: string | null;
8008
+ variant: string | null;
5616
8009
  dedupeKey: string | null;
5617
8010
  sendAt: string;
5618
8011
  expiresAt: string | null;
@@ -5656,7 +8049,7 @@ export interface components {
5656
8049
  email: string;
5657
8050
  };
5658
8051
  /**
5659
- * @description A rule `{ field, op, value }`, or a group `{ all: [...] }`, `{ any: [...] }` or `{ not: ... }`, which nest. Fields: name, firstName, email, userId, language, country, timeZone, signedIn, firstSeenAt, lastSeenAt, hasChatted, conversationCount, attributes.<key>. Ops: eq, ne, in, not_in, exists, missing, gt, gte, lt, lte, contains, older_than; older_than takes a duration such as 7d.
8052
+ * @description A rule `{ field, op, value }`, or a group `{ all: [...] }`, `{ any: [...] }` or `{ not: ... }`, which nest. Fields: name, firstName, email, userId, language, country, timeZone, signedIn, firstSeenAt, lastSeenAt, hasChatted, conversationCount, optedOut, attributes.<key>, events.<name>.count, events.<name>.lastAt. Ops: eq, ne, in, not_in, exists, missing, gt, gte, lt, lte, contains, older_than; older_than takes a duration such as 7d.
5660
8053
  * @example {
5661
8054
  * "all": [
5662
8055
  * {
@@ -5693,6 +8086,424 @@ export interface components {
5693
8086
  /** Format: uuid */
5694
8087
  id: string;
5695
8088
  };
8089
+ Campaign: {
8090
+ id: string;
8091
+ /** @enum {string} */
8092
+ status: "draft" | "live" | "paused" | "ended";
8093
+ version: number;
8094
+ definition: components["schemas"]["CampaignDefinition"];
8095
+ totals: {
8096
+ entered: number;
8097
+ sent: number;
8098
+ delivered: number;
8099
+ read: number;
8100
+ replied: number;
8101
+ dismissed: number;
8102
+ goalReached: number;
8103
+ conversationsStarted: number;
8104
+ clicks: {
8105
+ [key: string]: number;
8106
+ };
8107
+ };
8108
+ createdAt: string;
8109
+ updatedAt: string;
8110
+ liveAt: string | null;
8111
+ endedAt: string | null;
8112
+ };
8113
+ /**
8114
+ * @example {
8115
+ * "key": "dns-help",
8116
+ * "name": "DNS help after signup",
8117
+ * "audience": {
8118
+ * "field": "attributes.domainVerified",
8119
+ * "op": "ne",
8120
+ * "value": true
8121
+ * },
8122
+ * "trigger": {
8123
+ * "type": "match",
8124
+ * "delay": "1h"
8125
+ * },
8126
+ * "message": {
8127
+ * "sender": {
8128
+ * "email": "julien@example.com"
8129
+ * },
8130
+ * "body": "Hi {{ firstName | default: \"there\" }}, want me to check your DNS with you?",
8131
+ * "buttons": [
8132
+ * {
8133
+ * "label": "Yes, please",
8134
+ * "value": "yes"
8135
+ * },
8136
+ * {
8137
+ * "label": "I'm fine",
8138
+ * "dismiss": true,
8139
+ * "value": "no"
8140
+ * }
8141
+ * ]
8142
+ * },
8143
+ * "presentation": {
8144
+ * "startConversation": "on_reply",
8145
+ * "show": "preview",
8146
+ * "ifConversationOpen": "skip"
8147
+ * },
8148
+ * "delivery": {
8149
+ * "sendEmail": false
8150
+ * },
8151
+ * "rules": {
8152
+ * "frequency": "once",
8153
+ * "businessHours": true,
8154
+ * "endsAt": null
8155
+ * }
8156
+ * }
8157
+ */
8158
+ CampaignDefinition: {
8159
+ /**
8160
+ * @description Lowercase letters, digits, - and _, unique in the workspace
8161
+ * @example dns-help
8162
+ */
8163
+ key: string;
8164
+ name: string;
8165
+ audience?: components["schemas"]["Condition"] & unknown;
8166
+ trigger: components["schemas"]["CampaignTrigger"];
8167
+ message: components["schemas"]["CampaignMessage"];
8168
+ presentation: {
8169
+ /** @enum {string} */
8170
+ startConversation: "on_reply" | "now";
8171
+ /** @enum {string} */
8172
+ show: "badge" | "preview" | "chat";
8173
+ /** @enum {string} */
8174
+ ifConversationOpen: "hold" | "join" | "skip";
8175
+ };
8176
+ /**
8177
+ * @default {
8178
+ * "sendEmail": false
8179
+ * }
8180
+ */
8181
+ delivery?: {
8182
+ /** @default false */
8183
+ sendEmail?: boolean;
8184
+ assignOnReply?: boolean;
8185
+ /**
8186
+ * @description A number with m, h or d, such as 1h
8187
+ * @example 1h
8188
+ */
8189
+ expiresIn?: string;
8190
+ /**
8191
+ * @description An `on_reply` message still unread after this time goes in a conversation and out by email, to a visitor with an email address
8192
+ * @example 1h
8193
+ */
8194
+ emailIfUnread?: string;
8195
+ };
8196
+ /**
8197
+ * @default {
8198
+ * "frequency": "once",
8199
+ * "businessHours": false,
8200
+ * "endsAt": null
8201
+ * }
8202
+ */
8203
+ rules?: {
8204
+ /**
8205
+ * @description `"once"` per contact, or `{ "every": "7d" }` at most
8206
+ * @default once
8207
+ */
8208
+ frequency?: "once" | {
8209
+ /**
8210
+ * @description A number with m, h or d, such as 1h
8211
+ * @example 1h
8212
+ */
8213
+ every: string;
8214
+ };
8215
+ /**
8216
+ * @description Send only during the workspace's business hours
8217
+ * @default false
8218
+ */
8219
+ businessHours?: boolean;
8220
+ /** @description Send only between these times on the visitor's own clock */
8221
+ sendWindow?: {
8222
+ /** @example 09:00 */
8223
+ from: string;
8224
+ /** @example 09:00 */
8225
+ to: string;
8226
+ };
8227
+ /**
8228
+ * Format: date-time
8229
+ * @default null
8230
+ */
8231
+ endsAt?: string | null;
8232
+ exitWhen?: components["schemas"]["CampaignCondition"];
8233
+ /**
8234
+ * @description A condition, plus `within`: a contact who matches it within that time after a message reached the goal, which ends the campaign for them and counts in results
8235
+ * @example {
8236
+ * "field": "attributes.domainVerified",
8237
+ * "op": "eq",
8238
+ * "value": true,
8239
+ * "within": "7d"
8240
+ * }
8241
+ */
8242
+ goal?: unknown;
8243
+ };
8244
+ /** @description A/B variants by weight, each with its own message or the campaign's, and at most one `control: true` group that gets nothing */
8245
+ variants?: ({
8246
+ /**
8247
+ * @description Lowercase letters, digits, - and _, unique in the workspace
8248
+ * @example dns-help
8249
+ */
8250
+ key: string;
8251
+ weight: number;
8252
+ message?: components["schemas"]["CampaignMessage"] & unknown;
8253
+ } | {
8254
+ /**
8255
+ * @description Lowercase letters, digits, - and _, unique in the workspace
8256
+ * @example dns-help
8257
+ */
8258
+ key: string;
8259
+ weight: number;
8260
+ /**
8261
+ * @description The control group: no message, so the goal's results can compare
8262
+ * @enum {boolean}
8263
+ */
8264
+ control: true;
8265
+ })[];
8266
+ };
8267
+ /** @description `match`: when a contact starts to match the audience, after `delay`. `schedule`: everyone in the audience at a time of day, once or again. `event`: when your server tracks the event `name`. `page`: in the widget, after `seconds` on a page that matches `url`. `api`: only when your code calls send */
8268
+ CampaignTrigger: {
8269
+ /** @enum {string} */
8270
+ type: "match";
8271
+ /**
8272
+ * @description A number with m, h or d, such as 1h
8273
+ * @example 1h
8274
+ */
8275
+ delay?: string;
8276
+ } | {
8277
+ /** @enum {string} */
8278
+ type: "schedule";
8279
+ /** @enum {string} */
8280
+ repeat: "once" | "daily" | "weekly" | "monthly";
8281
+ /** @example 09:00 */
8282
+ time: string;
8283
+ days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
8284
+ /**
8285
+ * Format: date
8286
+ * @example 2026-12-01
8287
+ */
8288
+ startDate: string;
8289
+ /**
8290
+ * Format: date
8291
+ * @example 2026-12-01
8292
+ */
8293
+ endDate?: string;
8294
+ /** @default UTC */
8295
+ timeZone?: string;
8296
+ } | {
8297
+ /** @enum {string} */
8298
+ type: "event";
8299
+ name: string;
8300
+ /**
8301
+ * @description A number with m, h or d, such as 1h
8302
+ * @example 1h
8303
+ */
8304
+ delay?: string;
8305
+ } | {
8306
+ /** @enum {string} */
8307
+ type: "page";
8308
+ /** @description A path or a full URL, where `*` matches any text, such as `/pricing*`. A path matches on any allowed site */
8309
+ url: string;
8310
+ seconds: number;
8311
+ } | {
8312
+ /** @enum {string} */
8313
+ type: "api";
8314
+ };
8315
+ CampaignMessage: {
8316
+ sender?: components["schemas"]["OutboundSender"];
8317
+ body: string;
8318
+ buttons?: components["schemas"]["OutboundButton"][];
8319
+ /** @description A body and buttons per language, by the visitor's language */
8320
+ translations?: {
8321
+ en?: {
8322
+ body: string;
8323
+ buttons?: components["schemas"]["OutboundButton"][];
8324
+ };
8325
+ fr?: {
8326
+ body: string;
8327
+ buttons?: components["schemas"]["OutboundButton"][];
8328
+ };
8329
+ es?: {
8330
+ body: string;
8331
+ buttons?: components["schemas"]["OutboundButton"][];
8332
+ };
8333
+ };
8334
+ };
8335
+ /**
8336
+ * @description A contact who matches it leaves the campaign, and their waiting messages from it are cancelled. `repliedToCampaign` stops it once they answer
8337
+ * @example {
8338
+ * "all": [
8339
+ * {
8340
+ * "field": "attributes.plan",
8341
+ * "op": "in",
8342
+ * "value": [
8343
+ * "trial",
8344
+ * "pro"
8345
+ * ]
8346
+ * },
8347
+ * {
8348
+ * "field": "attributes.onboarded",
8349
+ * "op": "ne",
8350
+ * "value": true
8351
+ * }
8352
+ * ]
8353
+ * }
8354
+ */
8355
+ CampaignCondition: {
8356
+ field: string;
8357
+ /** @enum {string} */
8358
+ op: "eq" | "ne" | "in" | "not_in" | "exists" | "missing" | "gt" | "gte" | "lt" | "lte" | "contains" | "older_than";
8359
+ value?: (string | number | boolean) | (string | number | boolean)[];
8360
+ } | {
8361
+ all: components["schemas"]["Condition"][];
8362
+ } | {
8363
+ any: components["schemas"]["Condition"][];
8364
+ } | {
8365
+ not: components["schemas"]["Condition"];
8366
+ };
8367
+ CampaignSettingsView: components["schemas"]["CampaignSettings"] & {
8368
+ /** @description The member or key who paused every campaign, by its name then, or null */
8369
+ pausedBy: string | null;
8370
+ /** @description When, or null while they run */
8371
+ pausedAt: string | null;
8372
+ };
8373
+ CampaignSettings: {
8374
+ /** @description Every campaign's messages wait while true */
8375
+ paused: boolean;
8376
+ /** @description The fewest hours between two campaign messages to one visitor. 0 turns it off */
8377
+ gapHours: number;
8378
+ };
8379
+ CampaignPatch: {
8380
+ /**
8381
+ * @description Lowercase letters, digits, - and _, unique in the workspace
8382
+ * @example dns-help
8383
+ */
8384
+ key?: string;
8385
+ name?: string;
8386
+ audience?: components["schemas"]["Condition"] & unknown;
8387
+ trigger?: components["schemas"]["CampaignTrigger"];
8388
+ message?: components["schemas"]["CampaignMessage"];
8389
+ presentation?: {
8390
+ /** @enum {string} */
8391
+ startConversation: "on_reply" | "now";
8392
+ /** @enum {string} */
8393
+ show: "badge" | "preview" | "chat";
8394
+ /** @enum {string} */
8395
+ ifConversationOpen: "hold" | "join" | "skip";
8396
+ };
8397
+ delivery?: {
8398
+ /** @default false */
8399
+ sendEmail?: boolean;
8400
+ assignOnReply?: boolean;
8401
+ /**
8402
+ * @description A number with m, h or d, such as 1h
8403
+ * @example 1h
8404
+ */
8405
+ expiresIn?: string;
8406
+ /**
8407
+ * @description An `on_reply` message still unread after this time goes in a conversation and out by email, to a visitor with an email address
8408
+ * @example 1h
8409
+ */
8410
+ emailIfUnread?: string;
8411
+ };
8412
+ rules?: {
8413
+ /**
8414
+ * @description `"once"` per contact, or `{ "every": "7d" }` at most
8415
+ * @default once
8416
+ */
8417
+ frequency?: "once" | {
8418
+ /**
8419
+ * @description A number with m, h or d, such as 1h
8420
+ * @example 1h
8421
+ */
8422
+ every: string;
8423
+ };
8424
+ /**
8425
+ * @description Send only during the workspace's business hours
8426
+ * @default false
8427
+ */
8428
+ businessHours?: boolean;
8429
+ /** @description Send only between these times on the visitor's own clock */
8430
+ sendWindow?: {
8431
+ /** @example 09:00 */
8432
+ from: string;
8433
+ /** @example 09:00 */
8434
+ to: string;
8435
+ };
8436
+ /**
8437
+ * Format: date-time
8438
+ * @default null
8439
+ */
8440
+ endsAt?: string | null;
8441
+ exitWhen?: components["schemas"]["CampaignCondition"];
8442
+ /**
8443
+ * @description A condition, plus `within`: a contact who matches it within that time after a message reached the goal, which ends the campaign for them and counts in results
8444
+ * @example {
8445
+ * "field": "attributes.domainVerified",
8446
+ * "op": "eq",
8447
+ * "value": true,
8448
+ * "within": "7d"
8449
+ * }
8450
+ */
8451
+ goal?: unknown;
8452
+ };
8453
+ /** @description A/B variants by weight, each with its own message or the campaign's, and at most one `control: true` group that gets nothing */
8454
+ variants?: ({
8455
+ /**
8456
+ * @description Lowercase letters, digits, - and _, unique in the workspace
8457
+ * @example dns-help
8458
+ */
8459
+ key: string;
8460
+ weight: number;
8461
+ message?: components["schemas"]["CampaignMessage"] & unknown;
8462
+ } | {
8463
+ /**
8464
+ * @description Lowercase letters, digits, - and _, unique in the workspace
8465
+ * @example dns-help
8466
+ */
8467
+ key: string;
8468
+ weight: number;
8469
+ /**
8470
+ * @description The control group: no message, so the goal's results can compare
8471
+ * @enum {boolean}
8472
+ */
8473
+ control: true;
8474
+ })[];
8475
+ };
8476
+ CampaignResults: {
8477
+ days: {
8478
+ entered: number;
8479
+ sent: number;
8480
+ delivered: number;
8481
+ read: number;
8482
+ replied: number;
8483
+ dismissed: number;
8484
+ goalReached: number;
8485
+ conversationsStarted: number;
8486
+ clicks: {
8487
+ [key: string]: number;
8488
+ };
8489
+ day: string;
8490
+ variant: string | null;
8491
+ }[];
8492
+ variants: {
8493
+ entered: number;
8494
+ sent: number;
8495
+ delivered: number;
8496
+ read: number;
8497
+ replied: number;
8498
+ dismissed: number;
8499
+ goalReached: number;
8500
+ conversationsStarted: number;
8501
+ clicks: {
8502
+ [key: string]: number;
8503
+ };
8504
+ variant: string | null;
8505
+ }[];
8506
+ };
5696
8507
  LiveVisitor: {
5697
8508
  tab: string;
5698
8509
  page: string;