onesignal-rust-api 5.12.0

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
# \DefaultApi

All URIs are relative to *https://api.onesignal.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**cancel_notification**](DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
[**copy_template_to_app**](DefaultApi.md#copy_template_to_app) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app
[**create_alias**](DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | 
[**create_alias_by_subscription**](DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | 
[**create_api_key**](DefaultApi.md#create_api_key) | **POST** /apps/{app_id}/auth/tokens | Create API key
[**create_app**](DefaultApi.md#create_app) | **POST** /apps | Create an app
[**create_custom_events**](DefaultApi.md#create_custom_events) | **POST** /apps/{app_id}/custom_events | Create custom events
[**create_journey**](DefaultApi.md#create_journey) | **POST** /apps/{app_id}/journeys | Create journey
[**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification
[**create_segment**](DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment
[**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | 
[**create_template**](DefaultApi.md#create_template) | **POST** /templates | Create template
[**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | 
[**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | 
[**delete_api_key**](DefaultApi.md#delete_api_key) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key
[**delete_journey**](DefaultApi.md#delete_journey) | **DELETE** /apps/{app_id}/journeys/{journey_id} | Delete journey
[**delete_segment**](DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment
[**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | 
[**delete_template**](DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template
[**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | 
[**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events | Export CSV of Events
[**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions
[**get_aliases**](DefaultApi.md#get_aliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | 
[**get_aliases_by_subscription**](DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | 
[**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app
[**get_apps**](DefaultApi.md#get_apps) | **GET** /apps | View apps
[**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification
[**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History
[**get_notifications**](DefaultApi.md#get_notifications) | **GET** /notifications | View notifications
[**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
[**get_segment**](DefaultApi.md#get_segment) | **GET** /apps/{app_id}/segments/{segment_id} | View Segment
[**get_segments**](DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments
[**get_user**](DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | 
[**list_audit_logs**](DefaultApi.md#list_audit_logs) | **GET** /organizations/{organization_id}/audit_logs | List audit logs
[**rotate_api_key**](DefaultApi.md#rotate_api_key) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key
[**start_live_activity**](DefaultApi.md#start_live_activity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity
[**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | 
[**unsubscribe_email_with_token**](DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token
[**update_api_key**](DefaultApi.md#update_api_key) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key
[**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app
[**update_journey**](DefaultApi.md#update_journey) | **PATCH** /apps/{app_id}/journeys/{journey_id} | Update journey
[**update_journey_node**](DefaultApi.md#update_journey_node) | **PATCH** /apps/{app_id}/journeys/{journey_id}/nodes/{node_id} | Update journey node
[**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
[**update_segment**](DefaultApi.md#update_segment) | **PATCH** /apps/{app_id}/segments/{segment_id} | Update Segment
[**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | 
[**update_subscription_by_token**](DefaultApi.md#update_subscription_by_token) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token
[**update_template**](DefaultApi.md#update_template) | **PATCH** /templates/{template_id} | Update template
[**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | 
[**view_api_keys**](DefaultApi.md#view_api_keys) | **GET** /apps/{app_id}/auth/tokens | View API keys
[**view_journey**](DefaultApi.md#view_journey) | **GET** /apps/{app_id}/journeys/{journey_id} | View journey
[**view_journey_stats**](DefaultApi.md#view_journey_stats) | **GET** /apps/{app_id}/journeys/{journey_id}/stats | View journey stats
[**view_journeys**](DefaultApi.md#view_journeys) | **GET** /apps/{app_id}/journeys | View journeys
[**view_template**](DefaultApi.md#view_template) | **GET** /templates/{template_id} | View template
[**view_templates**](DefaultApi.md#view_templates) | **GET** /templates | View templates


## Common patterns

The per-endpoint examples below illustrate one specific call each. This section covers patterns that apply to most operations.

### Authentication

Every operation requires either a **REST API Key** (App-scoped, used by ~77% of endpoints) or an **Organization API Key** (used by the remaining ~23% — the app-management endpoints `get_apps` / `create_app` / `get_app` / `update_app` / `copy_template_to_app`, plus the API-key administration endpoints `view_api_keys` / `create_api_key` / `delete_api_key` / `update_api_key` / `rotate_api_key`). The two are not interchangeable. The "Authorization" row on each endpoint below lists the exact scheme.

### Idempotency

`POST /notifications` accepts a top-level `idempotency_key` (UUIDv4) that the server uses for request dedup within a **30-day window**. Pass a freshly-generated UUID per logical send so that network-level retries are safe. Never reuse a key across distinct sends — the server returns the original response instead of acting on the new payload. The hero `create_notification` example below demonstrates the call.

Prefer the bundled `helpers::create_notification_with_retry` helper over wiring this up by hand: it generates the key when absent (a caller-provided key is respected), retries 429 / 503 / connect/timeout errors with the **same** key (honoring `Retry-After`, exponential backoff otherwise; `max_retries` / `base_delay` configurable via the options struct), fails fast on other errors, and reports via `was_replayed` whether the server answered from a previously completed request (`Idempotent-Replayed` response header):

```rust
let result = onesignal_rust_api::helpers::create_notification_with_retry(&configuration, &mut notification, None).await?;
println!("{:?} replayed={}", result.response.id, result.was_replayed);
```

### Error handling

When a request fails, the future resolves to `Err(onesignal_rust_api::apis::Error<...>)`. Pattern-match on the `Error::ResponseError(content)` variant to access `content.status` (`reqwest::StatusCode`, the HTTP status code) and `content.content` (`String`, the raw JSON envelope). Other `Error` variants (`Reqwest`, `Serde`, `Io`) indicate transport or deserialization failures and don't carry a response body. Most envelopes match `{ "errors": ["..."] }` (an array of strings) but a few endpoints return `{ "errors": [{"code": ..., "title": ..., "meta": {...}}] }` (an array of structured error objects — used by `POST /apps/{app_id}/users` 409 conflict, see `CreateUserConflictResponse`), `{ "errors": "..." }` (string), or `{ "success": false }` (no `errors` field at all). Robust error-handling code should tolerate all four shapes. The `e.error_messages()` method does this for you, normalizing every shape to a flat `Vec<String>` (empty for non-response errors or a body with no `errors`). To branch on a specific error without hard-coding message strings, test membership against the generated [`OneSignalErrors`](https://github.com/OneSignal/onesignal-rust-api/blob/main/src/errors.rs) catalog — e.g. `e.error_messages().iter().any(|m| m == onesignal_rust_api::errors::NO_TARGETING_SPECIFIED)`.

### Polymorphic 200 from POST /notifications

`CreateNotificationSuccessResponse` has two distinct shapes that share the same schema; branch on `id`:
- **Success** — `id` is a non-empty UUID. `errors`, if present, is an object keyed by recipient-identifier type (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) listing recipients that were skipped (partial-success path).
- **No-send** — `id` is the empty string `""`. `errors` is a string array with the sentinel reason, typically `["All included players are not subscribed"]`.

The hero `create_notification` example below demonstrates the branch pattern explicitly.

### Targeting users by External ID

Set `include_aliases.external_id` to a list of External IDs and set `target_channel` to `push` / `email` / `sms`. The alias label must be the literal string `external_id` — camelCase variants such as `externalId` are silently ignored and yield zero recipients. **Do not confuse** this with the deprecated top-level `external_id` notification field — a separate correlation/idempotency field with its own 30-day dedup keyspace (parallel to `idempotency_key`, not an alias) and no targeting effect.


## cancel_notification

> crate::models::GenericSuccessBoolResponse cancel_notification(app_id, notification_id)
Stop a scheduled or currently outgoing notification

Used to stop a scheduled or currently outgoing notification

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let notification_id: &str = "b3a0c8bd-3a4c-4b22-9a73-3f1a8c2d1b88";

    match default_api::cancel_notification(&configuration, app_id, notification_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("cancel_notification failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("cancel_notification failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**notification_id** | **String** |  | [required] |

### Return type

[**crate::models::GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## copy_template_to_app

> crate::models::TemplateResource copy_template_to_app(template_id, app_id, copy_template_request)
Copy template to another app

Copy a template to a destination app.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let template_id: &str = "e4d3c2b1-a09f-4f1e-8d7c-6b5a4f3e2d1c";
    let app_id: &str = "YOUR_APP_ID";
    let copy_template_request: models::CopyTemplateRequest = todo!();

    match default_api::copy_template_to_app(&configuration, template_id, app_id, copy_template_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("copy_template_to_app failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("copy_template_to_app failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**template_id** | **String** |  | [required] |
**app_id** | **String** |  | [required] |
**copy_template_request** | [**CopyTemplateRequest**](CopyTemplateRequest.md) |  | [required] |

### Return type

[**crate::models::TemplateResource**](TemplateResource.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_alias

> crate::models::UserIdentityBody create_alias(app_id, alias_label, alias_id, user_identity_body)


Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let alias_label: &str = "external_id";
    let alias_id: &str = "YOUR_USER_EXTERNAL_ID";
    let user_identity_body: models::UserIdentityBody = todo!();

    match default_api::create_alias(&configuration, app_id, alias_label, alias_id, user_identity_body).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_alias failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_alias failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**alias_label** | **String** |  | [required] |
**alias_id** | **String** |  | [required] |
**user_identity_body** | [**UserIdentityBody**](UserIdentityBody.md) |  | [required] |

### Return type

[**crate::models::UserIdentityBody**](UserIdentityBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_alias_by_subscription

> crate::models::UserIdentityBody create_alias_by_subscription(app_id, subscription_id, user_identity_body)


Upserts one or more Aliases for the User identified by :subscription_id.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let subscription_id: &str = "7e4c5b9a-1f60-4d07-9b1a-2e8c8d2cae51";
    let user_identity_body: models::UserIdentityBody = todo!();

    match default_api::create_alias_by_subscription(&configuration, app_id, subscription_id, user_identity_body).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_alias_by_subscription failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_alias_by_subscription failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**subscription_id** | **String** |  | [required] |
**user_identity_body** | [**UserIdentityBody**](UserIdentityBody.md) |  | [required] |

### Return type

[**crate::models::UserIdentityBody**](UserIdentityBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_api_key

> crate::models::CreateApiKeyResponse create_api_key(app_id, create_api_key_request)
Create API key

Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let create_api_key_request: models::CreateApiKeyRequest = todo!();

    match default_api::create_api_key(&configuration, app_id, create_api_key_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_api_key failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_api_key failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**create_api_key_request** | [**CreateApiKeyRequest**](CreateApiKeyRequest.md) |  | [required] |

### Return type

[**crate::models::CreateApiKeyResponse**](CreateApiKeyResponse.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_app

> crate::models::App create_app(app)
Create an app

Creates a new OneSignal app

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app: models::App = todo!();

    match default_api::create_app(&configuration, app).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_app failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_app failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app** | [**App**](App.md) |  | [required] |

### Return type

[**crate::models::App**](App.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_custom_events

> serde_json::Value create_custom_events(app_id, custom_events_request)
Create custom events

The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let custom_events_request: models::CustomEventsRequest = todo!();

    match default_api::create_custom_events(&configuration, app_id, custom_events_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_custom_events failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_custom_events failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**custom_events_request** | [**CustomEventsRequest**](CustomEventsRequest.md) |  | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_journey

> crate::models::Journey create_journey(app_id, create_journey_request)
Create journey

The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let create_journey_request: models::CreateJourneyRequest = todo!();

    match default_api::create_journey(&configuration, app_id, create_journey_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_journey failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_journey failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**create_journey_request** | [**CreateJourneyRequest**](CreateJourneyRequest.md) |  | [required] |

### Return type

[**crate::models::Journey**](Journey.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_notification

> crate::models::CreateNotificationSuccessResponse create_notification(notification)
Create notification

Sends notifications to your users.  **Target by External ID (push example):** set `include_aliases` to `{ \"external_id\": [\"your-user-id\"] }` and set `target_channel` to `push` (or `email` / `sms` for those channels). Alias object keys must match API labels exactly (for example `external_id`, not camelCase).  **Do not confuse** the notification-level `external_id` field with External ID targeting: top-level `external_id` / `idempotency_key` are for idempotent notification requests only, not for selecting recipients.  **Targeting compatibility:** `include_aliases` must not be combined with other targeting modes (segments, filters, subscription IDs, legacy player IDs, etc.). Clients should send only one targeting strategy per request. 

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;
use onesignal_rust_api::models::notification::TargetChannelType;
use onesignal_rust_api::models::{LanguageStringMap, Notification};
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());

    let mut notification = Notification::new("YOUR_APP_ID".to_string());
    notification.contents = Some(Box::new(LanguageStringMap {
        en: Some("Hello from OneSignal!".to_string()),
        ..Default::default()
    }));
    notification.headings = Some(Box::new(LanguageStringMap {
        en: Some("Push Notification".to_string()),
        ..Default::default()
    }));
    let mut aliases = std::collections::HashMap::new();
    aliases.insert(
        "external_id".to_string(),
        vec!["YOUR_USER_EXTERNAL_ID".to_string()],
    );
    notification.include_aliases = Some(aliases);
    notification.target_channel = Some(TargetChannelType::Push);
    // Idempotency key: a client-generated UUID that lets you safely retry on network failure.
    // If two requests arrive with the same key inside the 30-day window, only the first is
    // sent and the second returns the original response. The `uuid` crate must be declared
    // in your own Cargo.toml (Cargo doesn't expose transitive crates by name to downstream
    // code) — add `uuid = { version = "1", features = ["v4"] }` to your `[dependencies]`.
    // DO NOT reuse keys across logically distinct sends.
    notification.idempotency_key = Some(Uuid::new_v4().to_string());

    match default_api::create_notification(&configuration, notification).await {
        Ok(resp) => {
            // `resp.id` discriminates the two HTTP 200 shapes. An empty string or `None`
            // means no notification was created (e.g. all targets were unreachable / not
            // subscribed). `resp.errors` is polymorphic (typed as `Option<serde_json::Value>`):
            // a `Vec<String>` in the no-subscribers case, or an object keyed by
            // recipient-identifier type (`invalid_player_ids`, `invalid_external_user_ids`,
            // `invalid_aliases`, ...) when the notification WAS created but some recipients
            // were skipped.
            match resp.id.as_deref() {
                Some("") | None => eprintln!("Notification was not sent: {:?}", resp.errors),
                Some(id) if resp.errors.is_some() => {
                    println!("Notification created: {} (partial failures: {:?})", id, resp.errors)
                }
                Some(id) => println!("Notification created: {}", id),
            }
        }
        Err(onesignal_rust_api::apis::Error::ResponseError(content)) => {
            eprintln!("create_notification failed: HTTP {}", content.status);
            eprintln!("Response Body: {}", content.content);
        }
        Err(e) => eprintln!("create_notification failed: {:?}", e),
    }
}
```

#### Using `helpers::create_notification_with_retry` (preferred for safe, idempotent retries)

The `create_notification_with_retry` helper mirrors `create_notification` but generates the `idempotency_key` for you, transparently retries transient failures (HTTP 429 / 503 / connect/timeout errors) with the **same** key, and reports via `was_replayed` whether the server answered from a previously-completed request.

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::helpers;
use onesignal_rust_api::models::notification::TargetChannelType;
use onesignal_rust_api::models::{LanguageStringMap, Notification};

#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());

    let mut notification = Notification::new("YOUR_APP_ID".to_string());
    notification.contents = Some(Box::new(LanguageStringMap {
        en: Some("Hello from OneSignal!".to_string()),
        ..Default::default()
    }));
    notification.headings = Some(Box::new(LanguageStringMap {
        en: Some("Push Notification".to_string()),
        ..Default::default()
    }));
    let mut aliases = std::collections::HashMap::new();
    aliases.insert(
        "external_id".to_string(),
        vec!["YOUR_USER_EXTERNAL_ID".to_string()],
    );
    notification.include_aliases = Some(aliases);
    notification.target_channel = Some(TargetChannelType::Push);
    // No idempotency_key set: the helper generates a UUIDv4 and reuses it across retries.

    // Pass None for default retry options (3 retries, 1s backoff base), or
    // Some(CreateNotificationWithRetryOptions { .. }) to override.
    match helpers::create_notification_with_retry(&configuration, &mut notification, None).await {
        Ok(result) => {
            if result.was_replayed {
                println!("Server replayed a prior send (no duplicate): {:?}", result.response.id);
            } else {
                println!("Notification created: {:?}", result.response.id);
            }
        }
        Err(e) => eprintln!("create_notification_with_retry failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**notification** | [**Notification**](Notification.md) |  | [required] |

### Return type

[**crate::models::CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_segment

> crate::models::CreateSegmentSuccessResponse create_segment(app_id, segment)
Create Segment

Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. 

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let segment: Option<models::Segment> = None;

    match default_api::create_segment(&configuration, app_id, segment).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_segment failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_segment failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**segment** | Option<[**Segment**](Segment.md)> |  |  |

### Return type

[**crate::models::CreateSegmentSuccessResponse**](CreateSegmentSuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_subscription

> crate::models::SubscriptionBody create_subscription(app_id, alias_label, alias_id, subscription_body)


Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let alias_label: &str = "external_id";
    let alias_id: &str = "YOUR_USER_EXTERNAL_ID";
    let subscription_body: models::SubscriptionBody = todo!();

    match default_api::create_subscription(&configuration, app_id, alias_label, alias_id, subscription_body).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_subscription failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_subscription failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**alias_label** | **String** |  | [required] |
**alias_id** | **String** |  | [required] |
**subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) |  | [required] |

### Return type

[**crate::models::SubscriptionBody**](SubscriptionBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_template

> crate::models::TemplateResource create_template(create_template_request)
Create template

Create reusable message templates for push, email, and SMS channels.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let create_template_request: models::CreateTemplateRequest = todo!();

    match default_api::create_template(&configuration, create_template_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_template failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_template failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**create_template_request** | [**CreateTemplateRequest**](CreateTemplateRequest.md) |  | [required] |

### Return type

[**crate::models::TemplateResource**](TemplateResource.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## create_user

> crate::models::User create_user(app_id, user)


Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let user: models::User = todo!();

    match default_api::create_user(&configuration, app_id, user).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("create_user failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("create_user failed: {:?}", e),
    }
}
```

### Reading the 409 conflict metadata

A `409` from this endpoint carries a `CreateUserConflictResponse` body. The `error_messages()` method flattens each error to its `title`/`code` and omits the structured `meta` object (currently `conflicting_aliases`); deserialize the raw response into the typed model when you need it:

```rust
if let Err(onesignal_rust_api::apis::Error::ResponseError(content)) = result {
    if content.status == reqwest::StatusCode::CONFLICT {
        let conflict: onesignal_rust_api::models::CreateUserConflictResponse =
            serde_json::from_str(&content.content).unwrap();
        for err in conflict.errors.unwrap_or_default() {
            println!("{:?} {:?}", err.title, err.meta.and_then(|m| m.conflicting_aliases));
        }
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**user** | [**User**](User.md) |  | [required] |

### Return type

[**crate::models::User**](User.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## delete_alias

> crate::models::UserIdentityBody delete_alias(app_id, alias_label, alias_id, alias_label_to_delete)


Deletes an alias by alias label

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let alias_label: &str = "external_id";
    let alias_id: &str = "YOUR_USER_EXTERNAL_ID";
    let alias_label_to_delete: &str = "external_id";

    match default_api::delete_alias(&configuration, app_id, alias_label, alias_id, alias_label_to_delete).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("delete_alias failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("delete_alias failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**alias_label** | **String** |  | [required] |
**alias_id** | **String** |  | [required] |
**alias_label_to_delete** | **String** |  | [required] |

### Return type

[**crate::models::UserIdentityBody**](UserIdentityBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## delete_api_key

> serde_json::Value delete_api_key(app_id, token_id)
Delete API key

Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let token_id: &str = "0aa1b2c3-d4e5-46f7-8899-aabbccddeeff";

    match default_api::delete_api_key(&configuration, app_id, token_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("delete_api_key failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("delete_api_key failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**token_id** | **String** |  | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## delete_journey

> crate::models::GenericSuccessBoolResponse delete_journey(app_id, journey_id)
Delete journey

The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let journey_id: &str = "YOUR_JOURNEY_ID";

    match default_api::delete_journey(&configuration, app_id, journey_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("delete_journey failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("delete_journey failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**journey_id** | **String** | UUID of the journey to delete. | [required] |

### Return type

[**crate::models::GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## delete_segment

> crate::models::GenericSuccessBoolResponse delete_segment(app_id, segment_id)
Delete Segment

Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. 

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let segment_id: &str = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e";

    match default_api::delete_segment(&configuration, app_id, segment_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("delete_segment failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("delete_segment failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | [required] |

### Return type

[**crate::models::GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## delete_subscription

> delete_subscription(app_id, subscription_id)


Deletes the Subscription.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let subscription_id: &str = "7e4c5b9a-1f60-4d07-9b1a-2e8c8d2cae51";

    match default_api::delete_subscription(&configuration, app_id, subscription_id).await {
        Ok(_) => println!("delete_subscription succeeded"),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("delete_subscription failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("delete_subscription failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**subscription_id** | **String** |  | [required] |

### Return type

 (empty response body)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## delete_template

> crate::models::GenericSuccessBoolResponse delete_template(template_id, app_id)
Delete template

Delete a template by id.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let template_id: &str = "e4d3c2b1-a09f-4f1e-8d7c-6b5a4f3e2d1c";
    let app_id: &str = "YOUR_APP_ID";

    match default_api::delete_template(&configuration, template_id, app_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("delete_template failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("delete_template failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**template_id** | **String** |  | [required] |
**app_id** | **String** |  | [required] |

### Return type

[**crate::models::GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## delete_user

> delete_user(app_id, alias_label, alias_id)


Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let alias_label: &str = "external_id";
    let alias_id: &str = "YOUR_USER_EXTERNAL_ID";

    match default_api::delete_user(&configuration, app_id, alias_label, alias_id).await {
        Ok(_) => println!("delete_user succeeded"),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("delete_user failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("delete_user failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**alias_label** | **String** |  | [required] |
**alias_id** | **String** |  | [required] |

### Return type

 (empty response body)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## export_events

> crate::models::ExportEventsSuccessResponse export_events(notification_id, app_id)
Export CSV of Events

Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let notification_id: &str = "b3a0c8bd-3a4c-4b22-9a73-3f1a8c2d1b88";
    let app_id: &str = "YOUR_APP_ID";

    match default_api::export_events(&configuration, notification_id, app_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("export_events failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("export_events failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**notification_id** | **String** | The ID of the notification to export events from. | [required] |
**app_id** | **String** | The ID of the app that the notification belongs to. | [required] |

### Return type

[**crate::models::ExportEventsSuccessResponse**](ExportEventsSuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## export_subscriptions

> crate::models::ExportSubscriptionsSuccessResponse export_subscriptions(app_id, export_subscriptions_request_body)
Export CSV of Subscriptions

Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses          You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns:   | Field | Details |   | --- | --- |   | id | OneSignal Player Id |   | identifier | Push Token |   | session_count | Number of times they visited the app or site   | language | Device language code |   | timezone | Number of seconds away from UTC. Example: -28800 |   | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. |   | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 |   | device_type | Device Operating System Type |   | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` |   | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. |   | tags | Current OneSignal Data Tags on the device. |   | last_active | Date and time the user last opened the mobile app or visited the site. |   | playtime | Total amount of time in seconds the user had the mobile app open. |   | amount_spent |  Mobile only - amount spent in USD on In-App Purchases. |    | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. |   | invalid_identifier | t = unsubscribed, f = subscibed |   | badge_count | Current number of badges on the device | - Extra Columns:   | Field | Details |   | --- | --- |   | external_user_id | Your User Id set on the device |   | notification_types | Notification types |   | location | Location points (Latitude and Longitude) set on the device. |   | country | Country code |   | rooted | Android device rooted or not |   | ip | IP Address of the device if being tracked. See Handling Personal Data. |   | web_auth | Web Only authorization key. |   | web_p256 | Web Only p256 key. | 

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let export_subscriptions_request_body: Option<models::ExportSubscriptionsRequestBody> = None;

    match default_api::export_subscriptions(&configuration, app_id, export_subscriptions_request_body).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("export_subscriptions failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("export_subscriptions failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The app ID that you want to export devices from | [required] |
**export_subscriptions_request_body** | Option<[**ExportSubscriptionsRequestBody**](ExportSubscriptionsRequestBody.md)> |  |  |

### Return type

[**crate::models::ExportSubscriptionsSuccessResponse**](ExportSubscriptionsSuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_aliases

> crate::models::UserIdentityBody get_aliases(app_id, alias_label, alias_id)


Lists all Aliases for the User identified by (:alias_label, :alias_id).

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let alias_label: &str = "external_id";
    let alias_id: &str = "YOUR_USER_EXTERNAL_ID";

    match default_api::get_aliases(&configuration, app_id, alias_label, alias_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_aliases failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_aliases failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**alias_label** | **String** |  | [required] |
**alias_id** | **String** |  | [required] |

### Return type

[**crate::models::UserIdentityBody**](UserIdentityBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_aliases_by_subscription

> crate::models::UserIdentityBody get_aliases_by_subscription(app_id, subscription_id)


Lists all Aliases for the User identified by :subscription_id.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let subscription_id: &str = "7e4c5b9a-1f60-4d07-9b1a-2e8c8d2cae51";

    match default_api::get_aliases_by_subscription(&configuration, app_id, subscription_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_aliases_by_subscription failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_aliases_by_subscription failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**subscription_id** | **String** |  | [required] |

### Return type

[**crate::models::UserIdentityBody**](UserIdentityBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_app

> crate::models::App get_app(app_id)
View an app

View the details of a single OneSignal app

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";

    match default_api::get_app(&configuration, app_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_app failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_app failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | An app id | [required] |

### Return type

[**crate::models::App**](App.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_apps

> Vec<crate::models::App> get_apps()
View apps

View the details of all of your current OneSignal apps

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    match default_api::get_apps(&configuration).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_apps failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_apps failed: {:?}", e),
    }
}
```

### Parameters

This endpoint does not need any parameter.

### Return type

[**Vec<crate::models::App>**](App.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_notification

> crate::models::NotificationWithMeta get_notification(app_id, notification_id)
View notification

View the details of a single notification and outcomes associated with it

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let notification_id: &str = "b3a0c8bd-3a4c-4b22-9a73-3f1a8c2d1b88";

    match default_api::get_notification(&configuration, app_id, notification_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_notification failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_notification failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**notification_id** | **String** |  | [required] |

### Return type

[**crate::models::NotificationWithMeta**](NotificationWithMeta.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_notification_history

> crate::models::NotificationHistorySuccessResponse get_notification_history(notification_id, get_notification_history_request_body)
Notification History

-> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let notification_id: &str = "b3a0c8bd-3a4c-4b22-9a73-3f1a8c2d1b88";
    let get_notification_history_request_body: models::GetNotificationHistoryRequestBody = todo!();

    match default_api::get_notification_history(&configuration, notification_id, get_notification_history_request_body).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_notification_history failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_notification_history failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**notification_id** | **String** | The \"id\" of the message found in the Notification object | [required] |
**get_notification_history_request_body** | [**GetNotificationHistoryRequestBody**](GetNotificationHistoryRequestBody.md) |  | [required] |

### Return type

[**crate::models::NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_notifications

> crate::models::NotificationSlice get_notifications(app_id, limit, offset, kind, time_offset)
View notifications

View the details of multiple notifications

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let limit: Option<i32> = None;
    let offset: Option<i32> = None;
    let kind: Option<i32> = None;
    let time_offset: Option<&str> = None;

    match default_api::get_notifications(&configuration, app_id, limit, offset, kind, time_offset).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_notifications failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_notifications failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The app ID that you want to view notifications from | [required] |
**limit** | Option<**i32**> | How many notifications to return.  Max is 50.  Default is 50. |  |
**offset** | Option<**i32**> | Page offset.  Default is 0.  Results are sorted by queued_at in descending order.  queued_at is a representation of the time that the notification was queued at. |  |
**kind** | Option<**i32**> | Kind of notifications returned:   * unset - All notification types (default)   * `0` - Dashboard only   * `1` - API only   * `3` - Automated only  |  |
**time_offset** | Option<**String**> | Time-offset pagination cursor for sequential pulls of all messages.  Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response.  When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used.  Repeat the request with each `next_time_offset` until an empty notifications array is returned. |  |

### Return type

[**crate::models::NotificationSlice**](NotificationSlice.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_outcomes

> crate::models::OutcomesData get_outcomes(app_id, outcome_names, outcome_names2, outcome_time_range, outcome_platforms, outcome_attribution)
View Outcomes

View the details of all the outcomes associated with your app  &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs.  &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. 

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let outcome_names: &str = "os__session_duration.count,os__click.count";
    let outcome_names2: Option<&str> = None;
    let outcome_time_range: Option<&str> = None;
    let outcome_platforms: Option<&str> = None;
    let outcome_attribution: Option<&str> = None;

    match default_api::get_outcomes(&configuration, app_id, outcome_names, outcome_names2, outcome_time_range, outcome_platforms, outcome_attribution).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_outcomes failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_outcomes failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**outcome_names** | **String** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum  | [required] |
**outcome_names2** | Option<**String**> | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name.  |  |
**outcome_time_range** | Option<**String**> | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted.  |  |
**outcome_platforms** | Option<**String**> | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.  |  |
**outcome_attribution** | Option<**String**> | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.  |  |

### Return type

[**crate::models::OutcomesData**](OutcomesData.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_segment

> crate::models::GetSegmentSuccessResponse get_segment(app_id, segment_id, include_segment_detail)
View Segment

Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let segment_id: &str = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e";
    let include_segment_detail: Option<bool> = None;

    match default_api::get_segment(&configuration, app_id, segment_id, include_segment_detail).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_segment failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_segment failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**segment_id** | **String** | The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. | [required] |
**include_segment_detail** | Option<**bool**> | Set to true to include segment metadata and filters in the response. |  |

### Return type

[**crate::models::GetSegmentSuccessResponse**](GetSegmentSuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_segments

> crate::models::GetSegmentsSuccessResponse get_segments(app_id, offset, limit)
Get Segments

Returns an array of segments from an app.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let offset: Option<i32> = None;
    let limit: Option<i32> = None;

    match default_api::get_segments(&configuration, app_id, offset, limit).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_segments failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_segments failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**offset** | Option<**i32**> | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. |  |
**limit** | Option<**i32**> | The amount of Segments in the response. Maximum 300. |  |

### Return type

[**crate::models::GetSegmentsSuccessResponse**](GetSegmentsSuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## get_user

> crate::models::User get_user(app_id, alias_label, alias_id)


Returns the User’s properties, Aliases, and Subscriptions.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let alias_label: &str = "external_id";
    let alias_id: &str = "YOUR_USER_EXTERNAL_ID";

    match default_api::get_user(&configuration, app_id, alias_label, alias_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("get_user failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("get_user failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**alias_label** | **String** |  | [required] |
**alias_id** | **String** |  | [required] |

### Return type

[**crate::models::User**](User.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## list_audit_logs

> crate::models::ListAuditLogsSuccessResponse list_audit_logs(organization_id, start_time, end_time, cursor, limit, app_ids, actions, actor_ids, actor_emails, target_types, target_ids, ip_addresses)
List audit logs

Retrieve a paginated, time-scoped list of audit log events for an organization. Requires an Enterprise plan with the audit logs entitlement enabled.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let organization_id: &str = "YOUR_ORG_ID";
    let start_time: Option<&str> = None;
    let end_time: Option<&str> = None;
    let cursor: Option<&str> = None;
    let limit: Option<i32> = None;
    let app_ids: Option<Vec<String>> = None;
    let actions: Option<Vec<String>> = None;
    let actor_ids: Option<Vec<String>> = None;
    let actor_emails: Option<Vec<String>> = None;
    let target_types: Option<Vec<String>> = None;
    let target_ids: Option<Vec<String>> = None;
    let ip_addresses: Option<Vec<String>> = None;

    match default_api::list_audit_logs(&configuration, organization_id, start_time, end_time, cursor, limit, app_ids, actions, actor_ids, actor_emails, target_types, target_ids, ip_addresses).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("list_audit_logs failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("list_audit_logs failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**organization_id** | **String** | The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. | [required] |
**start_time** | Option<**String**> | Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. |  |
**end_time** | Option<**String**> | End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. |  |
**cursor** | Option<**String**> | Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. |  |
**limit** | Option<**i32**> | Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. |  |
**app_ids** | Option<[**Vec<String>**](String.md)> | Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. |  |
**actions** | Option<[**Vec<String>**](String.md)> | Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. |  |
**actor_ids** | Option<[**Vec<String>**](String.md)> | Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. |  |
**actor_emails** | Option<[**Vec<String>**](String.md)> | Filter by actor email address. Accepts up to 10 values. |  |
**target_types** | Option<[**Vec<String>**](String.md)> | Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. |  |
**target_ids** | Option<[**Vec<String>**](String.md)> | Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. |  |
**ip_addresses** | Option<[**Vec<String>**](String.md)> | Filter by the IP address the action originated from. Accepts up to 10 values. |  |

### Return type

[**crate::models::ListAuditLogsSuccessResponse**](ListAuditLogsSuccessResponse.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## rotate_api_key

> crate::models::CreateApiKeyResponse rotate_api_key(app_id, token_id)
Rotate API key

Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let token_id: &str = "0aa1b2c3-d4e5-46f7-8899-aabbccddeeff";

    match default_api::rotate_api_key(&configuration, app_id, token_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("rotate_api_key failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("rotate_api_key failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**token_id** | **String** |  | [required] |

### Return type

[**crate::models::CreateApiKeyResponse**](CreateApiKeyResponse.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## start_live_activity

> crate::models::StartLiveActivitySuccessResponse start_live_activity(app_id, activity_type, start_live_activity_request)
Start Live Activity

Remotely start a Live Activity on iOS devices via OneSignal’s REST API.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let activity_type: &str = "order_status";
    let start_live_activity_request: models::StartLiveActivityRequest = todo!();

    match default_api::start_live_activity(&configuration, app_id, activity_type, start_live_activity_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("start_live_activity failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("start_live_activity failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**activity_type** | **String** | The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. | [required] |
**start_live_activity_request** | [**StartLiveActivityRequest**](StartLiveActivityRequest.md) |  | [required] |

### Return type

[**crate::models::StartLiveActivitySuccessResponse**](StartLiveActivitySuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## transfer_subscription

> crate::models::UserIdentityBody transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)


Transfers this Subscription to the User identified by the identity in the payload.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let subscription_id: &str = "7e4c5b9a-1f60-4d07-9b1a-2e8c8d2cae51";
    let transfer_subscription_request_body: models::TransferSubscriptionRequestBody = todo!();

    match default_api::transfer_subscription(&configuration, app_id, subscription_id, transfer_subscription_request_body).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("transfer_subscription failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("transfer_subscription failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**subscription_id** | **String** |  | [required] |
**transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) |  | [required] |

### Return type

[**crate::models::UserIdentityBody**](UserIdentityBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## unsubscribe_email_with_token

> crate::models::GenericSuccessBoolResponse unsubscribe_email_with_token(app_id, notification_id, token)
Unsubscribe with token

Unsubscribe an email with a token when using your own custom email unsubscribe landing page

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let notification_id: &str = "b3a0c8bd-3a4c-4b22-9a73-3f1a8c2d1b88";
    let token: &str = "YOUR_TOKEN_ID";

    match default_api::unsubscribe_email_with_token(&configuration, app_id, notification_id, token).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("unsubscribe_email_with_token failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("unsubscribe_email_with_token failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**notification_id** | **String** | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | [required] |
**token** | **String** | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | [required] |

### Return type

[**crate::models::GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_api_key

> serde_json::Value update_api_key(app_id, token_id, update_api_key_request)
Update API key

Update a Rich Authentication Token (App API Key) for a OneSignal app.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let token_id: &str = "0aa1b2c3-d4e5-46f7-8899-aabbccddeeff";
    let update_api_key_request: models::UpdateApiKeyRequest = todo!();

    match default_api::update_api_key(&configuration, app_id, token_id, update_api_key_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_api_key failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_api_key failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**token_id** | **String** |  | [required] |
**update_api_key_request** | [**UpdateApiKeyRequest**](UpdateApiKeyRequest.md) |  | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_app

> crate::models::App update_app(app_id, app)
Update an app

Updates the name or configuration settings of an existing OneSignal app

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let app: models::App = todo!();

    match default_api::update_app(&configuration, app_id, app).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_app failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_app failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | An app id | [required] |
**app** | [**App**](App.md) |  | [required] |

### Return type

[**crate::models::App**](App.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_journey

> crate::models::Journey update_journey(app_id, journey_id, update_journey_request)
Update journey

The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let journey_id: &str = "YOUR_JOURNEY_ID";
    let update_journey_request: models::UpdateJourneyRequest = todo!();

    match default_api::update_journey(&configuration, app_id, journey_id, update_journey_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_journey failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_journey failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**journey_id** | **String** | UUID of the journey to update. | [required] |
**update_journey_request** | [**UpdateJourneyRequest**](UpdateJourneyRequest.md) |  | [required] |

### Return type

[**crate::models::Journey**](Journey.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_journey_node

> crate::models::Journey update_journey_node(app_id, journey_id, node_id, update_journey_node_request)
Update journey node

The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let journey_id: &str = "YOUR_JOURNEY_ID";
    let node_id: &str = "YOUR_NODE_ID";
    let update_journey_node_request: models::UpdateJourneyNodeRequest = todo!();

    match default_api::update_journey_node(&configuration, app_id, journey_id, node_id, update_journey_node_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_journey_node failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_journey_node failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**journey_id** | **String** | UUID of the journey that owns the node. | [required] |
**node_id** | **String** | Server-assigned UUID of the node to update, from a prior View journey fetch. | [required] |
**update_journey_node_request** | [**UpdateJourneyNodeRequest**](UpdateJourneyNodeRequest.md) |  | [required] |

### Return type

[**crate::models::Journey**](Journey.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_live_activity

> crate::models::UpdateLiveActivitySuccessResponse update_live_activity(app_id, activity_id, update_live_activity_request)
Update a Live Activity via Push

Updates a specified live activity.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let activity_id: &str = "12345";
    let update_live_activity_request: models::UpdateLiveActivityRequest = todo!();

    match default_api::update_live_activity(&configuration, app_id, activity_id, update_live_activity_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_live_activity failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_live_activity failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**activity_id** | **String** | Live Activity record ID | [required] |
**update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md) |  | [required] |

### Return type

[**crate::models::UpdateLiveActivitySuccessResponse**](UpdateLiveActivitySuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_segment

> crate::models::UpdateSegmentSuccessResponse update_segment(app_id, segment_id, update_segment_request)
Update Segment

Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let segment_id: &str = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e";
    let update_segment_request: Option<models::UpdateSegmentRequest> = None;

    match default_api::update_segment(&configuration, app_id, segment_id, update_segment_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_segment failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_segment failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | The OneSignal App ID for your app.  Available in Keys & IDs. | [required] |
**segment_id** | **String** | The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. | [required] |
**update_segment_request** | Option<[**UpdateSegmentRequest**](UpdateSegmentRequest.md)> |  |  |

### Return type

[**crate::models::UpdateSegmentSuccessResponse**](UpdateSegmentSuccessResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_subscription

> update_subscription(app_id, subscription_id, subscription_body)


Updates an existing Subscription’s properties.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let subscription_id: &str = "7e4c5b9a-1f60-4d07-9b1a-2e8c8d2cae51";
    let subscription_body: models::SubscriptionBody = todo!();

    match default_api::update_subscription(&configuration, app_id, subscription_id, subscription_body).await {
        Ok(_) => println!("update_subscription succeeded"),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_subscription failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_subscription failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**subscription_id** | **String** |  | [required] |
**subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) |  | [required] |

### Return type

 (empty response body)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_subscription_by_token

> serde_json::Value update_subscription_by_token(app_id, token_type, token, subscription_body)
Update subscription by token

Update properties on an existing OneSignal subscription using its token.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let token_type: &str = "Email";
    let token: &str = "user@example.com";
    let subscription_body: models::SubscriptionBody = todo!();

    match default_api::update_subscription_by_token(&configuration, app_id, token_type, token, subscription_body).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_subscription_by_token failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_subscription_by_token failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**token_type** | **String** | The type of token to use when looking up the subscription. See Subscription Types. | [required] |
**token** | **String** | The value of the token to lookup by (e.g., email address, phone number). | [required] |
**subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) |  | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_template

> crate::models::TemplateResource update_template(template_id, app_id, update_template_request)
Update template

Update an existing template.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let template_id: &str = "e4d3c2b1-a09f-4f1e-8d7c-6b5a4f3e2d1c";
    let app_id: &str = "YOUR_APP_ID";
    let update_template_request: models::UpdateTemplateRequest = todo!();

    match default_api::update_template(&configuration, template_id, app_id, update_template_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_template failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_template failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**template_id** | **String** |  | [required] |
**app_id** | **String** |  | [required] |
**update_template_request** | [**UpdateTemplateRequest**](UpdateTemplateRequest.md) |  | [required] |

### Return type

[**crate::models::TemplateResource**](TemplateResource.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## update_user

> crate::models::PropertiesBody update_user(app_id, alias_label, alias_id, update_user_request)


Updates an existing User’s properties.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;

use onesignal_rust_api::models;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let alias_label: &str = "external_id";
    let alias_id: &str = "YOUR_USER_EXTERNAL_ID";
    let update_user_request: models::UpdateUserRequest = todo!();

    match default_api::update_user(&configuration, app_id, alias_label, alias_id, update_user_request).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("update_user failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("update_user failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |
**alias_label** | **String** |  | [required] |
**alias_id** | **String** |  | [required] |
**update_user_request** | [**UpdateUserRequest**](UpdateUserRequest.md) |  | [required] |

### Return type

[**crate::models::PropertiesBody**](PropertiesBody.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## view_api_keys

> crate::models::ApiKeyTokensListResponse view_api_keys(app_id)
View API keys

View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";

    match default_api::view_api_keys(&configuration, app_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("view_api_keys failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("view_api_keys failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** |  | [required] |

### Return type

[**crate::models::ApiKeyTokensListResponse**](ApiKeyTokensListResponse.md)

### Authorization

[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## view_journey

> crate::models::Journey view_journey(app_id, journey_id)
View journey

The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let journey_id: &str = "YOUR_JOURNEY_ID";

    match default_api::view_journey(&configuration, app_id, journey_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("view_journey failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("view_journey failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**journey_id** | **String** | UUID of the journey to retrieve. | [required] |

### Return type

[**crate::models::Journey**](Journey.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## view_journey_stats

> crate::models::JourneyStats view_journey_stats(app_id, journey_id)
View journey stats

The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let journey_id: &str = "YOUR_JOURNEY_ID";

    match default_api::view_journey_stats(&configuration, app_id, journey_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("view_journey_stats failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("view_journey_stats failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**journey_id** | **String** | UUID of the journey to retrieve stats for. | [required] |

### Return type

[**crate::models::JourneyStats**](JourneyStats.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## view_journeys

> crate::models::JourneyListResponse view_journeys(app_id, cursor, limit)
View journeys

The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let cursor: Option<&str> = None;
    let limit: Option<i32> = None;

    match default_api::view_journeys(&configuration, app_id, cursor, limit).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("view_journeys failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("view_journeys failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**cursor** | Option<**String**> | Opaque pagination token from a previous response's next_cursor. Omit for the first page. |  |
**limit** | Option<**i32**> | Maximum journeys to return per page. Minimum 1, maximum 50. |  |[default to 50]

### Return type

[**crate::models::JourneyListResponse**](JourneyListResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## view_template

> crate::models::TemplateResource view_template(template_id, app_id)
View template

Fetch a single template by id.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let template_id: &str = "e4d3c2b1-a09f-4f1e-8d7c-6b5a4f3e2d1c";
    let app_id: &str = "YOUR_APP_ID";

    match default_api::view_template(&configuration, template_id, app_id).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("view_template failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("view_template failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**template_id** | **String** |  | [required] |
**app_id** | **String** |  | [required] |

### Return type

[**crate::models::TemplateResource**](TemplateResource.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)


## view_templates

> crate::models::TemplatesListResponse view_templates(app_id, limit, offset, channel)
View templates

List templates for an app.

### Example

```rust
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;


#[tokio::main]
async fn main() {
    let mut configuration = Configuration::new();
    configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());


    // Realistic values are pulled from the spec's `example:` fields where present.
    let app_id: &str = "YOUR_APP_ID";
    let limit: Option<i32> = None;
    let offset: Option<i32> = None;
    let channel: Option<&str> = None;

    match default_api::view_templates(&configuration, app_id, limit, offset, channel).await {
        Ok(resp) => println!("{:?}", resp),
        Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
            // `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
            // the raw response remains on the ResponseError variant.
            eprintln!("view_templates failed: {:?}", e.error_messages());
        }
        Err(e) => eprintln!("view_templates failed: {:?}", e),
    }
}
```

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**app_id** | **String** | Your OneSignal App ID in UUID v4 format. | [required] |
**limit** | Option<**i32**> | Maximum number of templates. Default and max is 50. |  |[default to 50]
**offset** | Option<**i32**> | Pagination offset. |  |[default to 0]
**channel** | Option<**String**> | Filter by delivery channel. |  |

### Return type

[**crate::models::TemplatesListResponse**](TemplatesListResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api)