@wevion/cli 1.0.4515 → 1.0.4516

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.
Files changed (2) hide show
  1. package/openapi.json +2570 -340
  2. package/package.json +1 -1
package/openapi.json CHANGED
@@ -3579,6 +3579,12 @@
3579
3579
  "enum": [
3580
3580
  "exoclick"
3581
3581
  ]
3582
+ },
3583
+ {
3584
+ "type": "string",
3585
+ "enum": [
3586
+ "microsoft"
3587
+ ]
3582
3588
  }
3583
3589
  ]
3584
3590
  },
@@ -17982,6 +17988,12 @@
17982
17988
  "enum": [
17983
17989
  "exoclick"
17984
17990
  ]
17991
+ },
17992
+ {
17993
+ "type": "string",
17994
+ "enum": [
17995
+ "microsoft"
17996
+ ]
17985
17997
  }
17986
17998
  ]
17987
17999
  },
@@ -18309,6 +18321,12 @@
18309
18321
  "enum": [
18310
18322
  "exoclick"
18311
18323
  ]
18324
+ },
18325
+ {
18326
+ "type": "string",
18327
+ "enum": [
18328
+ "microsoft"
18329
+ ]
18312
18330
  }
18313
18331
  ]
18314
18332
  },
@@ -19712,6 +19730,12 @@
19712
19730
  "enum": [
19713
19731
  "exoclick"
19714
19732
  ]
19733
+ },
19734
+ {
19735
+ "type": "string",
19736
+ "enum": [
19737
+ "microsoft"
19738
+ ]
19715
19739
  }
19716
19740
  ]
19717
19741
  }
@@ -20049,6 +20073,12 @@
20049
20073
  "enum": [
20050
20074
  "exoclick"
20051
20075
  ]
20076
+ },
20077
+ {
20078
+ "type": "string",
20079
+ "enum": [
20080
+ "microsoft"
20081
+ ]
20052
20082
  }
20053
20083
  ]
20054
20084
  },
@@ -20365,273 +20395,15 @@
20365
20395
  "enum": [
20366
20396
  "exoclick"
20367
20397
  ]
20368
- }
20369
- ]
20370
- },
20371
- "purchaseValue": {
20372
- "type": "number"
20373
- },
20374
- "purchases": {
20375
- "type": "number"
20376
- },
20377
- "revenue": {
20378
- "type": "number"
20379
- },
20380
- "roas": {
20381
- "type": "number"
20382
- },
20383
- "spend": {
20384
- "type": "number"
20385
- }
20386
- }
20387
- }
20388
- }
20389
- }
20390
- }
20391
- }
20392
- }
20393
- },
20394
- "401": {
20395
- "description": "Unauthorized - missing or invalid bearer token",
20396
- "content": {
20397
- "application/json": {
20398
- "schema": {
20399
- "$ref": "#/components/schemas/ErrorResponse"
20400
- }
20401
- }
20402
- }
20403
- },
20404
- "429": {
20405
- "description": "Too many requests - rate limit exceeded. Reachable on every API-key operation: the per-key cap sold with the plan answers `code: API_KEY_RATE_LIMITED` with `retry_after_seconds` and the `Retry-After` header. The global per-IP limiter can answer here too, with the same status and only `statusCode`, `error` and `message`.",
20406
- "content": {
20407
- "application/json": {
20408
- "schema": {
20409
- "$ref": "#/components/schemas/RateLimitedResponse"
20410
- }
20411
- }
20412
- }
20413
- },
20414
- "500": {
20415
- "description": "Internal server error",
20416
- "content": {
20417
- "application/json": {
20418
- "schema": {
20419
- "type": "object",
20420
- "required": [
20421
- "statusCode",
20422
- "error",
20423
- "message"
20424
- ],
20425
- "properties": {
20426
- "statusCode": {
20427
- "type": "number"
20428
- },
20429
- "error": {
20430
- "type": "string"
20431
- },
20432
- "message": {
20433
- "type": "string"
20434
- }
20435
- }
20436
- }
20437
- }
20438
- }
20439
- },
20440
- "503": {
20441
- "description": "Session revocation check unavailable (Redis): retry after the Retry-After header.",
20442
- "headers": {
20443
- "Retry-After": {
20444
- "description": "Seconds to wait before retrying the identical request.",
20445
- "schema": {
20446
- "type": "integer"
20447
- }
20448
- }
20449
- },
20450
- "content": {
20451
- "application/json": {
20452
- "schema": {
20453
- "$ref": "#/components/schemas/ErrorResponse"
20454
- }
20455
- }
20456
- }
20457
- }
20458
- }
20459
- }
20460
- },
20461
- "/api/v1/analytics/unified": {
20462
- "get": {
20463
- "operationId": "getCrossChannelUnifiedAnalytics",
20464
- "summary": "Get cross-channel unified analytics metrics",
20465
- "tags": [
20466
- "analytics-cross-channel"
20467
- ],
20468
- "description": "Returns aggregated cross-channel KPI totals, per-platform KPI breakdowns, spend share and the latest included insight date.",
20469
- "parameters": [
20470
- {
20471
- "schema": {
20472
- "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
20473
- "type": "string"
20474
- },
20475
- "in": "query",
20476
- "name": "since",
20477
- "required": true
20478
- },
20479
- {
20480
- "schema": {
20481
- "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
20482
- "type": "string"
20483
- },
20484
- "in": "query",
20485
- "name": "until",
20486
- "required": true
20487
- },
20488
- {
20489
- "schema": {
20490
- "type": "string"
20491
- },
20492
- "in": "query",
20493
- "name": "platforms",
20494
- "required": false,
20495
- "description": "Comma-separated platform list."
20496
- },
20497
- {
20498
- "schema": {
20499
- "pattern": "^[A-Z]{3}$",
20500
- "type": "string"
20501
- },
20502
- "in": "query",
20503
- "name": "target_currency",
20504
- "required": true
20505
- },
20506
- {
20507
- "schema": {
20508
- "pattern": "^[A-Za-z0-9_/+-]+$",
20509
- "type": "string"
20510
- },
20511
- "in": "query",
20512
- "name": "timezone",
20513
- "required": false
20514
- }
20515
- ],
20516
- "security": [
20517
- {
20518
- "bearerAuth": []
20519
- },
20520
- {
20521
- "apiKeyAuth": []
20522
- }
20523
- ],
20524
- "responses": {
20525
- "200": {
20526
- "description": "Successful response",
20527
- "content": {
20528
- "application/json": {
20529
- "schema": {
20530
- "additionalProperties": false,
20531
- "type": "object",
20532
- "required": [
20533
- "asOfDate",
20534
- "perPlatform",
20535
- "totals"
20536
- ],
20537
- "properties": {
20538
- "asOfDate": {
20539
- "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
20540
- "type": "string"
20541
- },
20542
- "perPlatform": {
20543
- "type": "array",
20544
- "items": {
20545
- "additionalProperties": false,
20546
- "type": "object",
20547
- "required": [
20548
- "platform",
20549
- "clicks",
20550
- "conversions",
20551
- "cpa",
20552
- "cpc",
20553
- "cpm",
20554
- "ctr",
20555
- "impressions",
20556
- "leads",
20557
- "purchaseValue",
20558
- "purchases",
20559
- "revenue",
20560
- "roas",
20561
- "spend",
20562
- "share_pct"
20563
- ],
20564
- "properties": {
20565
- "platform": {
20566
- "anyOf": [
20567
- {
20568
- "type": "string",
20569
- "enum": [
20570
- "meta"
20571
- ]
20572
- },
20573
- {
20574
- "type": "string",
20575
- "enum": [
20576
- "google"
20577
- ]
20578
- },
20579
- {
20580
- "type": "string",
20581
- "enum": [
20582
- "tiktok"
20583
- ]
20584
- },
20585
- {
20586
- "type": "string",
20587
- "enum": [
20588
- "taboola"
20589
- ]
20590
- },
20591
- {
20592
- "type": "string",
20593
- "enum": [
20594
- "snapchat"
20595
- ]
20596
20398
  },
20597
20399
  {
20598
20400
  "type": "string",
20599
20401
  "enum": [
20600
- "outbrain"
20601
- ]
20602
- },
20603
- {
20604
- "type": "string",
20605
- "enum": [
20606
- "exoclick"
20402
+ "microsoft"
20607
20403
  ]
20608
20404
  }
20609
20405
  ]
20610
20406
  },
20611
- "clicks": {
20612
- "type": "number"
20613
- },
20614
- "conversions": {
20615
- "type": "number"
20616
- },
20617
- "cpa": {
20618
- "type": "number"
20619
- },
20620
- "cpc": {
20621
- "type": "number"
20622
- },
20623
- "cpm": {
20624
- "type": "number"
20625
- },
20626
- "ctr": {
20627
- "type": "number"
20628
- },
20629
- "impressions": {
20630
- "type": "number"
20631
- },
20632
- "leads": {
20633
- "type": "number"
20634
- },
20635
20407
  "purchaseValue": {
20636
20408
  "type": "number"
20637
20409
  },
@@ -20646,72 +20418,342 @@
20646
20418
  },
20647
20419
  "spend": {
20648
20420
  "type": "number"
20649
- },
20650
- "share_pct": {
20651
- "type": "number"
20652
20421
  }
20653
20422
  }
20654
20423
  }
20655
- },
20656
- "totals": {
20657
- "additionalProperties": false,
20658
- "type": "object",
20659
- "required": [
20660
- "clicks",
20661
- "conversions",
20662
- "cpa",
20663
- "cpc",
20664
- "cpm",
20665
- "ctr",
20666
- "impressions",
20667
- "leads",
20668
- "purchaseValue",
20669
- "purchases",
20670
- "revenue",
20671
- "roas",
20672
- "spend"
20673
- ],
20674
- "properties": {
20675
- "clicks": {
20676
- "type": "number"
20677
- },
20678
- "conversions": {
20679
- "type": "number"
20680
- },
20681
- "cpa": {
20682
- "type": "number"
20683
- },
20684
- "cpc": {
20685
- "type": "number"
20686
- },
20687
- "cpm": {
20688
- "type": "number"
20689
- },
20690
- "ctr": {
20691
- "type": "number"
20692
- },
20693
- "impressions": {
20694
- "type": "number"
20695
- },
20696
- "leads": {
20697
- "type": "number"
20698
- },
20699
- "purchaseValue": {
20700
- "type": "number"
20701
- },
20702
- "purchases": {
20703
- "type": "number"
20704
- },
20705
- "revenue": {
20706
- "type": "number"
20707
- },
20708
- "roas": {
20709
- "type": "number"
20710
- },
20711
- "spend": {
20712
- "type": "number"
20713
- }
20714
- }
20424
+ }
20425
+ }
20426
+ }
20427
+ }
20428
+ }
20429
+ },
20430
+ "401": {
20431
+ "description": "Unauthorized - missing or invalid bearer token",
20432
+ "content": {
20433
+ "application/json": {
20434
+ "schema": {
20435
+ "$ref": "#/components/schemas/ErrorResponse"
20436
+ }
20437
+ }
20438
+ }
20439
+ },
20440
+ "429": {
20441
+ "description": "Too many requests - rate limit exceeded. Reachable on every API-key operation: the per-key cap sold with the plan answers `code: API_KEY_RATE_LIMITED` with `retry_after_seconds` and the `Retry-After` header. The global per-IP limiter can answer here too, with the same status and only `statusCode`, `error` and `message`.",
20442
+ "content": {
20443
+ "application/json": {
20444
+ "schema": {
20445
+ "$ref": "#/components/schemas/RateLimitedResponse"
20446
+ }
20447
+ }
20448
+ }
20449
+ },
20450
+ "500": {
20451
+ "description": "Internal server error",
20452
+ "content": {
20453
+ "application/json": {
20454
+ "schema": {
20455
+ "type": "object",
20456
+ "required": [
20457
+ "statusCode",
20458
+ "error",
20459
+ "message"
20460
+ ],
20461
+ "properties": {
20462
+ "statusCode": {
20463
+ "type": "number"
20464
+ },
20465
+ "error": {
20466
+ "type": "string"
20467
+ },
20468
+ "message": {
20469
+ "type": "string"
20470
+ }
20471
+ }
20472
+ }
20473
+ }
20474
+ }
20475
+ },
20476
+ "503": {
20477
+ "description": "Session revocation check unavailable (Redis): retry after the Retry-After header.",
20478
+ "headers": {
20479
+ "Retry-After": {
20480
+ "description": "Seconds to wait before retrying the identical request.",
20481
+ "schema": {
20482
+ "type": "integer"
20483
+ }
20484
+ }
20485
+ },
20486
+ "content": {
20487
+ "application/json": {
20488
+ "schema": {
20489
+ "$ref": "#/components/schemas/ErrorResponse"
20490
+ }
20491
+ }
20492
+ }
20493
+ }
20494
+ }
20495
+ }
20496
+ },
20497
+ "/api/v1/analytics/unified": {
20498
+ "get": {
20499
+ "operationId": "getCrossChannelUnifiedAnalytics",
20500
+ "summary": "Get cross-channel unified analytics metrics",
20501
+ "tags": [
20502
+ "analytics-cross-channel"
20503
+ ],
20504
+ "description": "Returns aggregated cross-channel KPI totals, per-platform KPI breakdowns, spend share and the latest included insight date.",
20505
+ "parameters": [
20506
+ {
20507
+ "schema": {
20508
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
20509
+ "type": "string"
20510
+ },
20511
+ "in": "query",
20512
+ "name": "since",
20513
+ "required": true
20514
+ },
20515
+ {
20516
+ "schema": {
20517
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
20518
+ "type": "string"
20519
+ },
20520
+ "in": "query",
20521
+ "name": "until",
20522
+ "required": true
20523
+ },
20524
+ {
20525
+ "schema": {
20526
+ "type": "string"
20527
+ },
20528
+ "in": "query",
20529
+ "name": "platforms",
20530
+ "required": false,
20531
+ "description": "Comma-separated platform list."
20532
+ },
20533
+ {
20534
+ "schema": {
20535
+ "pattern": "^[A-Z]{3}$",
20536
+ "type": "string"
20537
+ },
20538
+ "in": "query",
20539
+ "name": "target_currency",
20540
+ "required": true
20541
+ },
20542
+ {
20543
+ "schema": {
20544
+ "pattern": "^[A-Za-z0-9_/+-]+$",
20545
+ "type": "string"
20546
+ },
20547
+ "in": "query",
20548
+ "name": "timezone",
20549
+ "required": false
20550
+ }
20551
+ ],
20552
+ "security": [
20553
+ {
20554
+ "bearerAuth": []
20555
+ },
20556
+ {
20557
+ "apiKeyAuth": []
20558
+ }
20559
+ ],
20560
+ "responses": {
20561
+ "200": {
20562
+ "description": "Successful response",
20563
+ "content": {
20564
+ "application/json": {
20565
+ "schema": {
20566
+ "additionalProperties": false,
20567
+ "type": "object",
20568
+ "required": [
20569
+ "asOfDate",
20570
+ "perPlatform",
20571
+ "totals"
20572
+ ],
20573
+ "properties": {
20574
+ "asOfDate": {
20575
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
20576
+ "type": "string"
20577
+ },
20578
+ "perPlatform": {
20579
+ "type": "array",
20580
+ "items": {
20581
+ "additionalProperties": false,
20582
+ "type": "object",
20583
+ "required": [
20584
+ "platform",
20585
+ "clicks",
20586
+ "conversions",
20587
+ "cpa",
20588
+ "cpc",
20589
+ "cpm",
20590
+ "ctr",
20591
+ "impressions",
20592
+ "leads",
20593
+ "purchaseValue",
20594
+ "purchases",
20595
+ "revenue",
20596
+ "roas",
20597
+ "spend",
20598
+ "share_pct"
20599
+ ],
20600
+ "properties": {
20601
+ "platform": {
20602
+ "anyOf": [
20603
+ {
20604
+ "type": "string",
20605
+ "enum": [
20606
+ "meta"
20607
+ ]
20608
+ },
20609
+ {
20610
+ "type": "string",
20611
+ "enum": [
20612
+ "google"
20613
+ ]
20614
+ },
20615
+ {
20616
+ "type": "string",
20617
+ "enum": [
20618
+ "tiktok"
20619
+ ]
20620
+ },
20621
+ {
20622
+ "type": "string",
20623
+ "enum": [
20624
+ "taboola"
20625
+ ]
20626
+ },
20627
+ {
20628
+ "type": "string",
20629
+ "enum": [
20630
+ "snapchat"
20631
+ ]
20632
+ },
20633
+ {
20634
+ "type": "string",
20635
+ "enum": [
20636
+ "outbrain"
20637
+ ]
20638
+ },
20639
+ {
20640
+ "type": "string",
20641
+ "enum": [
20642
+ "exoclick"
20643
+ ]
20644
+ },
20645
+ {
20646
+ "type": "string",
20647
+ "enum": [
20648
+ "microsoft"
20649
+ ]
20650
+ }
20651
+ ]
20652
+ },
20653
+ "clicks": {
20654
+ "type": "number"
20655
+ },
20656
+ "conversions": {
20657
+ "type": "number"
20658
+ },
20659
+ "cpa": {
20660
+ "type": "number"
20661
+ },
20662
+ "cpc": {
20663
+ "type": "number"
20664
+ },
20665
+ "cpm": {
20666
+ "type": "number"
20667
+ },
20668
+ "ctr": {
20669
+ "type": "number"
20670
+ },
20671
+ "impressions": {
20672
+ "type": "number"
20673
+ },
20674
+ "leads": {
20675
+ "type": "number"
20676
+ },
20677
+ "purchaseValue": {
20678
+ "type": "number"
20679
+ },
20680
+ "purchases": {
20681
+ "type": "number"
20682
+ },
20683
+ "revenue": {
20684
+ "type": "number"
20685
+ },
20686
+ "roas": {
20687
+ "type": "number"
20688
+ },
20689
+ "spend": {
20690
+ "type": "number"
20691
+ },
20692
+ "share_pct": {
20693
+ "type": "number"
20694
+ }
20695
+ }
20696
+ }
20697
+ },
20698
+ "totals": {
20699
+ "additionalProperties": false,
20700
+ "type": "object",
20701
+ "required": [
20702
+ "clicks",
20703
+ "conversions",
20704
+ "cpa",
20705
+ "cpc",
20706
+ "cpm",
20707
+ "ctr",
20708
+ "impressions",
20709
+ "leads",
20710
+ "purchaseValue",
20711
+ "purchases",
20712
+ "revenue",
20713
+ "roas",
20714
+ "spend"
20715
+ ],
20716
+ "properties": {
20717
+ "clicks": {
20718
+ "type": "number"
20719
+ },
20720
+ "conversions": {
20721
+ "type": "number"
20722
+ },
20723
+ "cpa": {
20724
+ "type": "number"
20725
+ },
20726
+ "cpc": {
20727
+ "type": "number"
20728
+ },
20729
+ "cpm": {
20730
+ "type": "number"
20731
+ },
20732
+ "ctr": {
20733
+ "type": "number"
20734
+ },
20735
+ "impressions": {
20736
+ "type": "number"
20737
+ },
20738
+ "leads": {
20739
+ "type": "number"
20740
+ },
20741
+ "purchaseValue": {
20742
+ "type": "number"
20743
+ },
20744
+ "purchases": {
20745
+ "type": "number"
20746
+ },
20747
+ "revenue": {
20748
+ "type": "number"
20749
+ },
20750
+ "roas": {
20751
+ "type": "number"
20752
+ },
20753
+ "spend": {
20754
+ "type": "number"
20755
+ }
20756
+ }
20715
20757
  }
20716
20758
  }
20717
20759
  }
@@ -21966,6 +22008,12 @@
21966
22008
  "enum": [
21967
22009
  "exoclick"
21968
22010
  ]
22011
+ },
22012
+ {
22013
+ "type": "string",
22014
+ "enum": [
22015
+ "microsoft"
22016
+ ]
21969
22017
  }
21970
22018
  ]
21971
22019
  },
@@ -22067,6 +22115,12 @@
22067
22115
  "enum": [
22068
22116
  "exoclick"
22069
22117
  ]
22118
+ },
22119
+ {
22120
+ "type": "string",
22121
+ "enum": [
22122
+ "microsoft"
22123
+ ]
22070
22124
  }
22071
22125
  ]
22072
22126
  },
