Use the OneSignal API to create a new Rich Authentication Token (App API Key) for a specific app. This guide explains how to authenticate with the Organization API key and configure optional IP allowlists using CIDR notation.
Documentation Index
Fetch the complete documentation index at: https://documentation.onesignal.com/llms.txt
Use this file to discover all available pages before exploring further.
ip_allowlist_mode parameter to explicit and provide a list of allowed IP addresses in the ip_allowlist parameter.
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.
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
An internal name you set to help organize and track API keys (Rich Authentication Tokens). Maximum 128 characters.
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.
disabled, explicit An array of allowed networks in CIDRs notation. Only IPs in those ranges will be permitted to use the API key.
The newly-created API key token. token_id and formatted_token are populated; formatted_token is the secret and is returned ONCE — store it now or rotate later.
An API Key Token record (Rich Authentication Token). Different operations return different subsets of these fields:
formatted_token.token_id and formatted_token.formatted_token only.formatted_token is the actual REST API Key and is shown ONCE — OneSignal does not store it. Keep it secret.
OneSignal-generated identifier for this API key. NOT the API key itself — use this to manage the key in subsequent calls.
Internal name set when the key was created or last updated. Maximum 128 characters.
When explicit, only requests from IP addresses matching ip_allowlist may use this key. Defaults to disabled.
disabled, explicit Allowed CIDR ranges. Only enforced when ip_allowlist_mode is explicit.
ISO-8601 timestamp when the key was created.
ISO-8601 timestamp when the key was last updated.
The actual Rich Authentication Token (REST API Key). Returned in plaintext ONLY by the create and rotate endpoints, and ONLY immediately after that call. OneSignal does not store the secret — if you lose it, you must rotate the key. See Rotate API Key.