-
Notifications
You must be signed in to change notification settings - Fork 3
/
api.json
4888 lines (4888 loc) · 172 KB
/
api.json
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
{
"openapi": "3.0.0",
"info": {
"version": "1.2.2",
"title": "OneSignal",
"description": "A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com",
"contact": {
"name": "OneSignal DevRel",
"email": "[email protected]",
"url": "https://onesignal.com"
},
"termsOfService": "https://onesignal.com/tos"
},
"servers": [
{
"url": "https://onesignal.com/api/v1"
}
],
"components": {
"securitySchemes": {
"app_key": {
"type": "http",
"scheme": "bearer"
},
"user_key": {
"type": "http",
"scheme": "bearer"
}
},
"schemas": {
"App": {
"type": "object",
"properties": {
"id": {
"type": "string",
"readOnly": true
},
"name": {
"type": "string",
"description": "The name of your app, as displayed on your apps list on the dashboard. This can be renamed."
},
"players": {
"type": "integer",
"readOnly": true
},
"messageable_players": {
"type": "integer",
"readOnly": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"created_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"android_gcm_sender_id": {
"type": "string",
"description": "Android: Your Google Project number. Also known as Sender ID.",
"writeOnly": true
},
"gcm_key": {
"type": "string",
"description": "Android: Your Google Push Messaging Auth Key",
"nullable": true
},
"chrome_web_origin": {
"type": "string",
"description": "Chrome (All Browsers except Safari) (Recommended): The URL to your website. This field is required if you wish to enable web push and specify other web push parameters.",
"nullable": true
},
"chrome_key": {
"type": "string",
"description": "Not for web push. Your Google Push Messaging Auth Key if you use Chrome Apps / Extensions.",
"nullable": true
},
"chrome_web_default_notification_icon": {
"type": "string",
"description": "Chrome (All Browsers except Safari): Your default notification icon. Should be 256x256 pixels, min 80x80.",
"nullable": true
},
"chrome_web_sub_domain": {
"type": "string",
"description": "Chrome (All Browsers except Safari): A subdomain of your choice in order to support Web Push on non-HTTPS websites. This field must be set in order for the chrome_web_gcm_sender_id property to be processed.",
"nullable": true
},
"apns_env": {
"type": "string",
"enum": [
"sandbox",
"production"
],
"description": "iOS: Either sandbox or production",
"nullable": true
},
"apns_p12": {
"type": "string",
"description": "iOS: Your apple push notification p12 certificate file, converted to a string and Base64 encoded.",
"writeOnly": true
},
"apns_p12_password": {
"type": "string",
"description": "iOS: Required if using p12 certificate. Password for the apns_p12 file.",
"writeOnly": true
},
"apns_certificates": {
"type": "string",
"readOnly": true,
"nullable": true
},
"safari_apns_certificates": {
"type": "string",
"readOnly": true
},
"safari_apns_p12": {
"type": "string",
"description": "Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded.",
"writeOnly": true
},
"safari_apns_p12_password": {
"type": "string",
"description": "Safari: Password for safari_apns_p12 file",
"writeOnly": true
},
"apns_key_id": {
"type": "string",
"description": "iOS: Required if using p8. Unique identifier for the p8 authentication key.",
"nullable": true
},
"apns_team_id": {
"type": "string",
"description": "iOS: Required if using p8. Team ID generated by Apple for your developer account.",
"nullable": true
},
"apns_bundle_id": {
"type": "string",
"description": "iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem.",
"nullable": true
},
"apns_p8": {
"type": "string",
"description": "iOS: Required if using p8. Base64 encoded p8 key",
"nullable": true
},
"safari_site_origin": {
"type": "string",
"description": "Safari (Recommended): The hostname to your website including http(s)://",
"nullable": true
},
"safari_push_id": {
"type": "string",
"readOnly": true,
"nullable": true
},
"safari_icon_16_16": {
"type": "string",
"readOnly": true
},
"safari_icon_32_32": {
"type": "string",
"readOnly": true
},
"safari_icon_64_64": {
"type": "string",
"readOnly": true
},
"safari_icon_128_128": {
"type": "string",
"readOnly": true
},
"safari_icon_256_256": {
"type": "string",
"description": "Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide."
},
"site_name": {
"type": "string",
"description": "All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it.",
"nullable": true
},
"basic_auth_key": {
"type": "string",
"readOnly": true,
"nullable": true
},
"organization_id": {
"type": "string",
"description": "The Id of the Organization you would like to add this app to.",
"writeOnly": true
},
"additional_data_is_root_payload": {
"type": "boolean",
"description": "iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload.",
"writeOnly": true
}
}
},
"Apps": {
"type": "array",
"items": {
"$ref": "#/components/schemas/App"
}
},
"SegmentNotificationTarget": {
"type": "object",
"properties": {
"included_segments": {
"type": "array",
"description": "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments.\nExample: [\"Active Users\", \"Inactive Users\"]\n",
"items": {
"type": "string"
}
},
"excluded_segments": {
"type": "array",
"description": "Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments.\nExample: [\"Active Users\", \"Inactive Users\"]\n",
"items": {
"type": "string"
}
}
}
},
"PlayerNotificationTarget": {
"type": "object",
"properties": {
"include_player_ids": {
"type": "array",
"description": "Specific playerids to send your notification to. _Does not require API Auth Key.\nDo not combine with other targeting parameters. Not compatible with any other targeting parameters.\nExample: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"]\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
},
"nullable": true,
"deprecated": true
},
"include_external_user_ids": {
"type": "array",
"description": "Target specific devices by custom user IDs assigned via API.\nNot compatible with any other targeting parameters\nExample: [\"custom-id-assigned-by-api\"]\nREQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST API call.\nNote: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms.\n",
"items": {
"type": "string"
},
"nullable": true,
"deprecated": true
},
"include_email_tokens": {
"type": "array",
"description": "Recommended for Sending Emails - Target specific email addresses.\nIf an email does not correspond to an existing user, a new user will be created.\nExample: [email protected]\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_phone_numbers": {
"type": "array",
"description": "Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal.\nExample phone number: +1999999999\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_ios_tokens": {
"type": "array",
"description": "Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.\nTarget using iOS device tokens.\nWarning: Only works with Production tokens.\nAll non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created.\nExample: ce777617da7f548fe7a9ab6febb56cf39fba6d38203...\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_wp_wns_uris": {
"type": "array",
"description": "Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.\nTarget using Windows URIs. If a token does not correspond to an existing user, a new user will be created.\nExample: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-...\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_amazon_reg_ids": {
"type": "array",
"description": "Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.\nTarget using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created.\nExample: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV...\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_chrome_reg_ids": {
"type": "array",
"description": "Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.\nTarget using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_chrome_web_reg_ids": {
"type": "array",
"description": "Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.\nTarget using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_android_reg_ids": {
"type": "array",
"description": "Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.\nTarget using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\nLimit of 2,000 entries per REST API call\n",
"items": {
"type": "string"
}
},
"include_aliases": {
"type": "object",
"properties": {
"alias_label": {
"type": "array",
"items": {
"type": "string"
}
}
},
"nullable": true
},
"target_channel": {
"type": "string",
"enum": ["push", "email", "sms"]
}
}
},
"NotificationTarget": {
"anyOf": [
{
"$ref": "#/components/schemas/SegmentNotificationTarget"
},
{
"$ref": "#/components/schemas/PlayerNotificationTarget"
}
]
},
"BasicNotification": {
"allOf": [
{
"$ref": "#/components/schemas/NotificationTarget"
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "integer",
"readOnly": true
},
"name": {
"type": "string",
"description": "Required for SMS Messages.\nAn identifier for tracking message within the OneSignal dashboard or export analytics.\nNot shown to end user.",
"writeOnly": true,
"nullable": true
},
"aggregation": {
"type": "string",
"enum": [
"sum",
"count"
],
"readOnly": true
},
"isIos": {
"type": "boolean",
"description": "Indicates whether to send to all devices registered under your app's Apple iOS platform.",
"writeOnly": true,
"nullable": true
},
"isAndroid": {
"type": "boolean",
"description": "Indicates whether to send to all devices registered under your app's Google Android platform.",
"writeOnly": true,
"nullable": true
},
"isHuawei": {
"type": "boolean",
"description": "Indicates whether to send to all devices registered under your app's Huawei Android platform.",
"writeOnly": true,
"nullable": true
},
"isAnyWeb": {
"type": "boolean",
"description": "Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari.\nYou may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one.\n",
"writeOnly": true,
"nullable": true
},
"isChromeWeb": {
"type": "boolean",
"writeOnly": true,
"nullable": true,
"description": "Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform."
},
"isFirefox": {
"type": "boolean",
"writeOnly": true,
"nullable": true,
"description": "Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform."
},
"isSafari": {
"type": "boolean",
"writeOnly": true,
"nullable": true,
"description": "Does not support iOS Safari. Indicates whether to send to all Apple's Safari desktop users registered under your Safari web push platform. Read more iOS Safari"
},
"isWP_WNS": {
"type": "boolean",
"writeOnly": true,
"nullable": true,
"description": "Indicates whether to send to all devices registered under your app's Windows platform."
},
"isAdm": {
"type": "boolean",
"writeOnly": true,
"nullable": true,
"description": "Indicates whether to send to all devices registered under your app's Amazon Fire platform."
},
"isChrome": {
"type": "boolean",
"writeOnly": true,
"nullable": true,
"description": "This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions.\nIndicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform.\n"
},
"channel_for_external_user_ids": {
"type": "string",
"writeOnly": true,
"description": "Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id.\nExample: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS.\n"
},
"app_id": {
"type": "string",
"description": "Required: Your OneSignal Application ID, which can be found in Keys & IDs.\nIt is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434.\n",
"writeOnly": true
},
"external_id": {
"type": "string",
"description": "Correlation and idempotency key.\nA request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here.\nThis key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again.\n See Idempotent Notification Requests for more details\nwriteOnly: true\n",
"nullable": true
},
"contents": {
"allOf": [
{
"$ref": "#/components/schemas/StringMap"
},
{
"description": "Required unless content_available=true or template_id is set.\nThe message's content (excluding the title), a map of language codes to text for each language.\nEach hash must have a language code string for a key, mapped to the localized text you would like users to receive for that language.\nThis field supports inline substitutions.\nEnglish must be included in the hash.\nExample: {\"en\": \"English Message\", \"es\": \"Spanish Message\"}\n",
"writeOnly": true
}
]
},
"headings": {
"allOf": [
{
"$ref": "#/components/schemas/StringMap"
},
{
"description": "The message's title, a map of language codes to text for each language. Each hash must have a language code string for a key, mapped to the localized text you would like users to receive for that language.\nThis field supports inline substitutions.\nExample: {\"en\": \"English Title\", \"es\": \"Spanish Title\"}\n",
"writeOnly": true
}
]
},
"subtitle": {
"allOf": [
{
"$ref": "#/components/schemas/StringMap"
},
{
"description": "The message's subtitle, a map of language codes to text for each language. Each hash must have a language code string for a key, mapped to the localized text you would like users to receive for that language.\nThis field supports inline substitutions.\nExample: {\"en\": \"English Subtitle\", \"es\": \"Spanish Subtitle\"}\n",
"writeOnly": true
}
]
},
"data": {
"type": "object",
"description": "Channel: Push Notifications\nPlatform: Huawei\nA custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data.\nExample: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1}\n",
"writeOnly": true,
"nullable": true
},
"huawei_msg_type": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\nUse \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications.\n",
"writeOnly": true,
"nullable": true
},
"url": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: All\nThe URL to open in the browser when a user clicks on the notification.\nNote: iOS needs https or updated NSAppTransportSecurity in plist\nThis field supports inline substitutions.\nOmit if including web_url or app_url\nExample: https://onesignal.com\n",
"writeOnly": true,
"nullable": true
},
"web_url": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: All Browsers\nSame as url but only sent to web push platforms.\nIncluding Chrome, Firefox, Safari, Opera, etc.\nExample: https://onesignal.com\n",
"writeOnly": true,
"nullable": true
},
"app_url": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: All Browsers\nSame as url but only sent to web push platforms.\nIncluding iOS, Android, macOS, Windows, ChromeApps, etc.\nExample: https://onesignal.com\n",
"writeOnly": true,
"nullable": true
},
"ios_attachments": {
"type": "object",
"description": "Channel: Push Notifications\nPlatform: iOS 10+\nAdds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view.\nDo not set mutable_content to download attachments. The OneSignal SDK does this automatically\nExample: {\"id1\": \"https://domain.com/image.jpg\"}\n",
"writeOnly": true,
"nullable": true
},
"template_id": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: All\nUse a template you setup on our dashboard. The template_id is the UUID found in the URL when viewing a template on our dashboard.\nExample: be4a8044-bbd6-11e4-a581-000c2940e62c\n",
"writeOnly": true,
"nullable": true
},
"content_available": {
"type": "boolean",
"description": "Channel: Push Notifications\nPlatform: iOS\nSending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the \"force-quit\" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification.\n",
"writeOnly": true,
"nullable": true
},
"mutable_content": {
"type": "boolean",
"description": "Channel: Push Notifications\nPlatform: iOS 10+\nAlways defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension.\n",
"writeOnly": true
},
"target_content_identifier": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS 13+\nUse to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App.\n",
"writeOnly": true,
"nullable": true
},
"big_picture": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nPicture to display in the expanded view. Can be a drawable resource name or a URL.\n",
"writeOnly": true,
"nullable": true
},
"huawei_big_picture": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\nPicture to display in the expanded view. Can be a drawable resource name or a URL.\n",
"writeOnly": true,
"nullable": true
},
"adm_big_picture": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Amazon\nPicture to display in the expanded view. Can be a drawable resource name or a URL.\n",
"writeOnly": true,
"nullable": true
},
"chrome_big_picture": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: ChromeApp\nLarge picture to display below the notification text. Must be a local URL.\n",
"writeOnly": true,
"nullable": true
},
"chrome_web_image": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Chrome 56+\nSets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons.\n",
"writeOnly": true,
"nullable": true
},
"buttons": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Button"
},
"description": "Channel: Push Notifications\nPlatform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android.\nButtons show in reverse order of array position i.e. Last item in array shows as first button on device.\nExample: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}]\n",
"writeOnly": true,
"nullable": true
},
"web_buttons": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Button"
},
"description": "Channel: Push Notifications\nPlatform: Chrome 48+\nAdd action buttons to the notification. The id field is required.\nExample: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}]\n",
"writeOnly": true,
"nullable": true
},
"ios_category": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS\nCategory APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code.\nExample: calendar category which contains actions like accept and decline\niOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category.\n",
"writeOnly": true,
"nullable": true
},
"android_channel_id": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nThe Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id.\n",
"writeOnly": true
},
"huawei_channel_id": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\nThe Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id.\n",
"writeOnly": true,
"nullable": true
},
"existing_android_channel_id": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nUse this if you have client side Android Oreo Channels you have already defined in your app with code.\n",
"writeOnly": true
},
"huawei_existing_channel_id": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\nUse this if you have client side Android Oreo Channels you have already defined in your app with code.\n",
"writeOnly": true,
"nullable": true
},
"android_background_layout": {
"type": "object",
"description": "Channel: Push Notifications\nPlatform: Android\nAllowing setting a background image for the notification. This is a JSON object containing the following keys. See our Background Image documentation for image sizes.\n",
"properties": {
"image": {
"type": "string",
"description": "Asset file, android resource name, or URL to remote image."
},
"headings_color": {
"type": "string",
"description": "Title text color ARGB Hex format. Example(Blue) \"FF0000FF\"."
},
"contents_color": {
"type": "string",
"description": "Body text color ARGB Hex format. Example(Red) \"FFFF0000\"."
}
},
"writeOnly": true
},
"small_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nIcon shown in the status bar and on the top left of the notification.\nIf not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name.\nSee: How to create small icons\n",
"writeOnly": true,
"nullable": true
},
"huawei_small_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\nIcon shown in the status bar and on the top left of the notification.\nUse an Android resource path (E.g. /drawable/small_icon).\nDefaults to your app icon if not set.\n",
"writeOnly": true,
"nullable": true
},
"large_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nCan be a drawable resource name or a URL.\nSee: How to create large icons\n",
"writeOnly": true,
"nullable": true
},
"huawei_large_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\nCan be a drawable resource name or a URL.\nSee: How to create large icons\n",
"writeOnly": true,
"nullable": true
},
"adm_small_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Amazon\nIf not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name.\nSee: How to create small icons\n",
"writeOnly": true,
"nullable": true
},
"adm_large_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Amazon\nIf blank the small_icon is used. Can be a drawable resource name or a URL.\nSee: How to create large icons\n",
"writeOnly": true,
"nullable": true
},
"chrome_web_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Chrome\nSets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefox_icon.\n",
"nullable": true
},
"chrome_web_badge": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Chrome\nSets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge.\n",
"writeOnly": true,
"nullable": true
},
"firefox_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Firefox\nNot recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use.\nSets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices.\n",
"writeOnly": true,
"nullable": true
},
"chrome_icon": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: ChromeApp\nThis flag is not used for web push For web push, please see chrome_web_icon instead.\nThe local URL to an icon to use. If blank, the app icon will be used.\n",
"writeOnly": true,
"nullable": true
},
"ios_sound": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS\nSound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification.\nExample: \"notification.wav\"\n",
"writeOnly": true,
"nullable": true
},
"android_sound": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\n⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease use Notification Categories / Channels noted above instead to support ALL versions of Android.\nSound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification.\nNOTE: Leave off file extension for Android.\nExample: \"notification\"\n",
"writeOnly": true,
"nullable": true
},
"huawei_sound": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\n⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices.\nPlease also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices.\nSound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path.\n\nExample: \"/res/raw/notification\"\n",
"writeOnly": true,
"nullable": true
},
"adm_sound": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Amazon\n⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease use Notification Categories / Channels noted above instead to support ALL versions of Android.\nSound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification.\nNOTE: Leave off file extension for Android.\nExample: \"notification\"\n",
"writeOnly": true,
"nullable": true
},
"wp_wns_sound": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Windows\nSound file that is included in your app to play instead of the default device notification sound.\nExample: \"notification.wav\"\n",
"writeOnly": true,
"nullable": true
},
"android_led_color": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\n⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease use Notification Categories / Channels noted above instead to support ALL versions of Android.\nSets the devices LED notification light if the device has one. ARGB Hex format.\nExample(Blue): \"FF0000FF\"\n",
"writeOnly": true,
"nullable": true
},
"huawei_led_color": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\n⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices.\nPlease also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices.\nSets the devices LED notification light if the device has one. RGB Hex format.\nExample(Blue): \"0000FF\"\n",
"writeOnly": true,
"nullable": true
},
"android_accent_color": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nSets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices.\nExample(Red): \"FFFF0000\"\n",
"writeOnly": true,
"nullable": true
},
"huawei_accent_color": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Huawei\nAccent Color used on Action Buttons and Group overflow count.\nUses RGB Hex value (E.g. #9900FF).\nDefaults to device's theme color if not set.\n",
"writeOnly": true,
"nullable": true
},
"android_visibility": {
"type": "integer",
"description": "Channel: Push Notifications\nPlatform: Android 5.0_\n⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease use Notification Categories / Channels noted above instead to support ALL versions of Android.\n1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.)\n0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings)\n-1 = Secret (Notification does not show on the lock screen at all)\n",
"writeOnly": true,
"nullable": true
},
"huawei_visibility": {
"type": "integer",
"nullable": true,
"description": "Channel: Push Notifications\nPlatform: Huawei\n⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices.\nPlease also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices.\n1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.)\n0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings)\n-1 = Secret (Notification does not show on the lock screen at all)\n",
"writeOnly": true
},
"ios_badgeType": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS\nDescribes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase.\n`None` leaves the count unaffected.\n`SetTo` directly sets the badge count to the number specified in ios_badgeCount.\n`Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count.\n",
"writeOnly": true,
"nullable": true
},
"ios_badgeCount": {
"type": "integer",
"nullable": true,
"description": "Channel: Push Notifications\nPlatform: iOS\nUsed with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by.\nYou can use a negative number to decrease the badge count when used with an ios_badgeType of Increase.\n",
"writeOnly": true
},
"collapse_id": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS 10+, Android\nOnly one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters.\n",
"writeOnly": true
},
"web_push_topic": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: All Browsers\nDisplay multiple notifications at once with different topics.\n",
"nullable": true
},
"apns_alert": {
"type": "object",
"description": "Channel: Push Notifications\nPlatform: iOS 10+\niOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more.\n",
"writeOnly": true,
"nullable": true
},
"delayed_option": {
"type": "string",
"description": "Channel: All\nPossible values are:\ntimezone (Deliver at a specific time-of-day in each users own timezone)\nlast-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app).\nIf send_after is used, this takes effect after the send_after time has elapsed.\n",
"writeOnly": true,
"nullable": true
},
"delivery_time_of_day": {
"type": "string",
"description": "Channel: All\nUse with delayed_option=timezone.\nExamples: \"9:00AM\"\n\"21:45\"\n\"9:45:30\"\n",
"writeOnly": true,
"nullable": true
},
"ttl": {
"type": "integer",
"nullable": true,
"description": "Channel: Push Notifications\nPlatform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb\nTime To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days).\nMax value to set is 2419200 seconds (28 days).\n",
"writeOnly": true
},
"priority": {
"type": "integer",
"nullable": true,
"description": "Channel: Push Notifications\nPlatform: Android, Chrome, ChromeWeb\nDelivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode.\n",
"writeOnly": true
},
"apns_push_type_override": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS\nvalid values: voip\nSet the value to voip for sending VoIP Notifications\nThis field maps to the APNS header apns-push-type.\nNote: alert and background are automatically set by OneSignal\n",
"writeOnly": true
},
"throttle_rate_per_minute": {
"type": "string",
"description": "Channel: All\nApps with throttling enabled:\n - the parameter value will be used to override the default application throttling value set from the dashboard settings.\n - parameter value 0 indicates not to apply throttling to the notification.\n - if the parameter is not passed then the default app throttling value will be applied to the notification.\nApps with throttling disabled:\n - this parameter can be used to throttle delivery for the notification even though throttling is not enabled at the application level.\nRefer to throttling for more details.\n",
"writeOnly": true,
"nullable": true
},
"android_group": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nNotifications with the same group will be stacked together using Android's Notification Grouping feature.\n",
"writeOnly": true,
"nullable": true
},
"android_group_message": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Android\nNote: This only works for Android 6 and older. Android 7+ allows full expansion of all message.\nSummary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number.\nLanguages - The value of each key is the message that will be sent to users for that language. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages.\nExample: {\"en\": \"You have $[notif_count] new messages\"}\n",
"writeOnly": true,
"nullable": true
},
"adm_group": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: Amazon\nNotifications with the same group will be stacked together using Android's Notification Grouping feature.\n",
"writeOnly": true,
"nullable": true
},
"adm_group_message": {
"type": "object",
"description": "Channel: Push Notifications\nPlatform: Amazon\nSummary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language.\nExample: {\"en\": \"You have $[notif_count] new messages\"}\n",
"writeOnly": true,
"nullable": true
},
"thread_id": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS 12+\nThis parameter is supported in iOS 12 and above. It allows you to group related notifications together.\nIf two notifications have the same thread-id, they will both be added to the same group.\n",
"writeOnly": true,
"nullable": true
},
"summary_arg": {
"type": "string",
"description": "Channel: Push Notifications\nPlatform: iOS 12+\nWhen using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\".\nThe summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\"\n",
"writeOnly": true
},
"summary_arg_count": {
"type": "integer",
"description": "Channel: Push Notifications\nPlatform: iOS 12+\nWhen using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\"\n",
"writeOnly": true
},
"email_subject": {
"type": "string",
"description": "Channel: Email\nRequired. The subject of the email.\n",
"writeOnly": true,
"nullable": true
},
"email_body": {
"type": "string",
"description": "Channel: Email\nRequired unless template_id is set.\nHTML suported\nThe body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email.\nNote: any malformed HTML content will be sent to users. Please double-check your HTML is valid.\n",
"writeOnly": true
},
"email_from_name": {
"type": "string",
"description": "Channel: Email\nThe name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings.\n",
"writeOnly": true,
"nullable": true
},
"email_from_address": {
"type": "string",
"description": "Channel: Email\nThe email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings.\n",
"writeOnly": true,
"nullable": true
},
"email_preheader": {
"type": "string",
"description": "Channel: Email\nThe preheader text of the email.\nPreheader is the preview text displayed immediately after an email subject that provides additional context about the email content.\nIf not specified, will default to null.\n",
"writeOnly": true,
"nullable": true
},
"include_unsubscribed": {
"type": "boolean",
"description": "Channel: Email\nDefault is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared.",
"writeOnly": true
},
"sms_from": {
"type": "string",
"description": "Channel: SMS\nPhone Number used to send SMS. Should be a registered Twilio phone number in E.164 format.\n",
"writeOnly": true,
"nullable": true
},
"sms_media_urls": {
"type": "array",
"items": {
"type": "string"
},
"description": "Channel: SMS\nURLs for the media files to be attached to the SMS content.\nLimit: 10 media urls with a total max. size of 5MBs.\n",
"writeOnly": true,
"nullable": true
},
"filters": {
"type": "array",
"nullable": true,
"items": {
"$ref": "#/components/schemas/Filter"
}
},
"custom_data": {
"type": "object",
"description": "Channel: All\nJSON object that can be used as a source of message personalization data for fields that support tag variable substitution.\nPush, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON.\nExample: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25}\n",
"writeOnly": true,
"nullable": true
}
}
},
{
"required": [
"app_id"
]
}
]
},
"Notification": {
"allOf": [
{
"$ref": "#/components/schemas/BasicNotification"
},
{
"type": "object",
"properties": {
"send_after": {
"type": "string",
"format": "date-time",
"description": "Channel: All\nSchedule notification for future delivery. API defaults to UTC -1100\nExamples: All examples are the exact same date & time.\n\"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\"\n\"September 24th 2015, 2:00:00 pm UTC-07:00\"\n\"2015-09-24 14:00:00 GMT-0700\"\n\"Sept 24 2015 14:00:00 GMT-0700\"\n\"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\"\nNote: SMS currently only supports send_after parameter.\n",
"writeOnly": true,
"nullable": true
}
}
}
]
},
"NotificationWithMeta": {
"allOf": [
{
"$ref": "#/components/schemas/BasicNotification"
},
{
"$ref": "#/components/schemas/DeliveryData"
},
{
"$ref": "#/components/schemas/OutcomesData"
},
{
"type": "object",
"properties": {
"remaining": {
"type": "integer",
"description": "Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set."
},
"successful": {
"type": "integer",
"description": "Number of notifications that were successfully delivered."
},
"failed": {
"type": "integer",
"description": "Number of notifications that could not be delivered due to those devices being unsubscribed."
},
"errored": {
"type": "integer",
"description": "Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard."
},
"converted": {
"type": "integer",
"description": "Number of users who have clicked / tapped on your notification."
},
"queued_at": {
"type": "integer",
"format": "int64",
"description": "Unix timestamp indicating when the notification was created."
},
"send_after": {
"type": "integer",
"format": "int64",
"description": "Unix timestamp indicating when notification delivery should begin.",
"nullable": true
},
"completed_at": {
"type": "integer",
"format": "int64",
"nullable": true,
"description": "Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after."
},
"platform_delivery_stats": {
"$ref": "#/components/schemas/PlatformDeliveryData"
},
"received": {
"type": "integer",
"nullable": true,
"description": "Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0."
},
"throttle_rate_per_minute": {
"type": "integer",
"nullable": true,