@@ -22144,6 +22198,12 @@
22144
22198
  "enum": [
22145
22199
  "exoclick"
22146
22200
  ]
22201
+ },
22202
+ {
22203
+ "type": "string",
22204
+ "enum": [
22205
+ "microsoft"
22206
+ ]
22147
22207
  }
22148
22208
  ]
22149
22209
  },
@@ -75023,6 +75083,12 @@
75023
75083
  "enum": [
75024
75084
  "exoclick"
75025
75085
  ]
75086
+ },
75087
+ {
75088
+ "type": "string",
75089
+ "enum": [
75090
+ "microsoft"
75091
+ ]
75026
75092
  }
75027
75093
  ]
75028
75094
  },
@@ -75316,6 +75382,12 @@
75316
75382
  "enum": [
75317
75383
  "exoclick"
75318
75384
  ]
75385
+ },
75386
+ {
75387
+ "type": "string",
75388
+ "enum": [
75389
+ "microsoft"
75390
+ ]
75319
75391
  }
75320
75392
  ]
75321
75393
  },
@@ -116561,7 +116633,7 @@
116561
116633
  "tags": [
116562
116634
  "commerce"
116563
116635
  ],
116564
- "description": "Writes a direct cost amount and currency on a CDM source variant of a connected store, regardless of platform. On Shopify stores it also writes the matching variant-level cost override (the only input the Shopify profit pipeline reads), refreshes the profit snapshots of that variant and re-queues the profit recompute.",
116636
+ "description": "Writes a direct cost amount and currency on a CDM source variant of a connected store, regardless of platform, marked as set by hand so the store product sync does not overwrite it until it is cleared. On Shopify stores it also writes the matching variant-level cost override (the only input the Shopify profit pipeline reads), refreshes the profit snapshots of that variant and re-queues the profit recompute.",
116565
116637
  "requestBody": {
116566
116638
  "required": true,
116567
116639
  "content": {
@@ -116743,7 +116815,7 @@
116743
116815
  "tags": [
116744
116816
  "commerce"
116745
116817
  ],
116746
- "description": "Clears the direct cost amount and currency from a CDM source variant of a connected store, regardless of platform. On Shopify stores it also removes the matching variant-level cost override, refreshes the profit snapshots of that variant and re-queues the profit recompute.",
116818
+ "description": "Clears the direct cost amount and currency from a CDM source variant of a connected store, regardless of platform, with its set-by-hand mark: the next store product sync writes the store cost back. On Shopify stores it also removes the matching variant-level cost override, refreshes the profit snapshots of that variant and re-queues the profit recompute.",
116747
116819
  "parameters": [
116748
116820
  {
116749
116821
  "schema": {
@@ -124101,6 +124173,12 @@
124101
124173
  "enum": [
124102
124174
  "exoclick"
124103
124175
  ]
124176
+ },
124177
+ {
124178
+ "type": "string",
124179
+ "enum": [
124180
+ "microsoft"
124181
+ ]
124104
124182
  }
124105
124183
  ]
124106
124184
  },
@@ -190629,6 +190707,12 @@
190629
190707
  "enum": [
190630
190708
  "exoclick"
190631
190709
  ]
190710
+ },
190711
+ {
190712
+ "type": "string",
190713
+ "enum": [
190714
+ "microsoft"
190715
+ ]
190632
190716
  }
190633
190717
  ]
190634
190718
  },
