@epilot/cli 0.1.11 → 0.1.15

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 (42) hide show
  1. package/README.md +20 -19
  2. package/definitions/automation.json +214 -1
  3. package/definitions/blueprint-manifest.json +1504 -148
  4. package/definitions/configuration-hub.json +399 -0
  5. package/definitions/data-governance.json +1126 -0
  6. package/definitions/deduplication.json +135 -4
  7. package/definitions/design.json +103 -57
  8. package/definitions/email-settings.json +29 -0
  9. package/definitions/entity.json +88 -6
  10. package/definitions/environments.json +183 -7
  11. package/definitions/erp-integration.json +1819 -187
  12. package/definitions/integration-toolkit.json +7998 -0
  13. package/definitions/message.json +202 -0
  14. package/definitions/query.json +3178 -0
  15. package/definitions/sharing.json +956 -0
  16. package/definitions/target.json +609 -0
  17. package/definitions/template-variables.json +12 -4
  18. package/definitions/user.json +52 -0
  19. package/definitions/workflow-definition.json +87 -202
  20. package/definitions/workflow.json +102 -0
  21. package/dist/{add-component-IW4644NE.js → add-component-AAVQVPKK.js} +68 -13
  22. package/dist/app-I3XXHZLD.js +24 -0
  23. package/dist/bin/epilot.js +12 -9
  24. package/dist/{chunk-POCU2J27.js → chunk-CEP7S7X3.js} +2 -1
  25. package/dist/{chunk-K2UQOP3Q.js → chunk-UOQMCAJN.js} +149 -60
  26. package/dist/{completion-HTO64G2S.js → completion-J7SWF5AO.js} +1 -1
  27. package/dist/configuration-hub-Y7W22GBW.js +54 -0
  28. package/dist/{data-management-KXAPA7ZU.js → data-governance-DJAAIE6F.js} +5 -5
  29. package/dist/{deploy-UQZAUHAB.js → deploy-4XDFWOEV.js} +1 -1
  30. package/dist/{export-US5GMHTS.js → export-JA5N4JCJ.js} +1 -1
  31. package/dist/{init-DGPWBRRB.js → init-5KGNJEWF.js} +1 -1
  32. package/dist/integration-toolkit-4CLQDSK7.js +54 -0
  33. package/dist/{erp-integration-DXFYJ2F3.js → query-IYW42QLU.js} +5 -5
  34. package/dist/{remove-component-B2GMICMD.js → remove-component-LXSRR23E.js} +1 -1
  35. package/dist/{review-QFPON37R.js → review-HFOO3NXE.js} +1 -1
  36. package/dist/sharing-X5U53KSU.js +54 -0
  37. package/dist/{upgrade-KZSOPDCR.js → upgrade-6Z53BXHL.js} +1 -1
  38. package/dist/{validate-G7K6AVBI.js → validate-TUMXW56Y.js} +1 -1
  39. package/dist/{versions-UTPAWTIU.js → versions-ZTWQAGXY.js} +1 -1
  40. package/package.json +4 -2
  41. package/definitions/data-management.json +0 -972
  42. package/dist/app-BKS7M4UQ.js +0 -24
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "ERP Integration API",
5
- "version": "0.49.0",
5
+ "version": "0.58.0",
6
6
  "description": "API for integrating with ERP systems, handling tracking acknowledgments, triggering ERP processes, and processing ERP updates."
7
7
  },
8
8
  "tags": [
@@ -21,6 +21,14 @@
21
21
  {
22
22
  "name": "monitoring",
23
23
  "description": "Monitoring and analytics endpoints"
24
+ },
25
+ {
26
+ "name": "managed-call",
27
+ "description": "Managed call endpoints for synchronous external API calls"
28
+ },
29
+ {
30
+ "name": "proxy",
31
+ "description": "Secure proxy endpoints"
24
32
  }
25
33
  ],
26
34
  "servers": [
@@ -2249,6 +2257,202 @@
2249
2257
  }
2250
2258
  }
2251
2259
  },
2260
+ "/v2/integrations/{integrationId}/monitoring/events": {
2261
+ "post": {
2262
+ "operationId": "queryMonitoringEventsV2",
2263
+ "summary": "queryMonitoringEventsV2",
2264
+ "description": "Query monitoring events from the unified erp_monitoring_v2 table.\nReturns all event types (inbound, outbound, file_proxy, etc.) in a single list.\nReplaces the separate v1 inbound-events and outbound-events endpoints.\n",
2265
+ "tags": [
2266
+ "monitoring",
2267
+ "integrations"
2268
+ ],
2269
+ "parameters": [
2270
+ {
2271
+ "name": "integrationId",
2272
+ "in": "path",
2273
+ "required": true,
2274
+ "description": "The integration ID",
2275
+ "schema": {
2276
+ "type": "string",
2277
+ "format": "uuid"
2278
+ }
2279
+ }
2280
+ ],
2281
+ "requestBody": {
2282
+ "required": true,
2283
+ "content": {
2284
+ "application/json": {
2285
+ "schema": {
2286
+ "$ref": "#/components/schemas/QueryMonitoringEventsV2Request"
2287
+ }
2288
+ }
2289
+ }
2290
+ },
2291
+ "responses": {
2292
+ "200": {
2293
+ "$ref": "#/components/responses/QueryMonitoringEventsV2Response"
2294
+ },
2295
+ "400": {
2296
+ "$ref": "#/components/responses/BadRequest"
2297
+ },
2298
+ "401": {
2299
+ "$ref": "#/components/responses/Unauthorized"
2300
+ },
2301
+ "404": {
2302
+ "$ref": "#/components/responses/NotFound"
2303
+ },
2304
+ "500": {
2305
+ "$ref": "#/components/responses/InternalServerError"
2306
+ }
2307
+ }
2308
+ }
2309
+ },
2310
+ "/v2/integrations/{integrationId}/monitoring/stats": {
2311
+ "post": {
2312
+ "operationId": "getMonitoringStatsV2",
2313
+ "summary": "getMonitoringStatsV2",
2314
+ "description": "Get aggregated statistics from the unified erp_monitoring_v2 table.\nReturns combined metrics for all event types with optional breakdowns.\n",
2315
+ "tags": [
2316
+ "monitoring",
2317
+ "integrations"
2318
+ ],
2319
+ "parameters": [
2320
+ {
2321
+ "name": "integrationId",
2322
+ "in": "path",
2323
+ "required": true,
2324
+ "description": "The integration ID",
2325
+ "schema": {
2326
+ "type": "string",
2327
+ "format": "uuid"
2328
+ }
2329
+ }
2330
+ ],
2331
+ "requestBody": {
2332
+ "required": true,
2333
+ "content": {
2334
+ "application/json": {
2335
+ "schema": {
2336
+ "$ref": "#/components/schemas/GetMonitoringStatsV2Request"
2337
+ }
2338
+ }
2339
+ }
2340
+ },
2341
+ "responses": {
2342
+ "200": {
2343
+ "$ref": "#/components/responses/GetMonitoringStatsV2Response"
2344
+ },
2345
+ "400": {
2346
+ "$ref": "#/components/responses/BadRequest"
2347
+ },
2348
+ "401": {
2349
+ "$ref": "#/components/responses/Unauthorized"
2350
+ },
2351
+ "404": {
2352
+ "$ref": "#/components/responses/NotFound"
2353
+ },
2354
+ "500": {
2355
+ "$ref": "#/components/responses/InternalServerError"
2356
+ }
2357
+ }
2358
+ }
2359
+ },
2360
+ "/v2/integrations/{integrationId}/monitoring/time-series": {
2361
+ "post": {
2362
+ "operationId": "getMonitoringTimeSeriesV2",
2363
+ "summary": "getMonitoringTimeSeriesV2",
2364
+ "description": "Get time-series aggregated event counts from the unified erp_monitoring_v2 table.\nReturns bucketed counts for chart rendering.\n",
2365
+ "tags": [
2366
+ "monitoring",
2367
+ "integrations"
2368
+ ],
2369
+ "parameters": [
2370
+ {
2371
+ "name": "integrationId",
2372
+ "in": "path",
2373
+ "required": true,
2374
+ "description": "The integration ID",
2375
+ "schema": {
2376
+ "type": "string",
2377
+ "format": "uuid"
2378
+ }
2379
+ }
2380
+ ],
2381
+ "requestBody": {
2382
+ "required": true,
2383
+ "content": {
2384
+ "application/json": {
2385
+ "schema": {
2386
+ "$ref": "#/components/schemas/GetMonitoringTimeSeriesV2Request"
2387
+ }
2388
+ }
2389
+ }
2390
+ },
2391
+ "responses": {
2392
+ "200": {
2393
+ "$ref": "#/components/responses/GetMonitoringTimeSeriesV2Response"
2394
+ },
2395
+ "400": {
2396
+ "$ref": "#/components/responses/BadRequest"
2397
+ },
2398
+ "401": {
2399
+ "$ref": "#/components/responses/Unauthorized"
2400
+ },
2401
+ "404": {
2402
+ "$ref": "#/components/responses/NotFound"
2403
+ },
2404
+ "500": {
2405
+ "$ref": "#/components/responses/InternalServerError"
2406
+ }
2407
+ }
2408
+ }
2409
+ },
2410
+ "/v2/integrations/{integrationId}/monitoring/events/{eventId}/associated": {
2411
+ "get": {
2412
+ "operationId": "getAssociatedMonitoringEvents",
2413
+ "summary": "getAssociatedMonitoringEvents",
2414
+ "description": "Returns all monitoring events sharing the same event_id, ordered chronologically.\nAlso includes the original inbound event payload from erp_incoming_events if available.\nUsed to display a full event trace/timeline.\n",
2415
+ "tags": [
2416
+ "monitoring",
2417
+ "integrations"
2418
+ ],
2419
+ "parameters": [
2420
+ {
2421
+ "name": "integrationId",
2422
+ "in": "path",
2423
+ "required": true,
2424
+ "description": "The integration ID",
2425
+ "schema": {
2426
+ "type": "string",
2427
+ "format": "uuid"
2428
+ }
2429
+ },
2430
+ {
2431
+ "name": "eventId",
2432
+ "in": "path",
2433
+ "required": true,
2434
+ "description": "The event ID to get associated events for",
2435
+ "schema": {
2436
+ "type": "string"
2437
+ }
2438
+ }
2439
+ ],
2440
+ "responses": {
2441
+ "200": {
2442
+ "$ref": "#/components/responses/GetAssociatedMonitoringEventsResponse"
2443
+ },
2444
+ "400": {
2445
+ "$ref": "#/components/responses/BadRequest"
2446
+ },
2447
+ "401": {
2448
+ "$ref": "#/components/responses/Unauthorized"
2449
+ },
2450
+ "500": {
2451
+ "$ref": "#/components/responses/InternalServerError"
2452
+ }
2453
+ }
2454
+ }
2455
+ },
2252
2456
  "/v1/integrations/secure-proxies": {
2253
2457
  "get": {
2254
2458
  "operationId": "listSecureProxies",
@@ -2375,55 +2579,314 @@
2375
2579
  }
2376
2580
  }
