v1

latestOpenAPI 3.1.02026-07-26497885.9 KB

Update API key

Update a Rich Authentication Token (App API Key) for a OneSignal app. Modify the token's name or IP allowlist settings using your Organization API Key.

patch/apps/{app_id}/auth/tokens/{token_id}

Path parameters

app_idstring required

Your OneSignal App ID in UUID v4 format. See Keys & IDs.

token_idstring required

The OneSignal-generated ID specific to the API key. This is not the API key itself. It is returned when creating an API key with Create API key. It can be found in the OneSignal dashboard and in the response body of the View API keys request.

Headers

Content-Typestring required
Authorizationstring required

Your Organization's API key found in Organizations > Keys & IDs.

Request body

namestring

An internal name you set to help organize and track API keys (Rich Authentication Tokens). Maximum 128 characters.

ip_allowlist_mode'disabled' | 'explicit'

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_allowliststring[]

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

Response

Returns an empty object on success. Issue a follow-up GET to read the updated values.

object required

Example response

{}