@@ -191014,6 +191098,12 @@
191014
191098
  "enum": [
191015
191099
  "exoclick"
191016
191100
  ]
191101
+ },
191102
+ {
191103
+ "type": "string",
191104
+ "enum": [
191105
+ "microsoft"
191106
+ ]
191017
191107
  }
191018
191108
  ]
191019
191109
  },
@@ -191439,6 +191529,12 @@
191439
191529
  "enum": [
191440
191530
  "exoclick"
191441
191531
  ]
191532
+ },
191533
+ {
191534
+ "type": "string",
191535
+ "enum": [
191536
+ "microsoft"
191537
+ ]
191442
191538
  }
191443
191539
  ]
191444
191540
  },
@@ -199281,7 +199377,7 @@
199281
199377
  "type": "string"
199282
199378
  },
199283
199379
  "configured": {
199284
- "description": "False when the server has no OAuth app credentials for it.",
199380
+ "description": "False when the server cannot connect it: no OAuth app credentials (OAuth providers) or no key to encrypt a pasted API key (API-key providers).",
199285
199381
  "type": "boolean"
199286
199382
  }
199287
199383
  }
@@ -202050,6 +202146,403 @@
202050
202146
  }
202051
202147
  }
202052
202148
  },
202149
+ "/api/v1/email-marketing/connections": {
202150
+ "post": {
202151
+ "operationId": "connectEmailMarketingWithApiKey",
202152
+ "summary": "Connect an email marketing provider with an API key",
202153
+ "tags": [
202154
+ "email-marketing"
202155
+ ],
202156
+ "description": "For providers connected with a pasted key (Customer.io, Brevo, MailerLite, Mailjet, Omnisend, Mailchimp, ActiveCampaign). The key is checked against the provider account before anything is stored, then saved encrypted and used only for read calls; the first sync (12 months) is queued. Connecting the same account again replaces the key and reactivates the connection, keeping the data already read.",
202157
+ "requestBody": {
202158
+ "required": true,
202159
+ "content": {
202160
+ "application/json": {
202161
+ "schema": {
202162
+ "additionalProperties": false,
202163
+ "type": "object",
202164
+ "required": [
202165
+ "provider",
202166
+ "api_key"
202167
+ ],
202168
+ "properties": {
202169
+ "provider": {
202170
+ "description": "Provider connected with a pasted API key.",
202171
+ "anyOf": [
202172
+ {
202173
+ "type": "string",
202174
+ "enum": [
202175
+ "customerio"
202176
+ ]
202177
+ },
202178
+ {
202179
+ "type": "string",
202180
+ "enum": [
202181
+ "brevo"
202182
+ ]
202183
+ },
202184
+ {
202185
+ "type": "string",
202186
+ "enum": [
202187
+ "mailerlite"
202188
+ ]
202189
+ },
202190
+ {
202191
+ "type": "string",
202192
+ "enum": [
202193
+ "mailjet"
202194
+ ]
202195
+ },
202196
+ {
202197
+ "type": "string",
202198
+ "enum": [
202199
+ "omnisend"
202200
+ ]
202201
+ },
202202
+ {
202203
+ "type": "string",
202204
+ "enum": [
202205
+ "mailchimp"
202206
+ ]
202207
+ },
202208
+ {
202209
+ "type": "string",
202210
+ "enum": [
202211
+ "activecampaign"
202212
+ ]
202213
+ }
202214
+ ]
202215
+ },
202216
+ "api_key": {
202217
+ "minLength": 8,
202218
+ "maxLength": 256,
202219
+ "pattern": "^\\S+$",
202220
+ "description": "The API key created in the provider account (Customer.io: App API key; Brevo: API key v3; MailerLite: API token; Mailjet: API key; Omnisend: API key; Mailchimp: API key; ActiveCampaign: API key). Stored encrypted; only used for read calls.",
202221
+ "type": "string"
202222
+ },
202223
+ "api_secret": {
202224
+ "minLength": 8,
202225
+ "maxLength": 256,
202226
+ "pattern": "^\\S+$",
202227
+ "description": "Mailjet only, required there: the secret key paired with the API key.",
202228
+ "type": "string"
202229
+ },
202230
+ "api_url": {
202231
+ "minLength": 8,
202232
+ "maxLength": 200,
202233
+ "description": "ActiveCampaign only, required there: the API URL of the account (Settings > Developer), in the documented `https://<account>.api-us1.com` form.",
202234
+ "type": "string"
202235
+ },
202236
+ "region": {
202237
+ "description": "Customer.io only: data center of the account (default `us`). If the key answers only in the other region, that one is saved.",
202238
+ "anyOf": [
202239
+ {
202240
+ "type": "string",
202241
+ "enum": [
202242
+ "us"
202243
+ ]
202244
+ },
202245
+ {
202246
+ "type": "string",
202247
+ "enum": [
202248
+ "eu"
202249
+ ]
202250
+ }
202251
+ ]
202252
+ }
202253
+ }
202254
+ }
202255
+ }
202256
+ }
202257
+ },
202258
+ "security": [
202259
+ {
202260
+ "bearerAuth": []
202261
+ }
202262
+ ],
202263
+ "responses": {
202264
+ "201": {
202265
+ "description": "Resource created",
202266
+ "content": {
202267
+ "application/json": {
202268
+ "schema": {
202269
+ "additionalProperties": false,
202270
+ "type": "object",
202271
+ "required": [
202272
+ "connection"
202273
+ ],
202274
+ "properties": {
202275
+ "connection": {
202276
+ "additionalProperties": false,
202277
+ "type": "object",
202278
+ "required": [
202279
+ "id",
202280
+ "provider",
202281
+ "account_name",
202282
+ "currency",
202283
+ "timezone",
202284
+ "token_status",
202285
+ "sync_status",
202286
+ "last_sync_at",
202287
+ "last_sync_error",
202288
+ "has_conversion_metric",
202289
+ "is_dev_fixture",
202290
+ "capabilities",
202291
+ "created_at"
202292
+ ],
202293
+ "properties": {
202294
+ "id": {
202295
+ "format": "uuid",
202296
+ "type": "string"
202297
+ },
202298
+ "provider": {
202299
+ "description": "Provider slug, e.g. `klaviyo`.",
202300
+ "type": "string"
202301
+ },
202302
+ "account_name": {
202303
+ "anyOf": [
202304
+ {
202305
+ "type": "string"
202306
+ },
202307
+ {
202308
+ "type": "null"
202309
+ }
202310
+ ]
202311
+ },
202312
+ "currency": {
202313
+ "anyOf": [
202314
+ {
202315
+ "type": "string"
202316
+ },
202317
+ {
202318
+ "type": "null"
202319
+ }
202320
+ ]
202321
+ },
202322
+ "timezone": {
202323
+ "anyOf": [
202324
+ {
202325
+ "type": "string"
202326
+ },
202327
+ {
202328
+ "type": "null"
202329
+ }
202330
+ ]
202331
+ },
202332
+ "token_status": {
202333
+ "description": "`ACTIVE` or `EXPIRED` (reconnect required).",
202334
+ "type": "string"
202335
+ },
202336
+ "sync_status": {
202337
+ "description": "`pending`, `syncing`, `ready` or `error`.",
202338
+ "type": "string"
202339
+ },
202340
+ "last_sync_at": {
202341
+ "anyOf": [
202342
+ {
202343
+ "format": "date-time",
202344
+ "type": "string"
202345
+ },
202346
+ {
202347
+ "type": "null"
202348
+ }
202349
+ ]
202350
+ },
202351
+ "last_sync_error": {
202352
+ "anyOf": [
202353
+ {
202354
+ "description": "Error code, never provider text.",
202355
+ "type": "string"
202356
+ },
202357
+ {
202358
+ "type": "null"
202359
+ }
202360
+ ]
202361
+ },
202362
+ "has_conversion_metric": {
202363
+ "description": "False when the provider receives no orders: revenue and conversions are not available.",
202364
+ "type": "boolean"
202365
+ },
202366
+ "is_dev_fixture": {
202367
+ "description": "True for local sample data (APP_ENV=local only), never real data.",
202368
+ "type": "boolean"
202369
+ },
202370
+ "capabilities": {
202371
+ "additionalProperties": false,
202372
+ "type": "object",
202373
+ "required": [
202374
+ "sms",
202375
+ "automations",
202376
+ "revenue",
202377
+ "audiences"
202378
+ ],
202379
+ "properties": {
202380
+ "sms": {
202381
+ "type": "boolean"
202382
+ },
202383
+ "automations": {
202384
+ "type": "boolean"
202385
+ },
202386
+ "revenue": {
202387
+ "type": "boolean"
202388
+ },
202389
+ "audiences": {
202390
+ "type": "boolean"
202391
+ }
202392
+ }
202393
+ },
202394
+ "created_at": {
202395
+ "format": "date-time",
202396
+ "type": "string"
202397
+ }
202398
+ }
202399
+ }
202400
+ }
202401
+ }
202402
+ }
202403
+ }
202404
+ },
202405
+ "400": {
202406
+ "description": "Invalid request - schema validation failed",
202407
+ "content": {
202408
+ "application/json": {
202409
+ "schema": {
202410
+ "additionalProperties": false,
202411
+ "type": "object",
202412
+ "required": [
202413
+ "error"
202414
+ ],
202415
+ "properties": {
202416
+ "error": {
202417
+ "type": "string"
202418
+ },
202419
+ "code": {
202420
+ "description": "`INVALID_API_KEY`, `INVALID_API_URL` or `NOT_CONFIGURED`.",
202421
+ "type": "string"
202422
+ }
202423
+ }
202424
+ }
202425
+ }
202426
+ }
202427
+ },
202428
+ "401": {
202429
+ "description": "Unauthorized - missing or invalid bearer token",
202430
+ "content": {
202431
+ "application/json": {
202432
+ "schema": {
202433
+ "additionalProperties": false,
202434
+ "type": "object",
202435
+ "required": [
202436
+ "error"
202437
+ ],
202438
+ "properties": {
202439
+ "error": {
202440
+ "type": "string"
202441
+ },
202442
+ "request_id": {
202443
+ "type": "string",
202444
+ "description": "Fastify request id, propagated for support correlation."
202445
+ }
202446
+ }
202447
+ }
202448
+ }
202449
+ }
202450
+ },
202451
+ "403": {
202452
+ "description": "Forbidden. With `code: ASSET_ROLE_FLOOR`: the caller's role in the workspace is below the floor for connecting this kind of asset here (`act: connect`) or for removing it from here (`act: disconnect`): the code floor, raised by the backoffice lever \"asset_permission_floors\".",
202453
+ "content": {
202454
+ "application/json": {
202455
+ "schema": {
202456
+ "additionalProperties": false,
202457
+ "description": "Forbidden. With `code: ASSET_ROLE_FLOOR`: the caller's role in the workspace is below the floor for connecting this kind of asset here (`act: connect`) or for removing it from here (`act: disconnect`): the code floor, raised by the backoffice lever \"asset_permission_floors\".",
202458
+ "type": "object",
202459
+ "required": [
202460
+ "error"
202461
+ ],
202462
+ "properties": {
202463
+ "statusCode": {
202464
+ "type": "number"
202465
+ },
202466
+ "error": {
202467
+ "type": "string"
202468
+ },
202469
+ "message": {
202470
+ "type": "string"
202471
+ },
202472
+ "code": {
202473
+ "type": "string"
202474
+ },
202475
+ "family": {
202476
+ "description": "With ASSET_ROLE_FLOOR: the asset family of the refused act.",
202477
+ "type": "string"
202478
+ },
202479
+ "act": {
202480
+ "description": "With ASSET_ROLE_FLOOR: connecting here, or removing from here.",
202481
+ "anyOf": [
202482
+ {
202483
+ "type": "string",
202484
+ "enum": [
202485
+ "connect"
202486
+ ]
202487
+ },
202488
+ {
202489
+ "type": "string",
202490
+ "enum": [
202491
+ "disconnect"
202492
+ ]
202493
+ }
202494
+ ]
202495
+ }
202496
+ }
202497
+ }
202498
+ }
202499
+ }
202500
+ },
202501
+ "500": {
202502
+ "description": "Internal server error",
202503
+ "content": {
202504
+ "application/json": {
202505
+ "schema": {
202506
+ "additionalProperties": false,
202507
+ "type": "object",
202508
+ "required": [
202509
+ "error"
202510
+ ],
202511
+ "properties": {
202512
+ "error": {
202513
+ "type": "string"
202514
+ }
202515
+ }
202516
+ }
202517
+ }
202518
+ }
202519
+ },
202520
+ "503": {
202521
+ "description": "Service unavailable",
202522
+ "content": {
202523
+ "application/json": {
202524
+ "schema": {
202525
+ "additionalProperties": false,
202526
+ "type": "object",
202527
+ "required": [
202528
+ "error"
202529
+ ],
202530
+ "properties": {
202531
+ "error": {
202532
+ "type": "string"
202533
+ },
202534
+ "code": {
202535
+ "description": "`INVALID_API_KEY`, `INVALID_API_URL` or `NOT_CONFIGURED`.",
202536
+ "type": "string"
202537
+ }
202538
+ }
202539
+ }
202540
+ }
202541
+ }
202542
+ }
202543
+ }
202544
+ }
202545
+ },
202053
202546
  "/api/v1/fan-pages": {
202054
202547
  "get": {
202055
202548
  "operationId": "getApiV1FanPages",
@@ -212752,6 +213245,12 @@
212752
213245
  "enum": [
212753
213246
  "exoclick"
212754
213247
  ]
213248
+ },
213249
+ {
213250
+ "type": "string",
213251
+ "enum": [
213252
+ "microsoft"
213253
+ ]
212755
213254
  }
212756
213255
  ]