2377
2581
  }
2378
- }
2379
- },
2380
- "components": {
2381
- "securitySchemes": {
2382
- "EpilotAuth": {
2383
- "type": "http",
2384
- "scheme": "bearer",
2385
- "description": "Authorization header with epilot OAuth2 bearer token",
2386
- "bearerFormat": "JWT"
2387
- }
2388
2582
  },
2389
- "schemas": {
2390
- "ErrorResponseBase": {
2391
- "type": "object",
2392
- "properties": {
2393
- "code": {
2394
- "type": "string",
2395
- "description": "Computer-readable error code"
2396
- },
2397
- "message": {
2398
- "type": "string",
2399
- "description": "Error message"
2583
+ "/v1/managed-call/{slug}/execute": {
2584
+ "post": {
2585
+ "operationId": "managedCallExecute",
2586
+ "summary": "Execute a managed call operation",
2587
+ "description": "Execute a managed call operation synchronously. The slug in the path acts as the RPC method name.\nCalls an external partner API with JSONata mapping on both request and response.\n",
2588
+ "tags": [
2589
+ "managed-call"
2590
+ ],
2591
+ "security": [
2592
+ {
2593
+ "EpilotAuth": []
2400
2594
  }
2401
- }
2402
- },
2403
- "ErpEvent": {
2404
- "type": "object",
2405
- "required": [
2406
- "event_type",
2407
- "object_type",
2408
- "timestamp",
2409
- "format",
2410
- "payload"
2411
2595
  ],
2412
- "properties": {
2413
- "event_type": {
2414
- "type": "string",
2415
- "enum": [
2416
- "CREATE",
2417
- "UPDATE",
2418
- "DELETE"
2419
- ],
2420
- "description": "Type of event (create, update, delete)"
2421
- },
2422
- "object_type": {
2423
- "type": "string",
2424
- "description": "Type of the object being updated (business_partner, contract_account, etc.). Corresponds to \"Event Name\" from the integration UI."
2596
+ "parameters": [
2597
+ {
2598
+ "name": "slug",
2599
+ "in": "path",
2600
+ "required": true,
2601
+ "schema": {
2602
+ "type": "string",
2603
+ "pattern": "^[a-z0-9][a-z0-9_-]*$"
2604
+ },
2605
+ "description": "Use case slug (acts as the RPC method name)"
2606
+ }
2607
+ ],
2608
+ "requestBody": {
2609
+ "required": true,
2610
+ "content": {
2611
+ "application/json": {
2612
+ "schema": {
2613
+ "$ref": "#/components/schemas/ManagedCallExecuteRequest"
2614
+ }
2615
+ }
2616
+ }
2617
+ },
2618
+ "responses": {
2619
+ "200": {
2620
+ "description": "Managed call executed successfully.\nThe response body is the JSONata-mapped result (or raw external API response if no mapping).\nIf inbound routing is configured, check X-Inbound-Event-Id header for tracking.\n",
2621
+ "headers": {
2622
+ "X-Inbound-Event-Id": {
2623
+ "description": "Event ID for tracking inbound pipeline processing (only present when inbound routing is configured)",
2624
+ "schema": {
2625
+ "type": "string"
2626
+ }
2627
+ }
2628
+ },
2629
+ "content": {
2630
+ "application/json": {
2631
+ "schema": {
2632
+ "$ref": "#/components/schemas/ManagedCallExecuteResponse"
2633
+ }
2634
+ }
2635
+ }
2425
2636
  },
2426
- "timestamp": {
2637
+ "400": {
2638
+ "description": "Bad request (e.g., invalid URL blocked by SSRF protection)",
2639
+ "content": {
2640
+ "application/json": {
2641
+ "schema": {
2642
+ "$ref": "#/components/schemas/ManagedCallErrorResponse"
2643
+ }
2644
+ }
2645
+ }
2646
+ },
2647
+ "401": {
2648
+ "$ref": "#/components/responses/Unauthorized"
2649
+ },
2650
+ "403": {
2651
+ "$ref": "#/components/responses/Forbidden"
2652
+ },
2653
+ "404": {
2654
+ "$ref": "#/components/responses/NotFound"
2655
+ },
2656
+ "500": {
2657
+ "$ref": "#/components/responses/InternalServerError"
2658
+ },
2659
+ "502": {
2660
+ "description": "External API error (upstream service returned an error)",
2661
+ "content": {
2662
+ "application/json": {
2663
+ "schema": {
2664
+ "$ref": "#/components/schemas/ManagedCallErrorResponse"
2665
+ }
2666
+ }
2667
+ }
2668
+ }
2669
+ }
2670
+ }
2671
+ },
2672
+ "/v1/integrations/{integrationId}/generate-types-preview": {
2673
+ "post": {
2674
+ "operationId": "generateTypesPreview",
2675
+ "summary": "Preview scaffolded types for a connector integration",
2676
+ "description": "Analyses the JSONata mappings of all managed-call use cases in the integration and returns scaffolded type descriptors. The frontend uses these to show the type editor modal where developers fill in leaf types.\n",
2677
+ "tags": [
2678
+ "integrations"
2679
+ ],
2680
+ "security": [
2681
+ {
2682
+ "EpilotAuth": []
2683
+ }
2684
+ ],
2685
+ "parameters": [
2686
+ {
2687
+ "name": "integrationId",
2688
+ "in": "path",
2689
+ "required": true,
2690
+ "schema": {
2691
+ "type": "string",
2692
+ "format": "uuid"
2693
+ }
2694
+ }
2695
+ ],
2696
+ "responses": {
2697
+ "200": {
2698
+ "description": "Scaffolded type preview",
2699
+ "content": {
2700
+ "application/json": {
2701
+ "schema": {
2702
+ "$ref": "#/components/schemas/GenerateTypesPreviewResponse"
2703
+ }
2704
+ }
2705
+ }
2706
+ },
2707
+ "400": {
2708
+ "$ref": "#/components/responses/BadRequest"
2709
+ },
2710
+ "403": {
2711
+ "$ref": "#/components/responses/Forbidden"
2712
+ },
2713
+ "404": {
2714
+ "$ref": "#/components/responses/NotFound"
2715
+ },
2716
+ "500": {
2717
+ "$ref": "#/components/responses/InternalServerError"
2718
+ }
2719
+ }
2720
+ }
2721
+ },
2722
+ "/v1/integrations/{integrationId}/generate-types": {
2723
+ "post": {
2724
+ "operationId": "generateTypes",
2725
+ "summary": "Generate a TypeScript npm package for a connector integration",
2726
+ "description": "Generates a complete TypeScript npm package with typed interfaces for all managed-call use cases. This is a stateless operation that does not persist any changes. Use the commit-types endpoint to lock configurations after review.\n",
2727
+ "tags": [
2728
+ "integrations"
2729
+ ],
2730
+ "security": [
2731
+ {
2732
+ "EpilotAuth": []
2733
+ }
2734
+ ],
2735
+ "parameters": [
2736
+ {
2737
+ "name": "integrationId",
2738
+ "in": "path",
2739
+ "required": true,
2740
+ "schema": {
2741
+ "type": "string",
2742
+ "format": "uuid"
2743
+ }
2744
+ }
2745
+ ],
2746
+ "requestBody": {
2747
+ "required": true,
2748
+ "content": {
2749
+ "application/json": {
2750
+ "schema": {
2751
+ "$ref": "#/components/schemas/GenerateTypesRequest"
2752
+ }
2753
+ }
2754
+ }
2755
+ },
2756
+ "responses": {
2757
+ "200": {
2758
+ "description": "Generated package",
2759
+ "content": {
2760
+ "application/json": {
2761
+ "schema": {
2762
+ "$ref": "#/components/schemas/GenerateTypesResponse"
2763
+ }
2764
+ }
2765
+ }
2766
+ },
2767
+ "400": {
2768
+ "$ref": "#/components/responses/BadRequest"
2769
+ },
2770
+ "403": {
2771
+ "$ref": "#/components/responses/Forbidden"
2772
+ },
2773
+ "404": {
2774
+ "$ref": "#/components/responses/NotFound"
2775
+ },
2776
+ "500": {
2777
+ "$ref": "#/components/responses/InternalServerError"
2778
+ }
2779
+ }
2780
+ }
2781
+ },
2782
+ "/v1/integrations/{integrationId}/commit-types": {
2783
+ "post": {
2784
+ "operationId": "commitTypes",
2785
+ "summary": "Commit generated types and lock use case configurations",
2786
+ "description": "Commits the generated types by locking use case configurations and updating version tracking. Should be called after the user reviews and downloads the generated package.\n",
2787
+ "tags": [
2788
+ "integrations"
2789
+ ],
2790
+ "security": [
2791
+ {
2792
+ "EpilotAuth": []
2793
+ }
2794
+ ],
2795
+ "parameters": [
2796
+ {
2797
+ "name": "integrationId",
2798
+ "in": "path",
2799
+ "required": true,
2800
+ "schema": {
2801
+ "type": "string",
2802
+ "format": "uuid"
2803
+ }
2804
+ }
2805
+ ],
2806
+ "requestBody": {
2807
+ "required": true,
2808
+ "content": {
2809
+ "application/json": {
2810
+ "schema": {
2811
+ "$ref": "#/components/schemas/CommitTypesRequest"
2812
+ }
2813
+ }
2814
+ }
2815
+ },
2816
+ "responses": {
2817
+ "200": {
2818
+ "description": "Types committed successfully",
2819
+ "content": {
2820
+ "application/json": {
2821
+ "schema": {
2822
+ "$ref": "#/components/schemas/CommitTypesResponse"
2823
+ }
2824
+ }
2825
+ }
2826
+ },
2827
+ "400": {
2828
+ "$ref": "#/components/responses/BadRequest"
2829
+ },
2830
+ "403": {
2831
+ "$ref": "#/components/responses/Forbidden"
2832
+ },
2833
+ "404": {
2834
+ "$ref": "#/components/responses/NotFound"
2835
+ },
2836
+ "500": {
2837
+ "$ref": "#/components/responses/InternalServerError"
2838
+ }
2839
+ }
2840
+ }
2841
+ }
2842
+ },
2843
+ "components": {
2844
+ "securitySchemes": {
2845
+ "EpilotAuth": {
2846
+ "type": "http",
2847
+ "scheme": "bearer",
2848
+ "description": "Authorization header with epilot OAuth2 bearer token",
2849
+ "bearerFormat": "JWT"
2850
+ }
2851
+ },
2852
+ "schemas": {
2853
+ "ErrorResponseBase": {
2854
+ "type": "object",
2855
+ "properties": {
2856
+ "code": {
2857
+ "type": "string",
2858
+ "description": "Computer-readable error code"
2859
+ },
2860
+ "message": {
2861
+ "type": "string",
2862
+ "description": "Error message"
2863
+ }
2864
+ }
2865
+ },
2866
+ "ErpEvent": {
2867
+ "type": "object",
2868
+ "required": [
2869
+ "event_type",
2870
+ "object_type",
2871
+ "timestamp",
2872
+ "format",
2873
+ "payload"
2874
+ ],
2875
+ "properties": {
2876
+ "event_type": {
2877
+ "type": "string",
2878
+ "enum": [
2879
+ "CREATE",
2880
+ "UPDATE",
2881
+ "DELETE"
2882
+ ],
2883
+ "description": "Type of event (create, update, delete)"
2884
+ },
2885
+ "object_type": {
2886
+ "type": "string",
2887
+ "description": "Type of the object being updated (business_partner, contract_account, etc.). Corresponds to \"Event Name\" from the integration UI."
2888
+ },
2889
+ "timestamp": {
2427
2890
  "type": "string",
2428
2891
  "format": "date-time",
2429
2892
  "description": "Timestamp when the event occurred"
@@ -2510,12 +2973,14 @@
2510
2973
  "properties": {
2511
2974
  "event_name": {
2512
2975
  "type": "string",
2513
- "description": "Event name from integration mapping (e.g., business_partner, contract_account). Required when use_case_slug is not provided.\n"
2976
+ "description": "Event name from integration mapping (e.g., business_partner, contract_account). Required when use_case_slug is not provided.\n",
2977
+ "example": "business_partner"
2514
2978
  },
2515
2979
  "timestamp": {
2516
2980
  "type": "string",
2517
2981
  "format": "date-time",
2518
- "description": "Timestamp when the event occurred"
2982
+ "description": "Timestamp when the event occurred",
2983
+ "example": "2025-05-01T08:30:00Z"
2519
2984
  },
2520
2985
  "format": {
2521
2986
  "type": "string",
@@ -2524,7 +2989,8 @@
2524
2989
  "xml"
2525
2990
  ],
2526
2991
  "default": "json",
2527
- "description": "Format of the payload data"
2992
+ "description": "Format of the payload data",
2993
+ "example": "json"
2528
2994
  },
2529
2995
  "payload": {
2530
2996
  "oneOf": [
@@ -2540,14 +3006,16 @@
2540
3006
  "additionalProperties": true
2541
3007
  }
2542
3008
  ],
2543
- "description": "The object data payload - can be either a serialized string or a direct JSON object"
3009
+ "description": "The object data payload - can be either a serialized string or a direct JSON object",
3010
+ "example": "{\"id\":\"BP10001\",\"name\":\"Acme Corporation\",\"type\":\"organization\",\"tax_id\":\"DE123456789\",\"status\":\"active\"}"
2544
3011
  },
2545
3012
  "use_case_slug": {
2546
3013
  "type": "string",
2547
3014
  "pattern": "^[a-z0-9][a-z0-9_-]*$",
2548
3015
  "minLength": 1,
2549
3016
  "maxLength": 255,
2550
- "description": "Recommended. Use case slug for routing this event to the correct use case configuration. If provided, takes precedence over event_name for use case lookup. Preferred over event_name-based routing as slugs are portable across environments.\n"
3017
+ "description": "Recommended. Use case slug for routing this event to the correct use case configuration. If provided, takes precedence over event_name for use case lookup. Preferred over event_name-based routing as slugs are portable across environments.\n",
3018
+ "example": "business_partner"
2551
3019
  },
2552
3020
  "deduplication_id": {
2553
3021
  "type": "string",
@@ -2712,25 +3180,177 @@
2712
3180
  },
2713
3181
  "settings": {
2714
3182
  "$ref": "#/components/schemas/IntegrationSettings"
3183
+ },
3184
+ "integration_type": {
3185
+ "type": "string",
3186
+ "enum": [
3187
+ "erp",
3188
+ "connector"
3189
+ ],
3190
+ "default": "erp",
3191
+ "description": "Type of integration. \"erp\" is the ERP integration with inbound/outbound use cases. \"connector\" is for complex proxy integrations with external APIs.\n"
3192
+ },
3193
+ "connector_config": {
3194
+ "$ref": "#/components/schemas/ConnectorConfig"
3195
+ },
3196
+ "protected": {
3197
+ "type": "boolean",
3198
+ "description": "If true, integration is displayed in read-only mode in the UI to discourage changes"
3199
+ },
3200
+ "_manifest": {
3201
+ "type": "array",
3202
+ "description": "The manifest IDs associated with this integration",
3203
+ "items": {
3204
+ "type": "string"
3205
+ }
2715
3206
  }
2716
3207
  }
2717
3208
  },
2718
- "Integration": {
2719
- "allOf": [
2720
- {
2721
- "type": "object",
2722
- "required": [
2723
- "id",
2724
- "orgId",
2725
- "name",
2726
- "created_at",
2727
- "updated_at"
2728
- ],
2729
- "properties": {
2730
- "id": {
2731
- "type": "string",
2732
- "format": "uuid",
2733
- "readOnly": true,
3209
+ "ConnectorConfig": {
3210
+ "type": "object",
3211
+ "description": "Shared configuration for connector-type integrations",
3212
+ "properties": {
3213
+ "base_url": {
3214
+ "type": "string",
3215
+ "description": "Base URL for the partner API"
3216
+ },
3217
+ "auth": {
3218
+ "$ref": "#/components/schemas/ManagedCallAuth"
3219
+ },
3220
+ "types_versions": {
3221
+ "type": "array",
3222
+ "description": "History of generated type package versions",
3223
+ "items": {
3224
+ "type": "object",
3225
+ "required": [
3226
+ "version",
3227
+ "package_name",
3228
+ "generated_at",
3229
+ "generated_by",
3230
+ "status"
3231
+ ],
3232
+ "properties": {
3233
+ "version": {
3234
+ "type": "string"
3235
+ },
3236
+ "package_name": {
3237
+ "type": "string"
3238
+ },
3239
+ "generated_at": {
3240
+ "type": "string",
3241
+ "format": "date-time"
3242
+ },
3243
+ "generated_by": {
3244
+ "type": "string"
3245
+ },
3246
+ "status": {
3247
+ "type": "string",
3248
+ "enum": [
3249
+ "active",
3250
+ "deprecated"
3251
+ ]
3252
+ }
3253
+ }
3254
+ }
3255
+ },
3256
+ "latest_types_version": {
3257
+ "type": "string",
3258
+ "description": "Latest active types package version"
3259
+ },
3260
+ "latest_types_package_name": {
3261
+ "type": "string",
3262
+ "description": "Latest active types package name"
3263
+ }
3264
+ }
3265
+ },
3266
+ "ManagedCallAuth": {
3267
+ "type": "object",
3268
+ "description": "Authentication configuration for managed call requests",
3269
+ "properties": {
3270
+ "type": {
3271
+ "type": "string",
3272
+ "enum": [
3273
+ "oauth2_client_credentials",
3274
+ "api_key",
3275
+ "bearer"
3276
+ ],
3277
+ "description": "Authentication type"
3278
+ },
3279
+ "token_url": {
3280
+ "type": "string",
3281
+ "description": "OAuth2 token URL. Can be plain text or {{env.key}} reference."
3282
+ },
3283
+ "client_id": {
3284
+ "type": "string",
3285
+ "description": "OAuth2 client ID. Can be plain text or {{env.key}} reference."
3286
+ },
3287
+ "client_secret": {
3288
+ "type": "string",
3289
+ "description": "OAuth2 client secret. Must be an {{env.key}} reference (secret)."
3290
+ },
3291
+ "scope": {
3292
+ "type": "string",
3293
+ "description": "OAuth2 scope"
3294
+ },
3295
+ "audience": {
3296
+ "type": "string",
3297
+ "description": "OAuth2 audience parameter (e.g. for Auth0, Azure AD). Can be plain text or {{env.key}} reference."
3298
+ },
3299
+ "resource": {
3300
+ "type": "string",
3301
+ "description": "OAuth2 resource parameter (e.g. for Azure AD). Can be plain text or {{env.key}} reference."
3302
+ },
3303
+ "body_params": {
3304
+ "type": "object",
3305
+ "additionalProperties": {
3306
+ "type": "string"
3307
+ },
3308
+ "description": "Additional key-value pairs for the OAuth2 token request body. Values can be {{env.key}} references."
3309
+ },
3310
+ "headers": {
3311
+ "type": "object",
3312
+ "additionalProperties": {
3313
+ "type": "string"
3314
+ },
3315
+ "description": "Additional headers for the OAuth2 token request. Values can be {{env.key}} references."
3316
+ },
3317
+ "query_params": {
3318
+ "type": "object",
3319
+ "additionalProperties": {
3320
+ "type": "string"
3321
+ },
3322
+ "description": "Additional query parameters for the OAuth2 token URL. Values can be {{env.key}} references."
3323
+ },
3324
+ "api_key_header": {
3325
+ "type": "string",
3326
+ "description": "Header name for API key auth (default X-API-Key)"
3327
+ },
3328
+ "api_key": {
3329
+ "type": "string",
3330
+ "description": "API key value. Must be an {{env.key}} reference (secret)."
3331
+ },
3332
+ "token": {
3333
+ "type": "string",
3334
+ "description": "Bearer token value. Must be an {{env.key}} reference (secret)."
3335
+ }
3336
+ }
3337
+ },
3338
+ "Integration": {
3339
+ "allOf": [
3340
+ {
3341
+ "type": "object",
3342
+ "required": [
3343
+ "id",
3344
+ "orgId",
3345
+ "name",
3346
+ "created_at",
3347
+ "updated_at"
3348
+ ],
3349
+ "properties": {
3350
+ "id": {
3351
+ "type": "string",
3352
+ "format": "uuid",
3353
+ "readOnly": true,
2734
3354
  "description": "Unique identifier for the integration"
2735
3355
  },
2736
3356
  "orgId": {
@@ -3294,6 +3914,9 @@
3294
3914
  {
3295
3915
  "$ref": "#/components/schemas/EmbeddedFileProxyUseCaseRequest"
3296
3916
  },
3917
+ {
3918
+ "$ref": "#/components/schemas/EmbeddedManagedCallUseCaseRequest"
3919
+ },
3297
3920
  {
3298
3921
  "$ref": "#/components/schemas/EmbeddedSecureProxyUseCaseRequest"
3299
3922
  }
@@ -3304,6 +3927,7 @@
3304
3927
  "inbound": "#/components/schemas/EmbeddedInboundUseCaseRequest",
3305
3928
  "outbound": "#/components/schemas/EmbeddedOutboundUseCaseRequest",
3306
3929
  "file_proxy": "#/components/schemas/EmbeddedFileProxyUseCaseRequest",
3930
+ "managed_call": "#/components/schemas/EmbeddedManagedCallUseCaseRequest",
3307
3931
  "secure_proxy": "#/components/schemas/EmbeddedSecureProxyUseCaseRequest"
3308
3932
  }
3309
3933
  }
@@ -3420,6 +4044,31 @@
3420
4044
  }
3421
4045
  ]
3422
4046
  },
4047
+ "EmbeddedManagedCallUseCaseRequest": {
4048
+ "allOf": [
4049
+ {
4050
+ "$ref": "#/components/schemas/EmbeddedUseCaseRequestBase"
4051
+ },
4052
+ {
4053
+ "type": "object",
4054
+ "required": [
4055
+ "type"
4056
+ ],
4057
+ "properties": {
4058
+ "type": {
4059
+ "type": "string",
4060
+ "enum": [
4061
+ "managed_call"
4062
+ ],
4063
+ "description": "Use case type for managed API calls"
4064
+ },
4065
+ "configuration": {
4066
+ "$ref": "#/components/schemas/ManagedCallOperationConfig"
4067
+ }
4068
+ }
4069
+ }
4070
+ ]
4071
+ },
3423
4072
  "EmbeddedSecureProxyUseCaseRequest": {
3424
4073
  "allOf": [
3425
4074
  {
@@ -3484,6 +4133,7 @@
3484
4133
  "inbound",
3485
4134
  "outbound",
3486
4135
  "file_proxy",
4136
+ "managed_call",
3487
4137
  "secure_proxy"
3488
4138
  ],
3489
4139
  "description": "Use case type"
@@ -3583,6 +4233,38 @@
3583
4233
  }
3584
4234
  ]
3585
4235
  },
4236
+ "ManagedCallUseCase": {
4237
+ "allOf": [
4238
+ {
4239
+ "$ref": "#/components/schemas/UseCaseBase"
4240
+ },
4241
+ {
4242
+ "type": "object",
4243
+ "required": [
4244
+ "type"
4245
+ ],
4246
+ "properties": {
4247
+ "type": {
4248
+ "type": "string",
4249
+ "enum": [
4250
+ "managed_call"
4251
+ ],
4252
+ "description": "Use case type for managed API calls"
4253
+ },
4254
+ "configuration": {
4255
+ "$ref": "#/components/schemas/ManagedCallOperationConfig"
4256
+ },
4257
+ "type_annotations": {
4258
+ "$ref": "#/components/schemas/TypeAnnotations"
4259
+ },
4260
+ "types_locked": {
4261
+ "type": "boolean",
4262
+ "description": "Whether types have been generated for this use case"
4263
+ }
4264
+ }
4265
+ }
4266
+ ]
4267
+ },
3586
4268
  "SecureProxyUseCase": {
3587
4269
  "allOf": [
3588
4270
  {
@@ -3619,6 +4301,9 @@
3619
4301
  {
3620
4302
  "$ref": "#/components/schemas/FileProxyUseCase"
3621
4303
  },
4304
+ {
4305
+ "$ref": "#/components/schemas/ManagedCallUseCase"
4306
+ },
3622
4307
  {
3623
4308
  "$ref": "#/components/schemas/SecureProxyUseCase"
3624
4309
  }
@@ -3629,6 +4314,7 @@
3629
4314
  "inbound": "#/components/schemas/InboundUseCase",
3630
4315
  "outbound": "#/components/schemas/OutboundUseCase",
3631
4316
  "file_proxy": "#/components/schemas/FileProxyUseCase",
4317
+ "managed_call": "#/components/schemas/ManagedCallUseCase",
3632
4318
  "secure_proxy": "#/components/schemas/SecureProxyUseCase"
3633
4319
  }
3634
4320
  }
@@ -3644,6 +4330,9 @@
3644
4330
  {
3645
4331
  "$ref": "#/components/schemas/CreateFileProxyUseCaseRequest"
3646
4332
  },
4333
+ {
4334
+ "$ref": "#/components/schemas/CreateManagedCallUseCaseRequest"
4335
+ },
3647
4336
  {
3648
4337
  "$ref": "#/components/schemas/CreateSecureProxyUseCaseRequest"
3649
4338
  }
@@ -3654,6 +4343,7 @@
3654
4343
  "inbound": "#/components/schemas/CreateInboundUseCaseRequest",
3655
4344
  "outbound": "#/components/schemas/CreateOutboundUseCaseRequest",
3656
4345
  "file_proxy": "#/components/schemas/CreateFileProxyUseCaseRequest",
4346
+ "managed_call": "#/components/schemas/CreateManagedCallUseCaseRequest",
3657
4347
  "secure_proxy": "#/components/schemas/CreateSecureProxyUseCaseRequest"
3658
4348
  }
3659
4349
  }
@@ -3760,6 +4450,31 @@
3760
4450
  }
3761
4451
  ]
3762
4452
  },
4453
+ "CreateManagedCallUseCaseRequest": {
4454
+ "allOf": [
4455
+ {
4456
+ "$ref": "#/components/schemas/CreateUseCaseRequestBase"
4457
+ },
4458
+ {
4459
+ "type": "object",
4460
+ "required": [
4461
+ "type"
4462
+ ],
4463
+ "properties": {
4464
+ "type": {
4465
+ "type": "string",
4466
+ "enum": [
4467
+ "managed_call"
4468
+ ],
4469
+ "description": "Use case type for managed API calls"
4470
+ },
4471
+ "configuration": {
4472
+ "$ref": "#/components/schemas/ManagedCallOperationConfig"
4473
+ }
4474
+ }
4475
+ }
4476
+ ]
4477
+ },
3763
4478
  "CreateSecureProxyUseCaseRequest": {
3764
4479
  "allOf": [
3765
4480
  {
@@ -3796,6 +4511,9 @@
3796
4511
  {
3797
4512
  "$ref": "#/components/schemas/UpdateFileProxyUseCaseRequest"
3798
4513
  },
4514
+ {
4515
+ "$ref": "#/components/schemas/UpdateManagedCallUseCaseRequest"
4516
+ },
3799
4517
  {
3800
4518
  "$ref": "#/components/schemas/UpdateSecureProxyUseCaseRequest"
3801
4519
  }
@@ -3806,6 +4524,7 @@
3806
4524
  "inbound": "#/components/schemas/UpdateInboundUseCaseRequest",
3807
4525
  "outbound": "#/components/schemas/UpdateOutboundUseCaseRequest",
3808
4526
  "file_proxy": "#/components/schemas/UpdateFileProxyUseCaseRequest",
4527
+ "managed_call": "#/components/schemas/UpdateManagedCallUseCaseRequest",
3809
4528
  "secure_proxy": "#/components/schemas/UpdateSecureProxyUseCaseRequest"
3810
4529
  }
3811
4530
  }
@@ -3903,6 +4622,31 @@
3903
4622
  }
3904
4623
  ]
3905
4624
  },
4625
+ "UpdateManagedCallUseCaseRequest": {
4626
+ "allOf": [
4627
+ {
4628
+ "$ref": "#/components/schemas/UpdateUseCaseRequestBase"
4629
+ },
4630
+ {
4631
+ "type": "object",
4632
+ "properties": {
4633
+ "type": {
4634
+ "type": "string",
4635
+ "enum": [
4636
+ "managed_call"
4637
+ ],
4638
+ "description": "Use case type for managed API calls"
4639
+ },
4640
+ "configuration": {
4641
+ "$ref": "#/components/schemas/ManagedCallOperationConfig"
4642
+ },
4643
+ "type_annotations": {
4644
+ "$ref": "#/components/schemas/TypeAnnotations"
4645
+ }
4646
+ }
4647
+ }
4648
+ ]
4649
+ },
3906
4650
  "UpdateSecureProxyUseCaseRequest": {
3907
4651
  "allOf": [
3908
4652
  {
@@ -3936,6 +4680,9 @@
3936
4680
  {
3937
4681
  "$ref": "#/components/schemas/FileProxyUseCaseHistoryEntry"
3938
4682
  },
4683
+ {
4684
+ "$ref": "#/components/schemas/ManagedCallUseCaseHistoryEntry"
4685
+ },
3939
4686
  {
3940
4687
  "$ref": "#/components/schemas/SecureProxyUseCaseHistoryEntry"
3941
4688
  }
@@ -3946,6 +4693,7 @@
3946
4693
  "inbound": "#/components/schemas/InboundUseCaseHistoryEntry",
3947
4694
  "outbound": "#/components/schemas/OutboundUseCaseHistoryEntry",
3948
4695
  "file_proxy": "#/components/schemas/FileProxyUseCaseHistoryEntry",
4696
+ "managed_call": "#/components/schemas/ManagedCallUseCaseHistoryEntry",
3949
4697
  "secure_proxy": "#/components/schemas/SecureProxyUseCaseHistoryEntry"
3950
4698
  }
3951
4699
  }
@@ -4087,6 +4835,38 @@
4087
4835
  }
4088
4836
  ]
4089
4837
  },
4838
+ "ManagedCallUseCaseHistoryEntry": {
4839
+ "allOf": [
4840
+ {
4841
+ "$ref": "#/components/schemas/UseCaseHistoryEntryBase"
4842
+ },
4843
+ {
4844
+ "type": "object",
4845
+ "required": [
4846
+ "type"
4847
+ ],
4848
+ "properties": {
4849
+ "type": {
4850
+ "type": "string",
4851
+ "enum": [
4852
+ "managed_call"
4853
+ ],
4854
+ "description": "Use case type for managed API calls"
4855
+ },
4856
+ "configuration": {
4857
+ "$ref": "#/components/schemas/ManagedCallOperationConfig"
4858
+ },
4859
+ "type_annotations": {
4860
+ "$ref": "#/components/schemas/TypeAnnotations"
4861
+ },
4862
+ "types_locked": {
4863
+ "type": "boolean",
4864
+ "description": "Whether types have been generated for this use case"
4865
+ }
4866
+ }
4867
+ }
4868
+ ]
4869
+ },
4090
4870
  "SecureProxyUseCaseHistoryEntry": {
4091
4871
  "allOf": [
4092
4872
  {
@@ -4135,6 +4915,14 @@
4135
4915
  },
4136
4916
  "readOnly": true,
4137
4917
  "description": "Domain whitelist for secure_link mode. Admin-only — can only be modified directly in DynamoDB via admin script.\nSupports exact match (e.g., \"api.wemag.com\") and wildcard prefix (e.g., \"*.wemag.com\").\n"
4918
+ },
4919
+ "allowed_ips": {
4920
+ "type": "array",
4921
+ "items": {
4922
+ "type": "string"
4923
+ },
4924
+ "readOnly": true,
4925
+ "description": "IP allowlist (CIDR notation) for secure_link mode. Admin-only — can only be modified directly in DynamoDB via admin script.\nRequired for secure_link mode. All DNS-resolved IPs must match at least one range.\nExample: [\"10.0.1.0/24\", \"192.168.1.0/24\"]\n"
4138
4926
  }
4139
4927
  }
4140
4928
  },
@@ -4159,106 +4947,497 @@
4159
4947
  "slug": {
4160
4948
  "type": "string"
4161
4949
  },
4162
- "enabled": {
4163
- "type": "boolean"
4164
- },
4165
- "vpc_mode": {
4166
- "type": "string",
4167
- "enum": [
4168
- "static_ip",
4169
- "secure_link"
4170
- ]
4950
+ "enabled": {
4951
+ "type": "boolean"
4952
+ },
4953
+ "vpc_mode": {
4954
+ "type": "string",
4955
+ "enum": [
4956
+ "static_ip",
4957
+ "secure_link"
4958
+ ]
4959
+ },
4960
+ "allowed_domains": {
4961
+ "type": "array",
4962
+ "items": {
4963
+ "type": "string"
4964
+ }
4965
+ },
4966
+ "allowed_ips": {
4967
+ "type": "array",
4968
+ "items": {
4969
+ "type": "string"
4970
+ }
4971
+ },
4972
+ "integration_id": {
4973
+ "type": "string",
4974
+ "format": "uuid"
4975
+ },
4976
+ "integration_name": {
4977
+ "type": "string"
4978
+ }
4979
+ }
4980
+ },
4981
+ "SecureProxyRequest": {
4982
+ "type": "object",
4983
+ "required": [
4984
+ "url",
4985
+ "method",
4986
+ "integration_id"
4987
+ ],
4988
+ "properties": {
4989
+ "integration_id": {
4990
+ "type": "string",
4991
+ "format": "uuid",
4992
+ "description": "Integration ID that owns the secure_proxy use case"
4993
+ },
4994
+ "use_case_id": {
4995
+ "type": "string",
4996
+ "format": "uuid",
4997
+ "description": "Use case ID (provide either use_case_id or use_case_slug)"
4998
+ },
4999
+ "use_case_slug": {
5000
+ "type": "string",
5001
+ "description": "Use case slug (provide either use_case_id or use_case_slug)"
5002
+ },
5003
+ "url": {
5004
+ "type": "string",
5005
+ "format": "uri",
5006
+ "description": "Target URL to proxy the request to"
5007
+ },
5008
+ "method": {
5009
+ "type": "string",
5010
+ "enum": [
5011
+ "GET",
5012
+ "POST",
5013
+ "PUT",
5014
+ "PATCH",
5015
+ "DELETE"
5016
+ ],
5017
+ "description": "HTTP method"
5018
+ },
5019
+ "headers": {
5020
+ "type": "object",
5021
+ "additionalProperties": {
5022
+ "type": "string"
5023
+ },
5024
+ "description": "Request headers to forward"
5025
+ },
5026
+ "body": {
5027
+ "description": "Request body (string or JSON)"
5028
+ },
5029
+ "response_type": {
5030
+ "type": "string",
5031
+ "enum": [
5032
+ "json",
5033
+ "binary"
5034
+ ],
5035
+ "default": "json",
5036
+ "description": "Expected response type"
5037
+ }
5038
+ }
5039
+ },
5040
+ "SecureProxyResponse": {
5041
+ "type": "object",
5042
+ "properties": {
5043
+ "status_code": {
5044
+ "type": "integer",
5045
+ "description": "HTTP status code from the upstream response"
5046
+ },
5047
+ "headers": {
5048
+ "type": "object",
5049
+ "additionalProperties": {
5050
+ "type": "string"
5051
+ },
5052
+ "description": "Response headers from upstream"
5053
+ },
5054
+ "body": {
5055
+ "description": "Response body from upstream"
5056
+ }
5057
+ }
5058
+ },
5059
+ "ManagedCallOperationConfig": {
5060
+ "type": "object",
5061
+ "required": [
5062
+ "operation"
5063
+ ],
5064
+ "description": "Configuration for managed_call use cases. Defines a single API operation with JSONata mapping.",
5065
+ "properties": {
5066
+ "operation": {
5067
+ "$ref": "#/components/schemas/ManagedCallOperation"
5068
+ },
5069
+ "request_mapping": {
5070
+ "type": "string",
5071
+ "description": "JSONata expression for outbound body transformation"
5072
+ },
5073
+ "response_mapping": {
5074
+ "type": "string",
5075
+ "description": "JSONata expression for inbound response transformation"
5076
+ },
5077
+ "inbound_use_case_slug": {
5078
+ "type": "string",
5079
+ "description": "Slug of the inbound use case to route responses to for async entity processing.\nWhen set, the managed call response is queued to the inbound pipeline and processed\nusing the referenced inbound use case's mapping configuration.\n"
5080
+ }
5081
+ }
5082
+ },
5083
+ "ManagedCallOperation": {
5084
+ "type": "object",
5085
+ "required": [
5086
+ "method",
5087
+ "path"
5088
+ ],
5089
+ "description": "HTTP operation configuration for managed calls",
5090
+ "properties": {
5091
+ "method": {
5092
+ "type": "string",
5093
+ "enum": [
5094
+ "GET",
5095
+ "POST",
5096
+ "PUT",
5097
+ "PATCH",
5098
+ "DELETE"
5099
+ ]
5100
+ },
5101
+ "path": {
5102
+ "type": "string",
5103
+ "description": "URL path template with {{variable}} interpolation"
5104
+ },
5105
+ "headers": {
5106
+ "type": "object",
5107
+ "description": "Custom HTTP headers for the request. Values support {{variable}} interpolation from the request payload and {{env.VAR}} references for environment variables.",
5108
+ "additionalProperties": {
5109
+ "type": "string"
5110
+ }
5111
+ },
5112
+ "query_params": {
5113
+ "type": "object",
5114
+ "description": "Query parameters for the request. Values support {{variable}} interpolation from the request payload.",
5115
+ "additionalProperties": {
5116
+ "type": "string"
5117
+ }
5118
+ }
5119
+ }
5120
+ },
5121
+ "ManagedCallExecuteRequest": {
5122
+ "type": "object",
5123
+ "required": [
5124
+ "integration_id"
5125
+ ],
5126
+ "properties": {
5127
+ "integration_id": {
5128
+ "type": "string",
5129
+ "format": "uuid",
5130
+ "description": "Integration ID"
5131
+ },
5132
+ "payload": {
5133
+ "type": "object",
5134
+ "additionalProperties": true,
5135
+ "description": "Request payload for the managed call operation"
5136
+ },
5137
+ "correlation_id": {
5138
+ "type": "string",
5139
+ "description": "Correlation ID for tracing related events (auto-generated if not provided)"
5140
+ }
5141
+ }
5142
+ },
5143
+ "ManagedCallExecuteResponse": {
5144
+ "description": "The response from a managed call execution.\nOn success, returns the JSONata-mapped response data directly (no wrapper).\nThe shape is entirely defined by your response_mapping JSONata expression.\nIf no response_mapping is configured, returns the raw external API response.\nCheck the X-Inbound-Event-Id header for inbound pipeline tracking when inbound routing is configured.\n",
5145
+ "additionalProperties": true
5146
+ },
5147
+ "ManagedCallErrorResponse": {
5148
+ "type": "object",
5149
+ "required": [
5150
+ "error"
5151
+ ],
5152
+ "properties": {
5153
+ "error": {
5154
+ "type": "object",
5155
+ "required": [
5156
+ "code",
5157
+ "message"
5158
+ ],
5159
+ "properties": {
5160
+ "code": {
5161
+ "type": "string",
5162
+ "description": "Error code (e.g., EXTERNAL_API_ERROR, SSRF_BLOCKED, MANAGED_CALL_EXECUTION_ERROR)"
5163
+ },
5164
+ "message": {
5165
+ "type": "string",
5166
+ "description": "Human-readable error message"
5167
+ },
5168
+ "details": {
5169
+ "type": "object",
5170
+ "additionalProperties": true,
5171
+ "description": "Additional error details (e.g., status code and body for external API errors)"
5172
+ }
5173
+ }
5174
+ }
5175
+ }
5176
+ },
5177
+ "TypeAnnotations": {
5178
+ "type": "object",
5179
+ "description": "Developer-provided type annotations for a use case's request and response fields",
5180
+ "properties": {
5181
+ "request": {
5182
+ "type": "object",
5183
+ "description": "Type annotations for request fields, keyed by dot-path (e.g., \"vendors[].id\" -> \"string\")",
5184
+ "additionalProperties": {
5185
+ "type": "string"
5186
+ }
5187
+ },
5188
+ "response": {
5189
+ "type": "object",
5190
+ "description": "Type annotations for response fields",
5191
+ "additionalProperties": {
5192
+ "type": "string"
5193
+ }
5194
+ }
5195
+ }
5196
+ },
5197
+ "TypeDescriptor": {
5198
+ "type": "object",
5199
+ "description": "Describes the inferred type shape of a JSONata expression",
5200
+ "required": [
5201
+ "kind"
5202
+ ],
5203
+ "properties": {
5204
+ "kind": {
5205
+ "type": "string",
5206
+ "enum": [
5207
+ "object",
5208
+ "array",
5209
+ "string",
5210
+ "number",
5211
+ "boolean",
5212
+ "null",
5213
+ "unknown",
5214
+ "union"
5215
+ ]
5216
+ },
5217
+ "properties": {
5218
+ "type": "object",
5219
+ "description": "For kind=object, the properties and their type descriptors",
5220
+ "additionalProperties": {
5221
+ "$ref": "#/components/schemas/TypeDescriptor"
5222
+ }
5223
+ },
5224
+ "items": {
5225
+ "description": "For kind=array, the type of array items",
5226
+ "allOf": [
5227
+ {
5228
+ "$ref": "#/components/schemas/TypeDescriptor"
5229
+ }
5230
+ ]
5231
+ },
5232
+ "source": {
5233
+ "type": "string",
5234
+ "description": "For kind=unknown, the JSONata path that produced this value"
5235
+ },
5236
+ "variants": {
5237
+ "type": "array",
5238
+ "description": "For kind=union, the variant types",
5239
+ "items": {
5240
+ "$ref": "#/components/schemas/TypeDescriptor"
5241
+ }
5242
+ }
5243
+ }
5244
+ },
5245
+ "UseCaseTypePreview": {
5246
+ "type": "object",
5247
+ "description": "Scaffolded type descriptors for a single use case",
5248
+ "required": [
5249
+ "slug",
5250
+ "request_shape",
5251
+ "response_shape"
5252
+ ],
5253
+ "properties": {
5254
+ "slug": {
5255
+ "type": "string"
5256
+ },
5257
+ "name": {
5258
+ "type": "string"
5259
+ },
5260
+ "request_shape": {
5261
+ "$ref": "#/components/schemas/TypeDescriptor"
5262
+ },
5263
+ "response_shape": {
5264
+ "$ref": "#/components/schemas/TypeDescriptor"
5265
+ },
5266
+ "existing_annotations": {
5267
+ "$ref": "#/components/schemas/TypeAnnotations"
5268
+ }
5269
+ }
5270
+ },
5271
+ "GenerateTypesPreviewResponse": {
5272
+ "type": "object",
5273
+ "required": [
5274
+ "use_cases"
5275
+ ],
5276
+ "properties": {
5277
+ "integration_name": {
5278
+ "type": "string"
5279
+ },
5280
+ "use_cases": {
5281
+ "type": "array",
5282
+ "items": {
5283
+ "$ref": "#/components/schemas/UseCaseTypePreview"
5284
+ }
5285
+ },
5286
+ "previous_version": {
5287
+ "type": "string",
5288
+ "description": "Previously generated version, if any"
5289
+ },
5290
+ "suggested_version": {
5291
+ "type": "string",
5292
+ "description": "Suggested next version based on detected changes"
5293
+ },
5294
+ "suggested_bump": {
5295
+ "type": "string",
5296
+ "enum": [
5297
+ "major",
5298
+ "minor"
5299
+ ]
5300
+ },
5301
+ "detected_changes": {
5302
+ "type": "array",
5303
+ "items": {
5304
+ "type": "object",
5305
+ "required": [
5306
+ "slug",
5307
+ "field",
5308
+ "type",
5309
+ "description"
5310
+ ],
5311
+ "properties": {
5312
+ "slug": {
5313
+ "type": "string"
5314
+ },
5315
+ "field": {
5316
+ "type": "string"
5317
+ },
5318
+ "type": {
5319
+ "type": "string",
5320
+ "enum": [
5321
+ "breaking",
5322
+ "non-breaking"
5323
+ ]
5324
+ },
5325
+ "description": {
5326
+ "type": "string"
5327
+ }
5328
+ }
5329
+ }
5330
+ }
5331
+ }
5332
+ },
5333
+ "GenerateTypesRequest": {
5334
+ "type": "object",
5335
+ "required": [
5336
+ "package_name",
5337
+ "version"
5338
+ ],
5339
+ "properties": {
5340
+ "package_name": {
5341
+ "type": "string",
5342
+ "description": "npm package name",
5343
+ "example": "@epilot/hems-cleverpv"
5344
+ },
5345
+ "version": {
5346
+ "type": "string",
5347
+ "description": "Package version",
5348
+ "example": "1.0.0"
5349
+ },
5350
+ "description": {
5351
+ "type": "string"
5352
+ },
5353
+ "domain_package": {
5354
+ "type": "string",
5355
+ "description": "Domain standard package to extend",
5356
+ "example": "@epilot/hems"
5357
+ },
5358
+ "domain_map_name": {
5359
+ "type": "string",
5360
+ "description": "Name of the domain UseCaseMap to extend",
5361
+ "example": "HemsUseCaseMap"
5362
+ },
5363
+ "annotations": {
5364
+ "type": "object",
5365
+ "description": "Type annotations per use case slug",
5366
+ "additionalProperties": {
5367
+ "$ref": "#/components/schemas/TypeAnnotations"
5368
+ }
5369
+ }
5370
+ }
5371
+ },
5372
+ "GenerateTypesResponse": {
5373
+ "type": "object",
5374
+ "required": [
5375
+ "package_name",
5376
+ "version",
5377
+ "files"
5378
+ ],
5379
+ "properties": {
5380
+ "package_name": {
5381
+ "type": "string"
5382
+ },
5383
+ "version": {
5384
+ "type": "string"
5385
+ },
5386
+ "files": {
5387
+ "type": "object",
5388
+ "description": "Generated file contents keyed by file path",
5389
+ "additionalProperties": {
5390
+ "type": "string"
5391
+ }
4171
5392
  },
4172
- "allowed_domains": {
5393
+ "warnings": {
4173
5394
  "type": "array",
4174
5395
  "items": {
4175
5396
  "type": "string"
4176
5397
  }
4177
- },
4178
- "integration_id": {
4179
- "type": "string",
4180
- "format": "uuid"
4181
- },
4182
- "integration_name": {
4183
- "type": "string"
4184
5398
  }
4185
5399
  }
4186
5400
  },
4187
- "SecureProxyRequest": {
5401
+ "CommitTypesRequest": {
4188
5402
  "type": "object",
4189
5403
  "required": [
4190
- "url",
4191
- "method",
4192
- "integration_id"
5404
+ "package_name",
5405
+ "version"
4193
5406
  ],
4194
5407
  "properties": {
4195
- "integration_id": {
4196
- "type": "string",
4197
- "format": "uuid",
4198
- "description": "Integration ID that owns the secure_proxy use case"
4199
- },
4200
- "use_case_id": {
5408
+ "package_name": {
4201
5409
  "type": "string",
4202
- "format": "uuid",
4203
- "description": "Use case ID (provide either use_case_id or use_case_slug)"
4204
- },
4205
- "use_case_slug": {
4206
- "type": "string",
4207
- "description": "Use case slug (provide either use_case_id or use_case_slug)"
4208
- },
4209
- "url": {
4210
- "type": "string",
4211
- "format": "uri",
4212
- "description": "Target URL to proxy the request to"
5410
+ "description": "npm package name",
5411
+ "example": "@epilot/hems-cleverpv"
4213
5412
  },
4214
- "method": {
5413
+ "version": {
4215
5414
  "type": "string",
4216
- "enum": [
4217
- "GET",
4218
- "POST",
4219
- "PUT",
4220
- "PATCH",
4221
- "DELETE"
4222
- ],
4223
- "description": "HTTP method"
5415
+ "description": "Package version",
5416
+ "example": "1.0.0"
4224
5417
  },
4225
- "headers": {
5418
+ "annotations": {
4226
5419
  "type": "object",
5420
+ "description": "Type annotations per use case slug",
4227
5421
  "additionalProperties": {
4228
- "type": "string"
4229
- },
4230
- "description": "Request headers to forward"
4231
- },
4232
- "body": {
4233
- "description": "Request body (string or JSON)"
4234
- },
4235
- "response_type": {
4236
- "type": "string",
4237
- "enum": [
4238
- "json",
4239
- "binary"
4240
- ],
4241
- "default": "json",
4242
- "description": "Expected response type"
5422
+ "$ref": "#/components/schemas/TypeAnnotations"
5423
+ }
4243
5424
  }
4244
5425
  }
4245
5426
  },
4246
- "SecureProxyResponse": {
5427
+ "CommitTypesResponse": {
4247
5428
  "type": "object",
5429
+ "required": [
5430
+ "committed"
5431
+ ],
4248
5432
  "properties": {
4249
- "status_code": {
4250
- "type": "integer",
4251
- "description": "HTTP status code from the upstream response"
5433
+ "committed": {
5434
+ "type": "boolean"
4252
5435
  },
4253
- "headers": {
4254
- "type": "object",
4255
- "additionalProperties": {
5436
+ "warnings": {
5437
+ "type": "array",
5438
+ "items": {
4256
5439
  "type": "string"
4257
- },
4258
- "description": "Response headers from upstream"
4259
- },
4260
- "body": {
4261
- "description": "Response body from upstream"
5440
+ }
4262
5441
  }
4263
5442
  }
4264
5443
  },
@@ -4271,8 +5450,12 @@
4271
5450
  "description": "Configuration for file_proxy use cases. Defines how to authenticate and fetch files from external document systems.\n\nThe file proxy download URL always requires `orgId`, `integrationId`, and either `useCaseSlug` (recommended) or `useCaseId` (legacy UUID) as query parameters.\nThe `orgId` is included in the signed URL to establish organization context without requiring authentication.\nAdditional use-case-specific parameters are declared in the `params` array.\n",
4272
5451
  "properties": {
4273
5452
  "secure_proxy": {
4274
- "$ref": "#/components/schemas/FileProxySecureProxyAttachment",
4275
- "description": "Optional secure proxy attachment for routing all outbound file proxy requests.\nOnly `use_case_slug` is supported and the referenced secure_proxy use case\nmust belong to the same integration.\n"
5453
+ "description": "Optional secure proxy attachment for routing all outbound file proxy requests.\nOnly `use_case_slug` is supported and the referenced secure_proxy use case\nmust belong to the same integration.\n",
5454
+ "allOf": [
5455
+ {
5456
+ "$ref": "#/components/schemas/FileProxySecureProxyAttachment"
5457
+ }
5458
+ ]
4276
5459
  },
4277
5460
  "auth": {
4278
5461
  "$ref": "#/components/schemas/FileProxyAuth"
@@ -5889,44 +7072,218 @@
5889
7072
  },
5890
7073
  "correlation_id": {
5891
7074
  "type": "string",
5892
- "nullable": true,
5893
- "description": "Correlation ID for tracing related events"
7075
+ "nullable": true,
7076
+ "description": "Correlation ID for tracing related events"
7077
+ },
7078
+ "integration_id": {
7079
+ "type": "string",
7080
+ "nullable": true,
7081
+ "description": "Integration ID"
7082
+ },
7083
+ "use_case_id": {
7084
+ "type": "string",
7085
+ "nullable": true,
7086
+ "description": "Use case ID"
7087
+ },
7088
+ "event_type": {
7089
+ "type": "string",
7090
+ "enum": [
7091
+ "CREATE",
7092
+ "UPDATE",
7093
+ "DELETE",
7094
+ "TRIGGER"
7095
+ ],
7096
+ "description": "Type of event (optional for V3 events)"
7097
+ },
7098
+ "object_type": {
7099
+ "type": "string",
7100
+ "description": "Type of object being synced (e.g., 'contract', 'meter')"
7101
+ },
7102
+ "sync_type": {
7103
+ "type": "string",
7104
+ "enum": [
7105
+ "entity",
7106
+ "meter_reading",
7107
+ "webhook",
7108
+ "api_deprecation"
7109
+ ],
7110
+ "description": "Type of sync operation"
7111
+ },
7112
+ "status": {
7113
+ "type": "string",
7114
+ "enum": [
7115
+ "success",
7116
+ "error",
7117
+ "skipped",
7118
+ "warning"
7119
+ ],
7120
+ "description": "Processing status"
7121
+ },
7122
+ "error_code": {
7123
+ "type": "string",
7124
+ "nullable": true,
7125
+ "description": "Error code (when status=error)"
7126
+ },
7127
+ "error_message": {
7128
+ "type": "string",
7129
+ "nullable": true,
7130
+ "description": "Error message (when status=error)"
7131
+ },
7132
+ "error_category": {
7133
+ "type": "string",
7134
+ "nullable": true,
7135
+ "enum": [
7136
+ "validation",
7137
+ "configuration",
7138
+ "downstream_api",
7139
+ "timeout",
7140
+ "system"
7141
+ ],
7142
+ "description": "Error category (when status=error)"
7143
+ },
7144
+ "processing_duration_ms": {
7145
+ "type": "integer",
7146
+ "nullable": true,
7147
+ "description": "Processing duration in milliseconds"
7148
+ },
7149
+ "received_at": {
7150
+ "type": "string",
7151
+ "format": "date-time",
7152
+ "description": "When the event was received"
7153
+ },
7154
+ "completed_at": {
7155
+ "type": "string",
7156
+ "format": "date-time",
7157
+ "description": "When processing completed"
7158
+ }
7159
+ }
7160
+ },
7161
+ "QueryMonitoringEventsV2Request": {
7162
+ "type": "object",
7163
+ "properties": {
7164
+ "use_case_id": {
7165
+ "type": "string",
7166
+ "description": "Filter by use case ID (UUID). Empty string matches \"General\" events."
7167
+ },
7168
+ "use_case_type": {
7169
+ "type": "string",
7170
+ "enum": [
7171
+ "inbound",
7172
+ "outbound",
7173
+ "file_proxy",
7174
+ "managed_call",
7175
+ "secure_proxy"
7176
+ ],
7177
+ "description": "Filter by use case type (replaces direction)"
7178
+ },
7179
+ "level": {
7180
+ "type": "string",
7181
+ "enum": [
7182
+ "success",
7183
+ "error",
7184
+ "skipped",
7185
+ "warning"
7186
+ ],
7187
+ "description": "Filter by event level"
7188
+ },
7189
+ "code": {
7190
+ "type": "string",
7191
+ "description": "Filter by taxonomy code (e.g. OAUTH2_TOKEN_FAILURE, HTTP_502)"
7192
+ },
7193
+ "event_id": {
7194
+ "type": "string",
7195
+ "description": "Filter by trigger/inbound event ID"
7196
+ },
7197
+ "correlation_id": {
7198
+ "type": "string",
7199
+ "description": "Filter by correlation ID for tracing"
7200
+ },
7201
+ "from_date": {
7202
+ "type": "string",
7203
+ "format": "date-time",
7204
+ "description": "Filter events from this date (inclusive)",
7205
+ "example": "2025-01-01T00:00:00Z"
7206
+ },
7207
+ "to_date": {
7208
+ "type": "string",
7209
+ "format": "date-time",
7210
+ "description": "Filter events until this date (inclusive)",
7211
+ "example": "2025-01-31T23:59:59Z"
7212
+ },
7213
+ "limit": {
7214
+ "type": "integer",
7215
+ "description": "Maximum number of results to return",
7216
+ "example": 50,
7217
+ "default": 50,
7218
+ "minimum": 1,
7219
+ "maximum": 100
7220
+ },
7221
+ "cursor": {
7222
+ "type": "object",
7223
+ "description": "Cursor for pagination (from previous response's next_cursor)",
7224
+ "properties": {
7225
+ "created_at": {
7226
+ "type": "string",
7227
+ "format": "date-time"
7228
+ },
7229
+ "id": {
7230
+ "type": "string",
7231
+ "format": "uuid"
7232
+ }
7233
+ }
7234
+ }
7235
+ }
7236
+ },
7237
+ "MonitoringEventV2": {
7238
+ "type": "object",
7239
+ "required": [
7240
+ "id",
7241
+ "org_id",
7242
+ "integration_id",
7243
+ "event_id",
7244
+ "use_case_type",
7245
+ "level",
7246
+ "created_at"
7247
+ ],
7248
+ "properties": {
7249
+ "id": {
7250
+ "type": "string",
7251
+ "format": "uuid",
7252
+ "description": "Unique monitoring event ID"
7253
+ },
7254
+ "org_id": {
7255
+ "type": "string",
7256
+ "description": "Organization ID"
5894
7257
  },
5895
7258
  "integration_id": {
5896
7259
  "type": "string",
5897
- "nullable": true,
5898
7260
  "description": "Integration ID"
5899
7261
  },
5900
- "use_case_id": {
7262
+ "event_id": {
5901
7263
  "type": "string",
5902
- "nullable": true,
5903
- "description": "Use case ID"
7264
+ "description": "Trigger/inbound event ID (groups related monitoring events)"
5904
7265
  },
5905
- "event_type": {
7266
+ "correlation_id": {
5906
7267
  "type": "string",
5907
- "enum": [
5908
- "CREATE",
5909
- "UPDATE",
5910
- "DELETE",
5911
- "TRIGGER"
5912
- ],
5913
- "description": "Type of event (optional for V3 events)"
7268
+ "description": "Correlation ID for tracing. Empty when unavailable."
5914
7269
  },
5915
- "object_type": {
7270
+ "use_case_id": {
5916
7271
  "type": "string",
5917
- "description": "Type of object being synced (e.g., 'contract', 'meter')"
7272
+ "description": "Use case ID. Empty for system-level events (\"General\")."
5918
7273
  },
5919
- "sync_type": {
7274
+ "use_case_type": {
5920
7275
  "type": "string",
5921
7276
  "enum": [
5922
- "entity",
5923
- "meter_reading",
5924
- "webhook",
5925
- "api_deprecation"
7277
+ "inbound",
7278
+ "outbound",
7279
+ "file_proxy",
7280
+ "managed_call",
7281
+ "secure_proxy",
7282
+ ""
5926
7283
  ],
5927
- "description": "Type of sync operation"
7284
+ "description": "Use case type. Empty for system-level events."
5928
7285
  },
5929
- "status": {
7286
+ "level": {
5930
7287
  "type": "string",
5931
7288
  "enum": [
5932
7289
  "success",
@@ -5934,44 +7291,198 @@
5934
7291
  "skipped",
5935
7292
  "warning"
5936
7293
  ],
5937
- "description": "Processing status"
7294
+ "description": "Event outcome level"
5938
7295
  },
5939
- "error_code": {
7296
+ "code": {
5940
7297
  "type": "string",
5941
- "nullable": true,
5942
- "description": "Error code (when status=error)"
7298
+ "description": "Taxonomy code (e.g. OAUTH2_TOKEN_FAILURE, HTTP_502). Empty for success."
5943
7299
  },
5944
- "error_message": {
7300
+ "message": {
5945
7301
  "type": "string",
7302
+ "description": "Human-readable message. Empty when not applicable."
7303
+ },
7304
+ "detail": {
7305
+ "type": "object",
5946
7306
  "nullable": true,
5947
- "description": "Error message (when status=error)"
7307
+ "additionalProperties": true,
7308
+ "description": "Event-specific JSON data. Structure determined by `code`."
5948
7309
  },
5949
- "error_category": {
7310
+ "created_at": {
7311
+ "type": "string",
7312
+ "format": "date-time",
7313
+ "description": "When the monitoring event was created"
7314
+ }
7315
+ }
7316
+ },
7317
+ "GetMonitoringStatsV2Request": {
7318
+ "type": "object",
7319
+ "properties": {
7320
+ "from_date": {
7321
+ "type": "string",
7322
+ "format": "date-time",
7323
+ "description": "Start of the time range",
7324
+ "example": "2025-01-01T00:00:00Z"
7325
+ },
7326
+ "to_date": {
7327
+ "type": "string",
7328
+ "format": "date-time",
7329
+ "description": "End of the time range",
7330
+ "example": "2025-01-31T23:59:59Z"
7331
+ },
7332
+ "use_case_type": {
5950
7333
  "type": "string",
5951
- "nullable": true,
5952
7334
  "enum": [
5953
- "validation",
5954
- "configuration",
5955
- "downstream_api",
5956
- "timeout",
5957
- "system"
7335
+ "inbound",
7336
+ "outbound",
7337
+ "file_proxy",
7338
+ "managed_call",
7339
+ "secure_proxy"
5958
7340
  ],
5959
- "description": "Error category (when status=error)"
7341
+ "description": "Filter stats by use case type"
5960
7342
  },
5961
- "processing_duration_ms": {
7343
+ "group_by": {
7344
+ "type": "string",
7345
+ "enum": [
7346
+ "use_case_id",
7347
+ "use_case_type",
7348
+ "level",
7349
+ "code",
7350
+ "date"
7351
+ ],
7352
+ "description": "Field to group the breakdown by"
7353
+ }
7354
+ }
7355
+ },
7356
+ "MonitoringStatsV2": {
7357
+ "type": "object",
7358
+ "required": [
7359
+ "total_events",
7360
+ "success_count",
7361
+ "error_count",
7362
+ "warning_count",
7363
+ "skipped_count"
7364
+ ],
7365
+ "properties": {
7366
+ "total_events": {
7367
+ "type": "integer",
7368
+ "description": "Total number of events in the period"
7369
+ },
7370
+ "success_count": {
7371
+ "type": "integer",
7372
+ "description": "Number of successful events"
7373
+ },
7374
+ "error_count": {
7375
+ "type": "integer",
7376
+ "description": "Number of error events"
7377
+ },
7378
+ "warning_count": {
7379
+ "type": "integer",
7380
+ "description": "Number of warning events"
7381
+ },
7382
+ "skipped_count": {
7383
+ "type": "integer",
7384
+ "description": "Number of skipped events"
7385
+ },
7386
+ "ack_timeout_count": {
5962
7387
  "type": "integer",
7388
+ "description": "Number of ACK_TIMEOUT events (acknowledgement timed out)"
7389
+ },
7390
+ "success_rate": {
7391
+ "type": "number",
7392
+ "format": "float",
7393
+ "description": "Success rate as percentage (0-100)"
7394
+ },
7395
+ "last_error_at": {
7396
+ "type": "string",
7397
+ "format": "date-time",
5963
7398
  "nullable": true,
5964
- "description": "Processing duration in milliseconds"
7399
+ "description": "Timestamp of the most recent error"
5965
7400
  },
5966
- "received_at": {
7401
+ "breakdown": {
7402
+ "type": "array",
7403
+ "description": "Statistics breakdown by requested group_by field",
7404
+ "items": {
7405
+ "type": "object",
7406
+ "additionalProperties": true
7407
+ }
7408
+ }
7409
+ }
7410
+ },
7411
+ "GetMonitoringTimeSeriesV2Request": {
7412
+ "type": "object",
7413
+ "required": [
7414
+ "from_date",
7415
+ "interval"
7416
+ ],
7417
+ "properties": {
7418
+ "from_date": {
5967
7419
  "type": "string",
5968
7420
  "format": "date-time",
5969
- "description": "When the event was received"
7421
+ "description": "Start of the time range (required)",
7422
+ "example": "2025-01-01T00:00:00Z"
5970
7423
  },
5971
- "completed_at": {
7424
+ "to_date": {
5972
7425
  "type": "string",
5973
7426
  "format": "date-time",
5974
- "description": "When processing completed"
7427
+ "description": "End of the time range (defaults to now)",
7428
+ "example": "2025-01-31T23:59:59Z"
7429
+ },
7430
+ "interval": {
7431
+ "type": "string",
7432
+ "enum": [
7433
+ "5m",
7434
+ "10m",
7435
+ "30m",
7436
+ "1h",
7437
+ "3h",
7438
+ "1d"
7439
+ ],
7440
+ "description": "Time bucket interval"
7441
+ },
7442
+ "use_case_type": {
7443
+ "type": "string",
7444
+ "enum": [
7445
+ "inbound",
7446
+ "outbound",
7447
+ "file_proxy",
7448
+ "managed_call",
7449
+ "secure_proxy"
7450
+ ],
7451
+ "description": "Filter by use case type"
7452
+ }
7453
+ }
7454
+ },
7455
+ "TimeSeriesBucketV2": {
7456
+ "type": "object",
7457
+ "required": [
7458
+ "timestamp",
7459
+ "total_count"
7460
+ ],
7461
+ "properties": {
7462
+ "timestamp": {
7463
+ "type": "string",
7464
+ "format": "date-time",
7465
+ "description": "Bucket start timestamp"
7466
+ },
7467
+ "success_count": {
7468
+ "type": "integer",
7469
+ "description": "Number of successful events in the bucket"
7470
+ },
7471
+ "error_count": {
7472
+ "type": "integer",
7473
+ "description": "Number of error events in the bucket"
7474
+ },
7475
+ "warning_count": {
7476
+ "type": "integer",
7477
+ "description": "Number of warning events in the bucket"
7478
+ },
7479
+ "skipped_count": {
7480
+ "type": "integer",
7481
+ "description": "Number of skipped events in the bucket"
7482
+ },
7483
+ "total_count": {
7484
+ "type": "integer",
7485
+ "description": "Total events in the bucket"
5975
7486
  }
5976
7487
  }
5977
7488
  }
@@ -6007,6 +7518,16 @@
6007
7518
  }
6008
7519
  }
6009
7520
  },
7521
+ "Forbidden": {
7522
+ "description": "Forbidden - insufficient permissions",
7523
+ "content": {
7524
+ "application/json": {
7525
+ "schema": {
7526
+ "$ref": "#/components/schemas/ErrorResponseBase"
7527
+ }
7528
+ }
7529
+ }
7530
+ },
6010
7531
  "InternalServerError": {
6011
7532
  "description": "Internal Server Error",
6012
7533
  "content": {
@@ -6298,6 +7819,117 @@
6298
7819
  }
6299
7820
  }
6300
7821
  }
7822
+ },
7823
+ "QueryMonitoringEventsV2Response": {
7824
+ "description": "Monitoring events queried successfully",
7825
+ "content": {
7826
+ "application/json": {
7827
+ "schema": {
7828
+ "type": "object",
7829
+ "properties": {
7830
+ "data": {
7831
+ "type": "array",
7832
+ "items": {
7833
+ "$ref": "#/components/schemas/MonitoringEventV2"
7834
+ },
7835
+ "description": "List of monitoring events"
7836
+ },
7837
+ "next_cursor": {
7838
+ "type": "object",
7839
+ "nullable": true,
7840
+ "description": "Cursor to fetch the next page. Null if no more results.",
7841
+ "properties": {
7842
+ "created_at": {
7843
+ "type": "string",
7844
+ "format": "date-time"
7845
+ },
7846
+ "id": {
7847
+ "type": "string",
7848
+ "format": "uuid"
7849
+ }
7850
+ }
7851
+ },
7852
+ "has_more": {
7853
+ "type": "boolean",
7854
+ "description": "Indicates if more results are available"
7855
+ }
7856
+ }
7857
+ }
7858
+ }
7859
+ }
7860
+ },
7861
+ "GetMonitoringStatsV2Response": {
7862
+ "description": "Monitoring statistics retrieved successfully",
7863
+ "content": {
7864
+ "application/json": {
7865
+ "schema": {
7866
+ "$ref": "#/components/schemas/MonitoringStatsV2"
7867
+ }
7868
+ }
7869
+ }
7870
+ },
7871
+ "GetMonitoringTimeSeriesV2Response": {
7872
+ "description": "Time-series data retrieved successfully",
7873
+ "content": {
7874
+ "application/json": {
7875
+ "schema": {
7876
+ "type": "object",
7877
+ "properties": {
7878
+ "interval": {
7879
+ "type": "string",
7880
+ "enum": [
7881
+ "5m",
7882
+ "10m",
7883
+ "30m",
7884
+ "1h",
7885
+ "3h",
7886
+ "1d"
7887
+ ],
7888
+ "description": "The bucket interval"
7889
+ },
7890
+ "from_date": {
7891
+ "type": "string",
7892
+ "format": "date-time"
7893
+ },
7894
+ "to_date": {
7895
+ "type": "string",
7896
+ "format": "date-time"
7897
+ },
7898
+ "buckets": {
7899
+ "type": "array",
7900
+ "items": {
7901
+ "$ref": "#/components/schemas/TimeSeriesBucketV2"
7902
+ }
7903
+ }
7904
+ }
7905
+ }
7906
+ }
7907
+ }
7908
+ },
7909
+ "GetAssociatedMonitoringEventsResponse": {
7910
+ "description": "Associated monitoring events for the given event_id",
7911
+ "content": {
7912
+ "application/json": {
7913
+ "schema": {
7914
+ "type": "object",
7915
+ "properties": {
7916
+ "monitoring_events": {
7917
+ "type": "array",
7918
+ "items": {
7919
+ "$ref": "#/components/schemas/MonitoringEventV2"
7920
+ },
7921
+ "description": "All monitoring events sharing this event_id, ordered by created_at ASC"
7922
+ },
7923
+ "inbound_event": {
7924
+ "type": "object",
7925
+ "nullable": true,
7926
+ "additionalProperties": true,
7927
+ "description": "The original inbound event payload from erp_incoming_events, if available"
7928
+ }
7929
+ }
7930
+ }
7931
+ }
7932
+ }
6301
7933
  }
6302
7934
  }
6303
7935
  }