v1

latestOpenAPI 3.1.02026-07-26497885.9 KB

Create an app

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.

post/apps

Headers

Content-Typestring required
Authorizationstring required

Your Organization API key with prefix Key . See Keys & IDs.

Request body

namestring required

An internal name you set to help organize and track Apps. Maximum 128 characters.

organization_idstring required

The Organization ID that the app will be associated with.

chrome_web_originstring

The HTTPS origin URL for your website. Required for web push notifications.

site_namestring

The name of your website. Used for web push notification titles when omitted from the notification payload. Required for web push notifications.

safari_site_originstring

The HTTPS origin URL for your website. Required for web push notifications for Safari and should be the same as chrome_web_origin.

chrome_web_default_notification_iconstring

The full https URL to your default icon resource. The icon should be a 256x256px PNG.

safari_icon_256_256string

The full https URL to your default icon resource. The icon should be a 256x256px PNG.

safari_apns_p12string

A Base64 encoded p12 certificate for Safari Push Notifications. If omitted, we will assign one to your app for you.

safari_apns_p12_passwordstring

The password for the safari_apns_p12 file if applicable.

fcm_v1_service_account_jsonstring

Your FCM Service Account JSON file converted to base64 format. See Android: Firebase Credentials. Required for Android mobile push notifications.

apns_p8string

A Base64 encoded p8 file for iOS mobile Push Notifications. Omit if using apns_p12. See p8 Token-based connection to APNS.

apns_env'production' | 'development'

The APS Environment Entitlement to specify whether this is a production or development environment. Defaults to production. Use with apns_p8.

apns_key_idstring

The APNS Key ID. Use with apns_p8. See p8 Token-based connection to APNS.

apns_team_idstring

The APNS Team ID. Use with apns_p8. See p8 Token-based connection to APNS.

apns_bundle_idstring

The Bundle ID for your app. Use with apns_p8. See p8 Token-based connection to APNS.

apns_p12string

A Base64 encoded p12 certificate for iOS mobile push notifications. Omit if using apns_p8. See p12 APNS Authentication.

apns_p12_passwordstring

The password for the apns_p12 file if applicable.

additional_data_is_root_payloadboolean

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.

Response

200

idstring

The OneSignal App ID in UUID v4 format.

namestring

An internal name you set to help organize and track Apps. Maximum 128 characters.

playersinteger

The total number of Subscriptions in the app.

messageable_playersinteger

The number of Subscriptions eligible to receive messages in the app.

created_atstring

The date and time the app was created.

updated_atstring

The date and time the app was last updated.

organization_idstring

The Organization ID in which the app was created.