212757
213256
  },
@@ -213897,6 +214396,12 @@
213897
214396
  "enum": [
213898
214397
  "exoclick"
213899
214398
  ]
214399
+ },
214400
+ {
214401
+ "type": "string",
214402
+ "enum": [
214403
+ "microsoft"
214404
+ ]
213900
214405
  }
213901
214406
  ]
213902
214407
  },
@@ -215433,6 +215938,12 @@
215433
215938
  "enum": [
215434
215939
  "exoclick"
215435
215940
  ]
215941
+ },
215942
+ {
215943
+ "type": "string",
215944
+ "enum": [
215945
+ "microsoft"
215946
+ ]
215436
215947
  }
215437
215948
  ]
215438
215949
  },
@@ -233435,17 +233946,1482 @@
233435
233946
  "schema": {
233436
233947
  "type": "object",
233437
233948
  "required": [
233438
- "statusCode",
233439
- "error",
233440
- "message"
233949
+ "statusCode",
233950
+ "error",
233951
+ "message"
233952
+ ],
233953
+ "properties": {
233954
+ "statusCode": {
233955
+ "type": "number"
233956
+ },
233957
+ "error": {
233958
+ "type": "string"
233959
+ },
233960
+ "message": {
233961
+ "type": "string"
233962
+ }
233963
+ }
233964
+ }
233965
+ }
233966
+ }
233967
+ },
233968
+ "503": {
233969
+ "description": "Session revocation check unavailable (Redis): retry after the Retry-After header.",
233970
+ "headers": {
233971
+ "Retry-After": {
233972
+ "description": "Seconds to wait before retrying the identical request.",
233973
+ "schema": {
233974
+ "type": "integer"
233975
+ }
233976
+ }
233977
+ },
233978
+ "content": {
233979
+ "application/json": {
233980
+ "schema": {
233981
+ "$ref": "#/components/schemas/ErrorResponse"
233982
+ }
233983
+ }
233984
+ }
233985
+ }
233986
+ }
233987
+ }
233988
+ },
233989
+ "/api/v1/microsoft/login-url": {
233990
+ "get": {
233991
+ "operationId": "getMicrosoftLoginUrl",
233992
+ "summary": "Get Microsoft Ads OAuth login URL",
233993
+ "tags": [
233994
+ "microsoft"
233995
+ ],
233996
+ "description": "Generates a signed Microsoft Identity Platform authorization URL (scope msads.manage, offline_access) for the authenticated user. The destination workspace team (x-team-id header or active team scope) is signed into the OAuth state; requests without an explicit team get 400 SCOPE_TEAM_REQUIRED. 503 when the connector is not provisioned (the message names the missing environment variables) or switched off for the user.",
233997
+ "parameters": [
233998
+ {
233999
+ "schema": {
234000
+ "type": "boolean"
234001
+ },
234002
+ "in": "query",
234003
+ "name": "confirm_move",
234004
+ "required": false,
234005
+ "description": "Confirm moving Microsoft Ads accounts already assigned to another workspace of the organization into the active workspace. Without confirmation, the OAuth callback reports ACCOUNT_ALREADY_ASSIGNED."
234006
+ },
234007
+ {
234008
+ "schema": {
234009
+ "maxLength": 3500,
234010
+ "pattern": "^[A-Za-z0-9_-]+(,[A-Za-z0-9_-]+)*$",
234011
+ "type": "string"
234012
+ },
234013
+ "in": "query",
234014
+ "name": "move_account_ids",
234015
+ "required": false,
234016
+ "description": "With confirm_move=true: comma-separated external account ids (from GET /api/v1/ad-accounts/movable) to move. Only these move; the other accounts already assigned elsewhere stay in their workspace and do not block the connection. Without it, confirm_move moves every conflicting account. Ids from GET /api/v1/ad-accounts/movable/switched-off (your own accounts left switched off in another workspace, while that feature is on) move too and arrive switched off: switch them on from the Asset Hub, where the plan limit counts. On Meta one moves only when a token of yours in this workspace sees its Business Manager; otherwise it stays where it is."
234017
+ },
234018
+ {
234019
+ "schema": {
234020
+ "format": "uuid",
234021
+ "type": "string"
234022
+ },
234023
+ "in": "header",
234024
+ "name": "x-team-id",
234025
+ "required": false,
234026
+ "description": "Destination workspace team id."
234027
+ }
234028
+ ],
234029
+ "security": [
234030
+ {
234031
+ "bearerAuth": []
234032
+ }
234033
+ ],
234034
+ "responses": {
234035
+ "200": {
234036
+ "description": "Successful response",
234037
+ "content": {
234038
+ "application/json": {
234039
+ "schema": {
234040
+ "additionalProperties": false,
234041
+ "type": "object",
234042
+ "required": [
234043
+ "url"
234044
+ ],
234045
+ "properties": {
234046
+ "url": {
234047
+ "format": "uri",
234048
+ "type": "string"
234049
+ }
234050
+ }
234051
+ }
234052
+ }
234053
+ }
234054
+ },
234055
+ "400": {
234056
+ "description": "Explicit destination workspace required: send the x-team-id header or activate a team scope for this operation.",
234057
+ "content": {
234058
+ "application/json": {
234059
+ "schema": {
234060
+ "description": "Explicit destination workspace required: send the x-team-id header or activate a team scope for this operation.",
234061
+ "additionalProperties": false,
234062
+ "type": "object",
234063
+ "required": [
234064
+ "statusCode",
234065
+ "error",
234066
+ "message"
234067
+ ],
234068
+ "properties": {
234069
+ "statusCode": {
234070
+ "type": "number"
234071
+ },
234072
+ "error": {
234073
+ "type": "string"
234074
+ },
234075
+ "message": {
234076
+ "type": "string"
234077
+ },
234078
+ "code": {
234079
+ "description": "`SCOPE_TEAM_REQUIRED` when no destination workspace was given; a validation 400 keeps its own code (e.g. `FST_ERR_VALIDATION`).",
234080
+ "type": "string"
234081
+ }
234082
+ }
234083
+ }
234084
+ }
234085
+ }
234086
+ },
234087
+ "401": {
234088
+ "description": "Unauthorized - missing or invalid bearer token",
234089
+ "content": {
234090
+ "application/json": {
234091
+ "schema": {
234092
+ "additionalProperties": true,
234093
+ "type": "object",
234094
+ "required": [
234095
+ "error"
234096
+ ],
234097
+ "properties": {
234098
+ "error": {
234099
+ "type": "string"
234100
+ },
234101
+ "code": {
234102
+ "type": "string"
234103
+ },
234104
+ "statusCode": {
234105
+ "type": "integer"
234106
+ },
234107
+ "message": {
234108
+ "type": "string"
234109
+ },
234110
+ "request_id": {
234111
+ "type": "string",
234112
+ "description": "Fastify request id, propagated for support correlation."
234113
+ }
234114
+ }
234115
+ }
234116
+ }
234117
+ }
234118
+ },
234119
+ "403": {
234120
+ "description": "Forbidden. With `code: ASSET_ROLE_FLOOR`: the caller's role in the workspace is below the floor for connecting this kind of asset here (`act: connect`) or for removing it from here (`act: disconnect`): the code floor, raised by the backoffice lever \"asset_permission_floors\".",
234121
+ "content": {
234122
+ "application/json": {
234123
+ "schema": {
234124
+ "additionalProperties": false,
234125
+ "description": "Forbidden. With `code: ASSET_ROLE_FLOOR`: the caller's role in the workspace is below the floor for connecting this kind of asset here (`act: connect`) or for removing it from here (`act: disconnect`): the code floor, raised by the backoffice lever \"asset_permission_floors\".",
234126
+ "type": "object",
234127
+ "required": [
234128
+ "error"
234129
+ ],
234130
+ "properties": {
234131
+ "statusCode": {
234132
+ "type": "number"
234133
+ },
234134
+ "error": {
234135
+ "type": "string"
234136
+ },
234137
+ "message": {
234138
+ "type": "string"
234139
+ },
234140
+ "code": {
234141
+ "type": "string"
234142
+ },
234143
+ "family": {
234144
+ "description": "With ASSET_ROLE_FLOOR: the asset family of the refused act.",
234145
+ "type": "string"
234146
+ },
234147
+ "act": {
234148
+ "description": "With ASSET_ROLE_FLOOR: connecting here, or removing from here.",
234149
+ "anyOf": [
234150
+ {
234151
+ "type": "string",
234152
+ "enum": [
234153
+ "connect"
234154
+ ]
234155
+ },
234156
+ {
234157
+ "type": "string",
234158
+ "enum": [
234159
+ "disconnect"
234160
+ ]
234161
+ }
234162
+ ]
234163
+ }
234164
+ }
234165
+ }
234166
+ }
234167
+ }
234168
+ },
234169
+ "500": {
234170
+ "description": "Internal server error",
234171
+ "content": {
234172
+ "application/json": {
234173
+ "schema": {
234174
+ "additionalProperties": true,
234175
+ "type": "object",
234176
+ "required": [
234177
+ "error"
234178
+ ],
234179
+ "properties": {
234180
+ "error": {
234181
+ "type": "string"
234182
+ },
234183
+ "code": {
234184
+ "type": "string"
234185
+ },
234186
+ "statusCode": {
234187
+ "type": "integer"
234188
+ },
234189
+ "message": {
234190
+ "type": "string"
234191
+ }
234192
+ }
234193
+ }
234194
+ }
234195
+ }
234196
+ },
234197
+ "503": {
234198
+ "description": "Service unavailable",
234199
+ "content": {
234200
+ "application/json": {
234201
+ "schema": {
234202
+ "additionalProperties": true,
234203
+ "type": "object",
234204
+ "required": [
234205
+ "error"
234206
+ ],
234207
+ "properties": {
234208
+ "error": {
234209
+ "type": "string"
234210
+ },
234211
+ "code": {
234212
+ "type": "string"
234213
+ },
234214
+ "statusCode": {
234215
+ "type": "integer"
234216
+ },
234217
+ "message": {
234218
+ "type": "string"
234219
+ }
234220
+ }
234221
+ }
234222
+ }
234223
+ }
234224
+ }
234225
+ }
234226
+ }
234227
+ },
234228
+ "/microsoft/callback": {
234229
+ "get": {
234230
+ "operationId": "handleMicrosoftLoginCallback",
234231
+ "summary": "Handle Microsoft Ads OAuth callback",
234232
+ "tags": [
234233
+ "microsoft"
234234
+ ],
234235
+ "description": "Consumes the Microsoft OAuth callback (registered redirect URI /microsoft/callback), stores the encrypted tokens, discovers the accessible ad accounts, dispatches the account sync and returns the popup-closing HTML response. If discovered accounts belong to another workspace of the organization, the callback reports ACCOUNT_ALREADY_ASSIGNED unless the signed OAuth state carried confirm_move=true. AADSTS650052 (tenant without the Microsoft Advertising service) produces an explicit message.",
234236
+ "parameters": [
234237
+ {
234238
+ "schema": {
234239
+ "type": "string"
234240
+ },
234241
+ "in": "query",
234242
+ "name": "code",
234243
+ "required": false
234244
+ },
234245
+ {
234246
+ "schema": {
234247
+ "type": "string"
234248
+ },
234249
+ "in": "query",
234250
+ "name": "state",
234251
+ "required": false
234252
+ },
234253
+ {
234254
+ "schema": {
234255
+ "type": "string"
234256
+ },
234257
+ "in": "query",
234258
+ "name": "error",
234259
+ "required": false
234260
+ },
234261
+ {
234262
+ "schema": {
234263
+ "type": "string"
234264
+ },
234265
+ "in": "query",
234266
+ "name": "error_description",
234267
+ "required": false
234268
+ }
234269
+ ],
234270
+ "responses": {
234271
+ "200": {
234272
+ "description": "Small HTML page that closes the OAuth popup after success or provider callback failure.",
234273
+ "content": {
234274
+ "application/json": {
234275
+ "schema": {
234276
+ "description": "Small HTML page that closes the OAuth popup after success or provider callback failure.",
234277
+ "type": "string"
234278
+ }
234279
+ }
234280
+ }
234281
+ },
234282
+ "500": {
234283
+ "description": "Internal server error",
234284
+ "content": {
234285
+ "application/json": {
234286
+ "schema": {
234287
+ "additionalProperties": true,
234288
+ "type": "object",
234289
+ "required": [
234290
+ "error"
234291
+ ],
234292
+ "properties": {
234293
+ "error": {
234294
+ "type": "string"
234295
+ },
234296
+ "code": {
234297
+ "type": "string"
234298
+ },
234299
+ "statusCode": {
234300
+ "type": "integer"
234301
+ },
234302
+ "message": {
234303
+ "type": "string"
234304
+ }
234305
+ }
234306
+ }
234307
+ }
234308
+ }
234309
+ },
234310
+ "503": {
234311
+ "description": "Service unavailable",
234312
+ "content": {
234313
+ "application/json": {
234314
+ "schema": {
234315
+ "additionalProperties": true,
234316
+ "type": "object",
234317
+ "required": [
234318
+ "error"
234319
+ ],
234320
+ "properties": {
234321
+ "error": {
234322
+ "type": "string"
234323
+ },
234324
+ "code": {
234325
+ "type": "string"
234326
+ },
234327
+ "statusCode": {
234328
+ "type": "integer"
234329
+ },
234330
+ "message": {
234331
+ "type": "string"
234332
+ }
234333
+ }
234334
+ }
234335
+ }
234336
+ }
234337
+ }
234338
+ }
234339
+ }
234340
+ },
234341
+ "/api/v1/microsoft/status": {
234342
+ "get": {
234343
+ "operationId": "getMicrosoftStatus",
234344
+ "summary": "Get Microsoft Ads connection status",
234345
+ "tags": [
234346
+ "microsoft"
234347
+ ],
234348
+ "description": "Returns the caller's Microsoft Ads connection state. needs_reconnect is true after invalid_grant or AADSTS650052: the connection is lost and only a new consent restores it.",
234349
+ "security": [
234350
+ {
234351
+ "bearerAuth": []
234352
+ },
234353
+ {
234354
+ "apiKeyAuth": []
234355
+ }
234356
+ ],
234357
+ "responses": {
234358
+ "200": {
234359
+ "description": "Successful response",
234360
+ "content": {
234361
+ "application/json": {
234362
+ "schema": {
234363
+ "additionalProperties": false,
234364
+ "type": "object",
234365
+ "required": [
234366
+ "connected",
234367
+ "token_status",
234368
+ "needs_reconnect",
234369
+ "last_error_code",
234370
+ "accounts_total",
234371
+ "accounts_connected"
234372
+ ],
234373
+ "properties": {
234374
+ "connected": {
234375
+ "description": "True when the person has a live Microsoft Ads connection.",
234376
+ "type": "boolean"
234377
+ },
234378
+ "token_status": {
234379
+ "description": "ACTIVE, EXPIRED (to reconnect) or null when never connected.",
234380
+ "anyOf": [
234381
+ {
234382
+ "type": "string"
234383
+ },
234384
+ {
234385
+ "type": "null"
234386
+ }
234387
+ ]
234388
+ },
234389
+ "needs_reconnect": {
234390
+ "description": "True after invalid_grant or AADSTS650052: only a new consent restores the connection.",
234391
+ "type": "boolean"
234392
+ },
234393
+ "last_error_code": {
234394
+ "description": "invalid_grant, AADSTS650052 or missing_refresh_token when the connection was lost.",
234395
+ "anyOf": [
234396
+ {
234397
+ "type": "string"
234398
+ },
234399
+ {
234400
+ "type": "null"
234401
+ }
234402
+ ]
234403
+ },
234404
+ "accounts_total": {
234405
+ "minimum": 0,
234406
+ "type": "integer"
234407
+ },
234408
+ "accounts_connected": {
234409
+ "minimum": 0,
234410
+ "type": "integer"
234411
+ }
234412
+ }
234413
+ }
234414
+ }
234415
+ }
234416
+ },
234417
+ "401": {
234418
+ "description": "Unauthorized - missing or invalid bearer token",
234419
+ "content": {
234420
+ "application/json": {
234421
+ "schema": {
234422
+ "additionalProperties": true,
234423
+ "type": "object",
234424
+ "required": [
234425
+ "error"
234426
+ ],
234427
+ "properties": {
234428
+ "error": {
234429
+ "type": "string"
234430
+ },
234431
+ "code": {
234432
+ "type": "string"
234433
+ },
234434
+ "statusCode": {
234435
+ "type": "integer"
234436
+ },
234437
+ "message": {
234438
+ "type": "string"
234439
+ },
234440
+ "request_id": {
234441
+ "type": "string",
234442
+ "description": "Fastify request id, propagated for support correlation."
234443
+ }
234444
+ }
234445
+ }
234446
+ }
234447
+ }
234448
+ },
234449
+ "403": {
234450
+ "description": "Forbidden - caller lacks the required role/permission",
234451
+ "content": {
234452
+ "application/json": {
234453
+ "schema": {
234454
+ "additionalProperties": true,
234455
+ "type": "object",
234456
+ "required": [
234457
+ "error"
234458
+ ],
234459
+ "properties": {
234460
+ "error": {
234461
+ "type": "string"
234462
+ },
234463
+ "code": {
234464
+ "type": "string"
234465
+ },
234466
+ "statusCode": {
234467
+ "type": "integer"
234468
+ },
234469
+ "message": {
234470
+ "type": "string"
234471
+ }
234472
+ }
234473
+ }
234474
+ }
234475
+ }
234476
+ },
234477
+ "429": {
234478
+ "description": "Too many requests - rate limit exceeded. Reachable on every API-key operation: the per-key cap sold with the plan answers `code: API_KEY_RATE_LIMITED` with `retry_after_seconds` and the `Retry-After` header. The global per-IP limiter can answer here too, with the same status and only `statusCode`, `error` and `message`.",
234479
+ "content": {
234480
+ "application/json": {
234481
+ "schema": {
234482
+ "$ref": "#/components/schemas/RateLimitedResponse"
234483
+ }
234484
+ }
234485
+ }
234486
+ },
234487
+ "500": {
234488
+ "description": "Internal server error",
234489
+ "content": {
234490
+ "application/json": {
234491
+ "schema": {
234492
+ "additionalProperties": true,
234493
+ "type": "object",
234494
+ "required": [
234495
+ "error"
234496
+ ],
234497
+ "properties": {
234498
+ "error": {
234499
+ "type": "string"
234500
+ },
234501
+ "code": {
234502
+ "type": "string"
234503
+ },
234504
+ "statusCode": {
234505
+ "type": "integer"
234506
+ },
234507
+ "message": {
234508
+ "type": "string"
234509
+ }
234510
+ }
234511
+ }
234512
+ }
234513
+ }
234514
+ },
234515
+ "503": {
234516
+ "description": "Service unavailable",
234517
+ "content": {
234518
+ "application/json": {
234519
+ "schema": {
234520
+ "additionalProperties": true,
234521
+ "type": "object",
234522
+ "required": [
234523
+ "error"
234524
+ ],
234525
+ "properties": {
234526
+ "error": {
234527
+ "type": "string"
234528
+ },
234529
+ "code": {
234530
+ "type": "string"
234531
+ },
234532
+ "statusCode": {
234533
+ "type": "integer"
234534
+ },
234535
+ "message": {
234536
+ "type": "string"
234537
+ }
234538
+ }
234539
+ }
234540
+ }
234541
+ }
234542
+ }
234543
+ }
234544
+ }
234545
+ },
234546
+ "/api/v1/microsoft/ad-accounts": {
234547
+ "get": {
234548
+ "operationId": "listMicrosoftAdAccounts",
234549
+ "summary": "List Microsoft Ads ad accounts",
234550
+ "tags": [
234551
+ "microsoft"
234552
+ ],
234553
+ "description": "Returns Microsoft Advertising ad accounts synced for the authenticated user (live rows only).",
234554
+ "security": [
234555
+ {
234556
+ "bearerAuth": []
234557
+ },
234558
+ {
234559
+ "apiKeyAuth": []
234560
+ }
234561
+ ],
234562
+ "responses": {
234563
+ "200": {
234564
+ "description": "Successful response",
234565
+ "content": {
234566
+ "application/json": {
234567
+ "schema": {
234568
+ "additionalProperties": false,
234569
+ "type": "object",
234570
+ "required": [
234571
+ "ad_accounts",
234572
+ "total"
234573
+ ],
234574
+ "properties": {
234575
+ "ad_accounts": {
234576
+ "type": "array",
234577
+ "items": {
234578
+ "additionalProperties": false,
234579
+ "type": "object",
234580
+ "required": [
234581
+ "id",
234582
+ "session_id",
234583
+ "team_id",
234584
+ "customer_id",
234585
+ "account_id",
234586
+ "account_number",
234587
+ "account_name",
234588
+ "account_status",
234589
+ "currency",
234590
+ "timezone",
234591
+ "connected",
234592
+ "is_active",
234593
+ "created_at",
234594
+ "updated_at"
234595
+ ],
234596
+ "properties": {
234597
+ "id": {
234598
+ "format": "uuid",
234599
+ "type": "string"
234600
+ },
234601
+ "session_id": {
234602
+ "format": "uuid",
234603
+ "type": "string"
234604
+ },
234605
+ "team_id": {
234606
+ "format": "uuid",
234607
+ "type": "string"
234608
+ },
234609
+ "customer_id": {
234610
+ "description": "Microsoft Advertising customer id (a `long`, as a string).",
234611
+ "type": "string"
234612
+ },
234613
+ "account_id": {
234614
+ "description": "Microsoft Advertising account id (a `long`, as a string).",
234615
+ "type": "string"
234616
+ },
234617
+ "account_number": {
234618
+ "anyOf": [
234619
+ {
234620
+ "type": "string"
234621
+ },
234622
+ {
234623
+ "type": "null"
234624
+ }
234625
+ ]
234626
+ },
234627
+ "account_name": {
234628
+ "anyOf": [
234629
+ {
234630
+ "type": "string"
234631
+ },
234632
+ {
234633
+ "type": "null"
234634
+ }
234635
+ ]
234636
+ },
234637
+ "account_status": {
234638
+ "anyOf": [
234639
+ {
234640
+ "type": "string"
234641
+ },
234642
+ {
234643
+ "type": "null"
234644
+ }
234645
+ ]
234646
+ },
234647
+ "currency": {
234648
+ "anyOf": [
234649
+ {
234650
+ "type": "string"
234651
+ },
234652
+ {
234653
+ "type": "null"
234654
+ }
234655
+ ]
234656
+ },
234657
+ "timezone": {
234658
+ "description": "Microsoft time zone enum name of the account (for example PacificTimeUSCanadaTijuana).",
234659
+ "anyOf": [
234660
+ {
234661
+ "type": "string"
234662
+ },
234663
+ {
234664
+ "type": "null"
234665
+ }
234666
+ ]
234667
+ },
234668
+ "connected": {
234669
+ "type": "boolean"
234670
+ },
234671
+ "is_active": {
234672
+ "anyOf": [
234673
+ {
234674
+ "type": "boolean"
234675
+ },
234676
+ {
234677
+ "type": "null"
234678
+ }
234679
+ ]
234680
+ },
234681
+ "created_at": {
234682
+ "format": "date-time",
234683
+ "type": "string"
234684
+ },
234685
+ "updated_at": {
234686
+ "anyOf": [
234687
+ {
234688
+ "format": "date-time",
234689
+ "type": "string"
234690
+ },
234691
+ {
234692
+ "type": "null"
234693
+ }
234694
+ ]
234695
+ }
234696
+ }
234697
+ }
234698
+ },
234699
+ "total": {
234700
+ "minimum": 0,
234701
+ "type": "integer"
234702
+ }
234703
+ }
234704
+ }
234705
+ }
234706
+ }
234707
+ },
234708
+ "401": {
234709
+ "description": "Unauthorized - missing or invalid bearer token",
234710
+ "content": {
234711
+ "application/json": {
234712
+ "schema": {
234713
+ "additionalProperties": true,
234714
+ "type": "object",
234715
+ "required": [
234716
+ "error"
234717
+ ],
234718
+ "properties": {
234719
+ "error": {
234720
+ "type": "string"
234721
+ },
234722
+ "code": {
234723
+ "type": "string"
234724
+ },
234725
+ "statusCode": {
234726
+ "type": "integer"
234727
+ },
234728
+ "message": {
234729
+ "type": "string"
234730
+ },
234731
+ "request_id": {
234732
+ "type": "string",
234733
+ "description": "Fastify request id, propagated for support correlation."
234734
+ }
234735
+ }
234736
+ }
234737
+ }
234738
+ }
234739
+ },
234740
+ "403": {
234741
+ "description": "Forbidden - caller lacks the required role/permission",
234742
+ "content": {
234743
+ "application/json": {
234744
+ "schema": {
234745
+ "additionalProperties": true,
234746
+ "type": "object",
234747
+ "required": [
234748
+ "error"
234749
+ ],
234750
+ "properties": {
234751
+ "error": {
234752
+ "type": "string"
234753
+ },
234754
+ "code": {
234755
+ "type": "string"
234756
+ },
234757
+ "statusCode": {
234758
+ "type": "integer"
234759
+ },
234760
+ "message": {
234761
+ "type": "string"
234762
+ }
234763
+ }
234764
+ }
234765
+ }
234766
+ }
234767
+ },
234768
+ "429": {
234769
+ "description": "Too many requests - rate limit exceeded. Reachable on every API-key operation: the per-key cap sold with the plan answers `code: API_KEY_RATE_LIMITED` with `retry_after_seconds` and the `Retry-After` header. The global per-IP limiter can answer here too, with the same status and only `statusCode`, `error` and `message`.",
234770
+ "content": {
234771
+ "application/json": {
234772
+ "schema": {
234773
+ "$ref": "#/components/schemas/RateLimitedResponse"
234774
+ }
234775
+ }
234776
+ }
234777
+ },
234778
+ "500": {
234779
+ "description": "Internal server error",
234780
+ "content": {
234781
+ "application/json": {
234782
+ "schema": {
234783
+ "additionalProperties": true,
234784
+ "type": "object",
234785
+ "required": [
234786
+ "error"
234787
+ ],
234788
+ "properties": {
234789
+ "error": {
234790
+ "type": "string"
234791
+ },
234792
+ "code": {
234793
+ "type": "string"
234794
+ },
234795
+ "statusCode": {
234796
+ "type": "integer"
234797
+ },
234798
+ "message": {
234799
+ "type": "string"
234800
+ }
234801
+ }
234802
+ }
234803
+ }
234804
+ }
234805
+ },
234806
+ "503": {
234807
+ "description": "Service unavailable",
234808
+ "content": {
234809
+ "application/json": {
234810
+ "schema": {
234811
+ "additionalProperties": true,
234812
+ "type": "object",
234813
+ "required": [
234814
+ "error"
234815
+ ],
234816
+ "properties": {
234817
+ "error": {
234818
+ "type": "string"
234819
+ },
234820
+ "code": {
234821
+ "type": "string"
234822
+ },
234823
+ "statusCode": {
234824
+ "type": "integer"
234825
+ },
234826
+ "message": {
234827
+ "type": "string"
234828
+ }
234829
+ }
234830
+ }
234831
+ }
234832
+ }
234833
+ }
234834
+ }
234835
+ }
234836
+ },
234837
+ "/api/v1/microsoft/sync/ad-accounts": {
234838
+ "post": {
234839
+ "operationId": "syncMicrosoftAdAccounts",
234840
+ "summary": "Sync Microsoft Ads ad accounts",
234841
+ "tags": [
234842
+ "microsoft"
234843
+ ],
234844
+ "description": "Queues the Microsoft Ads ad-account sync worker and returns the worker run id used by the sync progress banner.",
234845
+ "security": [
234846
+ {
234847
+ "bearerAuth": []
234848
+ },
234849
+ {
234850
+ "apiKeyAuth": []
234851
+ }
234852
+ ],
234853
+ "responses": {
234854
+ "200": {
234855
+ "description": "Successful response",
234856
+ "content": {
234857
+ "application/json": {
234858
+ "schema": {
234859
+ "additionalProperties": false,
234860
+ "type": "object",
234861
+ "required": [
234862
+ "success",
234863
+ "queued",
234864
+ "worker_run_id"
234865
+ ],
234866
+ "properties": {
234867
+ "success": {
234868
+ "type": "boolean"
234869
+ },
234870
+ "queued": {
234871
+ "type": "boolean"
234872
+ },
234873
+ "worker_run_id": {
234874
+ "format": "uuid",
234875
+ "type": "string"
234876
+ }
234877
+ }
234878
+ }
234879
+ }
234880
+ }
234881
+ },
234882
+ "401": {
234883
+ "description": "Unauthorized - missing or invalid bearer token",
234884
+ "content": {
234885
+ "application/json": {
234886
+ "schema": {
234887
+ "additionalProperties": true,
234888
+ "type": "object",
234889
+ "required": [
234890
+ "error"
234891
+ ],
234892
+ "properties": {
234893
+ "error": {
234894
+ "type": "string"
234895
+ },
234896
+ "code": {
234897
+ "type": "string"
234898
+ },
234899
+ "statusCode": {
234900
+ "type": "integer"
234901
+ },
234902
+ "message": {
234903
+ "type": "string"
234904
+ },
234905
+ "request_id": {
234906
+ "type": "string",
234907
+ "description": "Fastify request id, propagated for support correlation."
234908
+ }
234909
+ }
234910
+ }
234911
+ }
234912
+ }
234913
+ },
234914
+ "403": {
234915
+ "description": "Forbidden - caller lacks the required role/permission",
234916
+ "content": {
234917
+ "application/json": {
234918
+ "schema": {
234919
+ "additionalProperties": true,
234920
+ "type": "object",
234921
+ "required": [
234922
+ "error"
234923
+ ],
234924
+ "properties": {
234925
+ "error": {
234926
+ "type": "string"
234927
+ },
234928
+ "code": {
234929
+ "type": "string"
234930
+ },
234931
+ "statusCode": {
234932
+ "type": "integer"
234933
+ },
234934
+ "message": {
234935
+ "type": "string"
234936
+ }
234937
+ }
234938
+ }
234939
+ }
234940
+ }
234941
+ },
234942
+ "429": {
234943
+ "description": "Too many requests - rate limit exceeded. Reachable on every API-key operation: the per-key cap sold with the plan answers `code: API_KEY_RATE_LIMITED` with `retry_after_seconds` and the `Retry-After` header. The global per-IP limiter can answer here too, with the same status and only `statusCode`, `error` and `message`.",
234944
+ "content": {
234945
+ "application/json": {
234946
+ "schema": {
234947
+ "$ref": "#/components/schemas/RateLimitedResponse"
234948
+ }
234949
+ }
234950
+ }
234951
+ },
234952
+ "500": {
234953
+ "description": "Internal server error",
234954
+ "content": {
234955
+ "application/json": {
234956
+ "schema": {
234957
+ "additionalProperties": true,
234958
+ "type": "object",
234959
+ "required": [
234960
+ "error"
234961
+ ],
234962
+ "properties": {
234963
+ "error": {
234964
+ "type": "string"
234965
+ },
234966
+ "code": {
234967
+ "type": "string"
234968
+ },
234969
+ "statusCode": {
234970
+ "type": "integer"
234971
+ },
234972
+ "message": {
234973
+ "type": "string"
234974
+ }
234975
+ }
234976
+ }
234977
+ }
234978
+ }
234979
+ },
234980
+ "503": {
234981
+ "description": "Service unavailable",
234982
+ "content": {
234983
+ "application/json": {
234984
+ "schema": {
234985
+ "additionalProperties": true,
234986
+ "type": "object",
234987
+ "required": [
234988
+ "error"
234989
+ ],
234990
+ "properties": {
234991
+ "error": {
234992
+ "type": "string"
234993
+ },
234994
+ "code": {
234995
+ "type": "string"
234996
+ },
234997
+ "statusCode": {
234998
+ "type": "integer"
234999
+ },
235000
+ "message": {
235001
+ "type": "string"
235002
+ }
235003
+ }
235004
+ }
235005
+ }
235006
+ }
235007
+ }
235008
+ }
235009
+ }
235010
+ },
235011
+ "/api/v1/microsoft/sync/insights": {
235012
+ "post": {
235013
+ "operationId": "syncMicrosoftInsights",
235014
+ "summary": "Sync Microsoft Ads insights",
235015
+ "tags": [
235016
+ "microsoft"
235017
+ ],
235018
+ "description": "Dispatches a Microsoft Ads insights backfill for the authenticated user over the default 30-day window. Daily reports are available for up to 36 months.",
235019
+ "security": [
235020
+ {
235021
+ "bearerAuth": []
235022
+ },
235023
+ {
235024
+ "apiKeyAuth": []
235025
+ }
235026
+ ],
235027
+ "responses": {
235028
+ "200": {
235029
+ "description": "Successful response",
235030
+ "content": {
235031
+ "application/json": {
235032
+ "schema": {
235033
+ "additionalProperties": false,
235034
+ "type": "object",
235035
+ "required": [
235036
+ "success",
235037
+ "queued",
235038
+ "status"
235039
+ ],
235040
+ "properties": {
235041
+ "success": {
235042
+ "type": "boolean"
235043
+ },
235044
+ "queued": {
235045
+ "type": "boolean"
235046
+ },
235047
+ "status": {
235048
+ "anyOf": [
235049
+ {
235050
+ "type": "string",
235051
+ "enum": [
235052
+ "processing"
235053
+ ]
235054
+ },
235055
+ {
235056
+ "type": "string",
235057
+ "enum": [
235058
+ "skipped"
235059
+ ]
235060
+ }
235061
+ ]
235062
+ },
235063
+ "worker_run_id": {
235064
+ "format": "uuid",
235065
+ "type": "string"
235066
+ },
235067
+ "days": {
235068
+ "type": "number"
235069
+ },
235070
+ "chunks": {
235071
+ "type": "number"
235072
+ },
235073
+ "from_date": {
235074
+ "format": "date",
235075
+ "type": "string"
235076
+ },
235077
+ "to_date": {
235078
+ "format": "date",
235079
+ "type": "string"
235080
+ },
235081
+ "message": {
235082
+ "type": "string"
235083
+ }
235084
+ }
235085
+ }
235086
+ }
235087
+ }
235088
+ },
235089
+ "401": {
235090
+ "description": "Unauthorized - missing or invalid bearer token",
235091
+ "content": {
235092
+ "application/json": {
235093
+ "schema": {
235094
+ "additionalProperties": true,
235095
+ "type": "object",
235096
+ "required": [
235097
+ "error"
235098
+ ],
235099
+ "properties": {
235100
+ "error": {
235101
+ "type": "string"
235102
+ },
235103
+ "code": {
235104
+ "type": "string"
235105
+ },
235106
+ "statusCode": {
235107
+ "type": "integer"
235108
+ },
235109
+ "message": {
235110
+ "type": "string"
235111
+ },
235112
+ "request_id": {
235113
+ "type": "string",
235114
+ "description": "Fastify request id, propagated for support correlation."
235115
+ }
235116
+ }
235117
+ }
235118
+ }
235119
+ }
235120
+ },
235121
+ "403": {
235122
+ "description": "Forbidden - caller lacks the required role/permission",
235123
+ "content": {
235124
+ "application/json": {
235125
+ "schema": {
235126
+ "additionalProperties": true,
235127
+ "type": "object",
235128
+ "required": [
235129
+ "error"
235130
+ ],
235131
+ "properties": {
235132
+ "error": {
235133
+ "type": "string"
235134
+ },
235135
+ "code": {
235136
+ "type": "string"
235137
+ },
235138
+ "statusCode": {
235139
+ "type": "integer"
235140
+ },
235141
+ "message": {
235142
+ "type": "string"
235143
+ }
235144
+ }
235145
+ }
235146
+ }
235147
+ }
235148
+ },
235149
+ "429": {
235150
+ "description": "Too many requests - rate limit exceeded. Reachable on every API-key operation: the per-key cap sold with the plan answers `code: API_KEY_RATE_LIMITED` with `retry_after_seconds` and the `Retry-After` header. The global per-IP limiter can answer here too, with the same status and only `statusCode`, `error` and `message`.",
235151
+ "content": {
235152
+ "application/json": {
235153
+ "schema": {
235154
+ "$ref": "#/components/schemas/RateLimitedResponse"
235155
+ }
235156
+ }
235157
+ }
235158
+ },
235159
+ "500": {
235160
+ "description": "Internal server error",
235161
+ "content": {
235162
+ "application/json": {
235163
+ "schema": {
235164
+ "additionalProperties": true,
235165
+ "type": "object",
235166
+ "required": [
235167
+ "error"
235168
+ ],
235169
+ "properties": {
235170
+ "error": {
235171
+ "type": "string"
235172
+ },
235173
+ "code": {
235174
+ "type": "string"
235175
+ },
235176
+ "statusCode": {
235177
+ "type": "integer"
235178
+ },
235179
+ "message": {
235180
+ "type": "string"
235181
+ }
235182
+ }
235183
+ }
235184
+ }
235185
+ }
235186
+ },
235187
+ "503": {
235188
+ "description": "Service unavailable",
235189
+ "content": {
235190
+ "application/json": {
235191
+ "schema": {
235192
+ "additionalProperties": true,
235193
+ "type": "object",
235194
+ "required": [
235195
+ "error"
235196
+ ],
235197
+ "properties": {
235198
+ "error": {
235199
+ "type": "string"
235200
+ },
235201
+ "code": {
235202
+ "type": "string"
235203
+ },
235204
+ "statusCode": {
235205
+ "type": "integer"
235206
+ },
235207
+ "message": {
235208
+ "type": "string"
235209
+ }
235210
+ }
235211
+ }
235212
+ }
235213
+ }
235214
+ }
235215
+ }
235216
+ }
235217
+ },
235218
+ "/api/v1/microsoft/toggle-account": {
235219
+ "post": {
235220
+ "operationId": "toggleMicrosoftAccount",
235221
+ "summary": "Toggle Microsoft Ads ad-account connection",
235222
+ "tags": [
235223
+ "microsoft"
235224
+ ],
235225
+ "description": "Updates the connected flag for the caller's live Microsoft Ads ad account row and its platform connection row. 404 when the caller has no live row of that account.",
235226
+ "requestBody": {
235227
+ "required": true,
235228
+ "content": {
235229
+ "application/json": {
235230
+ "schema": {
235231
+ "additionalProperties": false,
235232
+ "type": "object",
235233
+ "required": [
235234
+ "account_id",
235235
+ "connected"
235236
+ ],
235237
+ "properties": {
235238
+ "account_id": {
235239
+ "minLength": 1,
235240
+ "maxLength": 100,
235241
+ "type": "string"
235242
+ },
235243
+ "connected": {
235244
+ "type": "boolean"
235245
+ }
235246
+ }
235247
+ }
235248
+ }
235249
+ }
235250
+ },
235251
+ "security": [
235252
+ {
235253
+ "bearerAuth": []
235254
+ },
235255
+ {
235256
+ "apiKeyAuth": []
235257
+ }
235258
+ ],
235259
+ "responses": {
235260
+ "200": {
235261
+ "description": "Successful response",
235262
+ "content": {
235263
+ "application/json": {
235264
+ "schema": {
235265
+ "additionalProperties": false,
235266
+ "type": "object",
235267
+ "required": [
235268
+ "success"
235269
+ ],
235270
+ "properties": {
235271
+ "success": {
235272
+ "type": "boolean"
235273
+ }
235274
+ }
235275
+ }
235276
+ }
235277
+ }
235278
+ },
235279
+ "401": {
235280
+ "description": "Unauthorized - missing or invalid bearer token",
235281
+ "content": {
235282
+ "application/json": {
235283
+ "schema": {
235284
+ "additionalProperties": true,
235285
+ "type": "object",
235286
+ "required": [
235287
+ "error"
235288
+ ],
235289
+ "properties": {
235290
+ "error": {
235291
+ "type": "string"
235292
+ },
235293
+ "code": {
235294
+ "type": "string"
235295
+ },
235296
+ "statusCode": {
235297
+ "type": "integer"
235298
+ },
235299
+ "message": {
235300
+ "type": "string"
235301
+ },
235302
+ "request_id": {
235303
+ "type": "string",
235304
+ "description": "Fastify request id, propagated for support correlation."
235305
+ }
235306
+ }
235307
+ }
235308
+ }
235309
+ }
235310
+ },
235311
+ "403": {
235312
+ "description": "Forbidden - caller lacks the required role/permission",
235313
+ "content": {
235314
+ "application/json": {
235315
+ "schema": {
235316
+ "additionalProperties": true,
235317
+ "type": "object",
235318
+ "required": [
235319
+ "error"
235320
+ ],
235321
+ "properties": {
235322
+ "error": {
235323
+ "type": "string"
235324
+ },
235325
+ "code": {
235326
+ "type": "string"
235327
+ },
235328
+ "statusCode": {
235329
+ "type": "integer"
235330
+ },
235331
+ "message": {
235332
+ "type": "string"
235333
+ }
235334
+ }
235335
+ }
235336
+ }
235337
+ }
235338
+ },
235339
+ "404": {
235340
+ "description": "Resource not found",
235341
+ "content": {
235342
+ "application/json": {
235343
+ "schema": {
235344
+ "additionalProperties": true,
235345
+ "type": "object",
235346
+ "required": [
235347
+ "error"
235348
+ ],
235349
+ "properties": {
235350
+ "error": {
235351
+ "type": "string"
235352
+ },
235353
+ "code": {
235354
+ "type": "string"
235355
+ },
235356
+ "statusCode": {
235357
+ "type": "integer"
235358
+ },
235359
+ "message": {
235360
+ "type": "string"
235361
+ }
235362
+ }
235363
+ }
235364
+ }
235365
+ }
235366
+ },
235367
+ "429": {
235368
+ "description": "Too many requests - rate limit exceeded. Reachable on every API-key operation: the per-key cap sold with the plan answers `code: API_KEY_RATE_LIMITED` with `retry_after_seconds` and the `Retry-After` header. The global per-IP limiter can answer here too, with the same status and only `statusCode`, `error` and `message`.",
235369
+ "content": {
235370
+ "application/json": {
235371
+ "schema": {
235372
+ "$ref": "#/components/schemas/RateLimitedResponse"
235373
+ }
235374
+ }
235375
+ }
235376
+ },
235377
+ "500": {
235378
+ "description": "Internal server error",
235379
+ "content": {
235380
+ "application/json": {
235381
+ "schema": {
235382
+ "additionalProperties": true,
235383
+ "type": "object",
235384
+ "required": [
235385
+ "error"
233441
235386
  ],
233442
235387
  "properties": {
235388
+ "error": {
235389
+ "type": "string"
235390
+ },
235391
+ "code": {
235392
+ "type": "string"
235393
+ },
233443
235394
  "statusCode": {
233444
- "type": "number"
235395
+ "type": "integer"
233445
235396
  },
235397
+ "message": {
235398
+ "type": "string"
235399
+ }
235400
+ }
235401
+ }
235402
+ }
235403
+ }
235404
+ },
235405
+ "503": {
235406
+ "description": "Service unavailable",
235407
+ "content": {
235408
+ "application/json": {
235409
+ "schema": {
235410
+ "additionalProperties": true,
235411
+ "type": "object",
235412
+ "required": [
235413
+ "error"
235414
+ ],
235415
+ "properties": {
233446
235416
  "error": {
233447
235417
  "type": "string"
233448
235418
  },
235419
+ "code": {
235420
+ "type": "string"
235421
+ },
235422
+ "statusCode": {
235423
+ "type": "integer"
235424
+ },
233449
235425
  "message": {
233450
235426
  "type": "string"
233451
235427
  }
@@ -233453,21 +235429,155 @@
233453
235429
  }
233454
235430
  }
233455
235431
  }
235432
+ }
235433
+ }
235434
+ }
235435
+ },
235436
+ "/api/v1/microsoft/disconnect": {
235437
+ "post": {
235438
+ "operationId": "disconnectMicrosoft",
235439
+ "summary": "Disconnect Microsoft Ads",
235440
+ "tags": [
235441
+ "microsoft"
235442
+ ],
235443
+ "description": "Soft-deletes Microsoft Ads tokens and ad accounts for the authenticated user.",
235444
+ "security": [
235445
+ {
235446
+ "bearerAuth": []
235447
+ }
235448
+ ],
235449
+ "responses": {
235450
+ "200": {
235451
+ "description": "Successful response",
235452
+ "content": {
235453
+ "application/json": {
235454
+ "schema": {
235455
+ "additionalProperties": false,
235456
+ "type": "object",
235457
+ "required": [
235458
+ "success"
235459
+ ],
235460
+ "properties": {
235461
+ "success": {
235462
+ "type": "boolean"
235463
+ }
235464
+ }
235465
+ }
235466
+ }
235467
+ }
233456
235468
  },
233457
- "503": {
233458
- "description": "Session revocation check unavailable (Redis): retry after the Retry-After header.",
233459
- "headers": {
233460
- "Retry-After": {
233461
- "description": "Seconds to wait before retrying the identical request.",
235469
+ "401": {
235470
+ "description": "Unauthorized - missing or invalid bearer token",
235471
+ "content": {
235472
+ "application/json": {
233462
235473
  "schema": {
233463
- "type": "integer"
235474
+ "additionalProperties": true,
235475
+ "type": "object",
235476
+ "required": [
235477
+ "error"
235478
+ ],
235479
+ "properties": {
235480
+ "error": {
235481
+ "type": "string"
235482
+ },
235483
+ "code": {
235484
+ "type": "string"
235485
+ },
235486
+ "statusCode": {
235487
+ "type": "integer"
235488
+ },
235489
+ "message": {
235490
+ "type": "string"
235491
+ },
235492
+ "request_id": {
235493
+ "type": "string",
235494
+ "description": "Fastify request id, propagated for support correlation."
235495
+ }
235496
+ }
233464
235497
  }
233465
235498
  }
233466
- },
235499
+ }
235500
+ },
235501
+ "403": {
235502
+ "description": "Forbidden - caller lacks the required role/permission",
233467
235503
  "content": {
233468
235504
  "application/json": {
233469
235505
  "schema": {
233470
- "$ref": "#/components/schemas/ErrorResponse"
235506
+ "additionalProperties": true,
235507
+ "type": "object",
235508
+ "required": [
235509
+ "error"
235510
+ ],
235511
+ "properties": {
235512
+ "error": {
235513
+ "type": "string"
235514
+ },
235515
+ "code": {
235516
+ "type": "string"
235517
+ },
235518
+ "statusCode": {
235519
+ "type": "integer"
235520
+ },
235521
+ "message": {
235522
+ "type": "string"
235523
+ }
235524
+ }
235525
+ }
235526
+ }
235527
+ }
235528
+ },
235529
+ "500": {
235530
+ "description": "Internal server error",
235531
+ "content": {
235532
+ "application/json": {
235533
+ "schema": {
235534
+ "additionalProperties": true,
235535
+ "type": "object",
235536
+ "required": [
235537
+ "error"
235538
+ ],
235539
+ "properties": {
235540
+ "error": {
235541
+ "type": "string"
235542
+ },
235543
+ "code": {
235544
+ "type": "string"
235545
+ },
235546
+ "statusCode": {
235547
+ "type": "integer"
235548
+ },
235549
+ "message": {
235550
+ "type": "string"
235551
+ }
235552
+ }
235553
+ }
235554
+ }
235555
+ }
235556
+ },
235557
+ "503": {
235558
+ "description": "Service unavailable",
235559
+ "content": {
235560
+ "application/json": {
235561
+ "schema": {
235562
+ "additionalProperties": true,
235563
+ "type": "object",
235564
+ "required": [
235565
+ "error"
235566
+ ],
235567
+ "properties": {
235568
+ "error": {
235569
+ "type": "string"
235570
+ },
235571
+ "code": {
235572
+ "type": "string"
235573
+ },
235574
+ "statusCode": {
235575
+ "type": "integer"
235576
+ },
235577
+ "message": {
235578
+ "type": "string"
235579
+ }
235580
+ }
233471
235581
  }
233472
235582
  }
233473
235583
  }
@@ -254737,7 +256847,7 @@
254737
256847
  "tags": [
254738
256848
  "platforms"
254739
256849
  ],
254740
- "description": "Returns one token/user row per connected Google, TikTok, Snapchat or Outbrain platform session. Used by the Users page instead of sampling ad-account pages. Results are scoped to the active workspace: tokens stamped with a team of the active scope plus legacy rows owned by accessible sessions. `member_name`, `member_email` and `team_name` are filled for platform staff and for callers who are owner in every workspace of the request (the role in the workspace, not the highest role elsewhere).",
256850
+ "description": "Returns one token/user row per connected Google, TikTok, Snapchat, Outbrain or Microsoft platform session. Used by the Users page instead of sampling ad-account pages. Results are scoped to the active workspace: tokens stamped with a team of the active scope plus legacy rows owned by accessible sessions. `member_name`, `member_email` and `team_name` are filled for platform staff and for callers who are owner in every workspace of the request (the role in the workspace, not the highest role elsewhere).",
254741
256851
  "parameters": [
254742
256852
  {
254743
256853
  "schema": {
@@ -254792,6 +256902,12 @@
254792
256902
  "enum": [
254793
256903
  "outbrain"
254794
256904
  ]
256905
+ },
256906
+ {
256907
+ "type": "string",
256908
+ "enum": [
256909
+ "microsoft"
256910
+ ]
254795
256911
  }
254796
256912
  ]
254797
256913
  },
@@ -255063,6 +257179,12 @@
255063
257179
  "enum": [
255064
257180
  "outbrain"
255065
257181
  ]
257182
+ },
257183
+ {
257184
+ "type": "string",
257185
+ "enum": [
257186
+ "microsoft"
257187
+ ]
255066
257188
  }
255067
257189
  ]
255068
257190
  },
@@ -268428,6 +270550,12 @@
268428
270550
  "enum": [
268429
270551
  "exoclick"
268430
270552
  ]
270553
+ },
270554
+ {
270555
+ "type": "string",
270556
+ "enum": [
270557
+ "microsoft"
270558
+ ]
268431
270559
  }
268432
270560
  ]
268433
270561
  },
@@ -362648,7 +364776,7 @@
362648
364776
  "shopify",
362649
364777
  "commerce"
362650
364778
  ],
