Programmatically create a new OneSignal app via the REST API. This guide explains required fields, supported platform configurations (Web, Android, iOS), and how to properly authenticate using your Organization API key.
Use this API to programmatically create a new OneSignal app. This is useful for automating app setup, particularly when managing multiple apps or organizations, and avoids needing to manually use the OneSignal Dashboard.
You can create an app under an existing organization or generate a new one. Push platform configurations for Web, Android, and iOS can be defined during app creation, though Email and SMS must be set up manually via the OneSignal Dashboard.
For an overview of how apps and organizations work in OneSignal, see Apps & Organizations.
Use your Organization API Key, to authenticate. This key is different from the standard REST API key.
The Organization API key must be assocated with the organization_id
in the request body.
The following three parameters are required for web push setup:
site_name
chrome_web_origin
safari_site_origin
Recommended parameters:
chrome_web_default_notification_icon
: URL of a 256x256px
PNG for Chrome.safari_icon_256_256
: URL of a 256x256px
PNG for Safari.Optional parameters : Use the following parameters if you have your own p12 certificate for Safari Push Notifications. If omitted, we will assign one to your app for you.
safari_apns_p12
: Base64 encoded p12 certificate for Safari Push Notifications.safari_apns_p12_password
: Password for the safari_apns_p12
file if set.If you use your own p12 certificate, you must update it every year.
If you need help Base64 encoding your p12 certificate, you can use the following site: https://www.base64encode.org
The following parameter is required for Android push notifications. See Android: Firebase Credentials.
fcm_v1_service_account_json
If you need help Base64 encoding your FCM Service Account JSON file, you can use the following site: https://www.base64encode.org
iOS mobile push can be configured using either a p8 or a p12 authentication.
If you need to Base64 encode your p8 key or p12 certificate, you can use the following site: https://www.base64encode.org
The following parameters are required if using p8 Token-based connection to APNS:
apns_key_id
apns_team_id
apns_bundle_id
apns_p8
The following parameters are required if using p12 APNS Authentication:
apns_p12
apns_p12_password
Optional parameters :
additional_data_as_root_payload
: If set to true
, the data
paramater in your push notification payload will be added to the root payload of the notification. Helpful for customizations that require access to the data outside of our OSNotification payload additionalData
property.200
The response is of type object
.
Programmatically create a new OneSignal app via the REST API. This guide explains required fields, supported platform configurations (Web, Android, iOS), and how to properly authenticate using your Organization API key.
Use this API to programmatically create a new OneSignal app. This is useful for automating app setup, particularly when managing multiple apps or organizations, and avoids needing to manually use the OneSignal Dashboard.
You can create an app under an existing organization or generate a new one. Push platform configurations for Web, Android, and iOS can be defined during app creation, though Email and SMS must be set up manually via the OneSignal Dashboard.
For an overview of how apps and organizations work in OneSignal, see Apps & Organizations.
Use your Organization API Key, to authenticate. This key is different from the standard REST API key.
The Organization API key must be assocated with the organization_id
in the request body.
The following three parameters are required for web push setup:
site_name
chrome_web_origin
safari_site_origin
Recommended parameters:
chrome_web_default_notification_icon
: URL of a 256x256px
PNG for Chrome.safari_icon_256_256
: URL of a 256x256px
PNG for Safari.Optional parameters : Use the following parameters if you have your own p12 certificate for Safari Push Notifications. If omitted, we will assign one to your app for you.
safari_apns_p12
: Base64 encoded p12 certificate for Safari Push Notifications.safari_apns_p12_password
: Password for the safari_apns_p12
file if set.If you use your own p12 certificate, you must update it every year.
If you need help Base64 encoding your p12 certificate, you can use the following site: https://www.base64encode.org
The following parameter is required for Android push notifications. See Android: Firebase Credentials.
fcm_v1_service_account_json
If you need help Base64 encoding your FCM Service Account JSON file, you can use the following site: https://www.base64encode.org
iOS mobile push can be configured using either a p8 or a p12 authentication.
If you need to Base64 encode your p8 key or p12 certificate, you can use the following site: https://www.base64encode.org
The following parameters are required if using p8 Token-based connection to APNS:
apns_key_id
apns_team_id
apns_bundle_id
apns_p8
The following parameters are required if using p12 APNS Authentication:
apns_p12
apns_p12_password
Optional parameters :
additional_data_as_root_payload
: If set to true
, the data
paramater in your push notification payload will be added to the root payload of the notification. Helpful for customizations that require access to the data outside of our OSNotification payload additionalData
property.200
The response is of type object
.