Create an API key (Rich Authentication Token) for a single OneSignal app.

Overview

Use this API to create a new OneSignal app API key (Rich Authentication Token). This is helpful if you need to perform app API operations and don't want to login into the dashboard to generate an API key for it. See Keys & IDs for details.


How to use this API

Using your Organization API key (available in Organizations > Keys & IDs) you can create an app API key (Rich Authentication Token) for the associated OneSignal app.

If you want to set the explicit range of IPs that can use this API key, add them by setting ip_allowlist_mode to explicit and in ip_allowlist add the IPs in CIDRs notation as an array of string values.


Path Params
string
required
Defaults to YOUR_APP_ID

The OneSignal App ID represented as a UUID.

Body Params
string
required
Defaults to API-created-token

The name of your API key (Rich Authentication Token) to be displayed in the OneSignal dashboard and when retrieving the token. Can be updated. Maximum 128 characters.

string
Defaults to disabled

Defaults to disabled, can be set to explicit. If set to explicit, a list of network addresses in the form of CIDRs has to be specified in the ip_allowlist parameter.

ip_allowlist
array of strings

An array of allowed networks in CIDRs notation. Only IPs in those ranges will be permitted to use the API key.

ip_allowlist
Headers
string
required
Defaults to application/json
string
required
Defaults to Key YOUR_ORGANIZATION_API_KEY

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

Responses

Language
Choose an example:
application/json