362651
- "description": "Writes a direct cost amount and currency on a CDM source variant, then refreshes affected profit snapshots.",
364779
+ "description": "Writes a direct cost amount and currency on a CDM source variant, marked as set by hand so the store product sync does not overwrite it until it is cleared, then refreshes affected profit snapshots.",
362652
364780
  "requestBody": {
362653
364781
  "required": true,
362654
364782
  "content": {
@@ -362799,7 +364927,7 @@
362799
364927
  "shopify",
362800
364928
  "commerce"
362801
364929
  ],
362802
- "description": "Clears the direct cost amount and currency from a CDM source variant, then refreshes affected profit snapshots.",
364930
+ "description": "Clears the direct cost amount and currency from a CDM source variant and its set-by-hand mark, so the next store product sync writes the store cost back, then refreshes affected profit snapshots.",
362803
364931
  "parameters": [
362804
364932
  {
362805
364933
  "schema": {
@@ -443530,6 +445658,12 @@
443530
445658
  "enum": [
443531
445659
  "exoclick"
443532
445660
  ]
445661
+ },
445662
+ {
445663
+ "type": "string",
445664
+ "enum": [
445665
+ "microsoft"
445666
+ ]
443533
445667
  }
443534
445668
  ]
443535
445669
  },
@@ -475627,6 +477761,12 @@
475627
477761
  "enum": [
475628
477762
  "exoclick"
475629
477763
  ]
477764
+ },
477765
+ {
477766
+ "type": "string",
477767
+ "enum": [
477768
+ "microsoft"
477769
+ ]
475630
477770
  }
475631
477771
  ]
475632
477772
  },
@@ -476101,6 +478241,12 @@
476101
478241
  "enum": [
476102
478242
  "exoclick"
476103
478243
  ]
478244
+ },
478245
+ {
478246
+ "type": "string",
478247
+ "enum": [
478248
+ "microsoft"
478249
+ ]
476104
478250
  }
476105
478251
  ]
476106
478252
  },
@@ -476405,6 +478551,12 @@
476405
478551
  "enum": [
476406
478552
  "exoclick"
476407
478553
  ]
478554
+ },
478555
+ {
478556
+ "type": "string",
478557
+ "enum": [
478558
+ "microsoft"
478559
+ ]
476408
478560
  }
476409
478561
  ]
476410
478562
  },
@@ -476536,6 +478688,12 @@
476536
478688
  "enum": [
476537
478689
  "exoclick"
476538
478690
  ]
478691
+ },
478692
+ {
478693
+ "type": "string",
478694
+ "enum": [
478695
+ "microsoft"
478696
+ ]
476539
478697
  }
476540
478698
  ]
476541
478699
  },
@@ -477094,6 +479252,12 @@
477094
479252
  "enum": [
477095
479253
  "exoclick"
477096
479254
  ]
479255
+ },
479256
+ {
479257
+ "type": "string",
479258
+ "enum": [
479259
+ "microsoft"
479260
+ ]
477097
479261
  }
477098
479262
  ]
477099
479263
  },
@@ -477308,6 +479472,12 @@
477308
479472
  "enum": [
477309
479473
  "exoclick"
477310
479474
  ]
479475
+ },
479476
+ {
479477
+ "type": "string",
479478
+ "enum": [
479479
+ "microsoft"
479480
+ ]
477311
479481
  }
477312
479482
  ]
477313
479483
  },
@@ -477479,6 +479649,12 @@
477479
479649
  "enum": [
477480
479650
  "exoclick"
477481
479651
  ]
479652
+ },
479653
+ {
479654
+ "type": "string",
479655
+ "enum": [
479656
+ "microsoft"
479657
+ ]
477482
479658
  }
477483
479659
  ]
477484
479660
  },
@@ -478452,6 +480628,12 @@
478452
480628
  "enum": [
478453
480629
  "exoclick"
478454
480630
  ]
480631
+ },
480632
+ {
480633
+ "type": "string",
480634
+ "enum": [
480635
+ "microsoft"
480636
+ ]
478455
480637
  }
478456
480638
  ]
478457
480639
  },
@@ -478623,6 +480805,12 @@
478623
480805
  "enum": [
478624
480806
  "exoclick"
478625
480807
  ]
480808
+ },
480809
+ {
480810
+ "type": "string",
480811
+ "enum": [
480812
+ "microsoft"
480813
+ ]
478626
480814
  }
478627
480815
  ]
478628
480816
  },
@@ -479537,6 +481725,12 @@
479537
481725
  "enum": [
479538
481726
  "exoclick"
479539
481727
  ]
481728
+ },
481729
+ {
481730
+ "type": "string",
481731
+ "enum": [
481732
+ "microsoft"
481733
+ ]
479540
481734
  }
479541
481735
  ]
479542
481736
  },
@@ -479708,6 +481902,12 @@
479708
481902
  "enum": [
479709
481903
  "exoclick"
479710
481904
  ]
481905
+ },
481906
+ {
481907
+ "type": "string",
481908
+ "enum": [
481909
+ "microsoft"
481910
+ ]
479711
481911
  }
479712
481912
  ]
479713
481913
  },
@@ -480759,6 +482959,12 @@
480759
482959
  "enum": [
480760
482960
  "exoclick"
480761
482961
  ]
482962
+ },
482963
+ {
482964
+ "type": "string",
482965
+ "enum": [
482966
+ "microsoft"
482967
+ ]
480762
482968
  }
480763
482969
  ]
480764
482970
  },
@@ -480930,6 +483136,12 @@
480930
483136
  "enum": [
480931
483137
  "exoclick"
480932
483138
  ]
483139
+ },
483140
+ {
483141
+ "type": "string",
483142
+ "enum": [
483143
+ "microsoft"
483144
+ ]
480933
483145
  }
480934
483146
  ]
480935
483147
  },
@@ -481925,6 +484137,12 @@
481925
484137
  "enum": [
481926
484138
  "exoclick"
481927
484139
  ]
484140
+ },
484141
+ {
484142
+ "type": "string",
484143
+ "enum": [
484144
+ "microsoft"
484145
+ ]
481928
484146
  }
481929
484147
  ]
481930
484148
  },
@@ -482096,6 +484314,12 @@
482096
484314
  "enum": [
482097
484315
  "exoclick"
482098
484316
  ]
484317
+ },
484318
+ {
484319
+ "type": "string",
484320
+ "enum": [
484321
+ "microsoft"
484322
+ ]
482099
484323
  }
482100
484324
  ]
482101
484325
  },
@@ -482946,6 +485170,12 @@
482946
485170
  "enum": [
482947
485171
  "exoclick"
482948
485172
  ]
485173
+ },
485174
+ {
485175
+ "type": "string",
485176
+ "enum": [
485177
+ "microsoft"
485178
+ ]
482949
485179
  }
482950
485180
  ]
482951
485181
  },