PATCH
/
apps
/
{app_id}
/
users
/
by
/
{alias_label}
/
{alias_id}
curl --request PATCH \
  --url https://api.onesignal.com/apps/{app_id}/users/by/{alias_label}/{alias_id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "properties": {
    "tags": {},
    "language": "en",
    "timezone_id": "America\\/Los_Angeles",
    "lat": 123,
    "long": 123,
    "country": "US",
    "first_active": 123,
    "last_active": 123,
    "ip": "<string>"
  },
  "deltas": {
    "session_time": 123,
    "session_count": 123,
    "purchases": [
      {
        "sku": "<string>",
        "iso": "USD",
        "amount": "<string>",
        "count": 123
      }
    ]
  }
}'
"{\n    \"properties\": {\n        \"language\": \"en\",\n        \"timezone_id\": \"PST\",\n        \"lat\": 90,\n        \"long\": 135,\n        \"country\": \"US\",\n        \"first_active\": 1678215680,\n        \"last_active\": 1678215682,\n        \"purchases\": [\n            {\n                \"amount\": \"$33.33\",\n                \"count\": 3,\n                \"iso\": \"USD\",\n                \"sku\": \"item\"\n            }\n        ]\n    }\n}"

If you are still using pre-User Model APIs or SDKs (Mobile SDKs version 4 or lower, Web SDKs version 15 or lower), we recommend thorough testing of this endpoint before switching to the new User Model. Discrepancies may occur where the External ID set through the SDK and the External ID set through the API do not generate matching OneSignal IDs. To ensure a smooth transition, consider the following options:

Overview

This endpoint updates user-level properties for an existing user in your OneSignal app.


How to use this API

You must supply an alias in the request path:

  • alias_label: The type of identifier (e.g., external_id, onesignal_id, or a custom alias label).
  • alias_id: The corresponding value for that label.

See Users and Aliases for more info.


Headers

Authorization
string
default:Key YOUR_APP_API_KEY
required

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

onesignal-subscription-id
string

Optional. Identifies a specific subscription to update. Some user properties, such as Session Time and Session Count, will update values on both the User and the Subscription.

Path Parameters

app_id
string
required

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

alias_label
string
required

The alias name or key to locate the user. Most commonly set as external_id but can be the onesignal_id or a custom alias.

alias_id
string
required

The specific identifier for the given alias to identify the user.

Body

application/json

Response

202
application/json

202

The response is of type object.

PATCH
/
apps
/
{app_id}
/
users
/
by
/
{alias_label}
/
{alias_id}
curl --request PATCH \
  --url https://api.onesignal.com/apps/{app_id}/users/by/{alias_label}/{alias_id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "properties": {
    "tags": {},
    "language": "en",
    "timezone_id": "America\\/Los_Angeles",
    "lat": 123,
    "long": 123,
    "country": "US",
    "first_active": 123,
    "last_active": 123,
    "ip": "<string>"
  },
  "deltas": {
    "session_time": 123,
    "session_count": 123,
    "purchases": [
      {
        "sku": "<string>",
        "iso": "USD",
        "amount": "<string>",
        "count": 123
      }
    ]
  }
}'
"{\n    \"properties\": {\n        \"language\": \"en\",\n        \"timezone_id\": \"PST\",\n        \"lat\": 90,\n        \"long\": 135,\n        \"country\": \"US\",\n        \"first_active\": 1678215680,\n        \"last_active\": 1678215682,\n        \"purchases\": [\n            {\n                \"amount\": \"$33.33\",\n                \"count\": 3,\n                \"iso\": \"USD\",\n                \"sku\": \"item\"\n            }\n        ]\n    }\n}"

If you are still using pre-User Model APIs or SDKs (Mobile SDKs version 4 or lower, Web SDKs version 15 or lower), we recommend thorough testing of this endpoint before switching to the new User Model. Discrepancies may occur where the External ID set through the SDK and the External ID set through the API do not generate matching OneSignal IDs. To ensure a smooth transition, consider the following options:

Overview

This endpoint updates user-level properties for an existing user in your OneSignal app.


How to use this API

You must supply an alias in the request path:

  • alias_label: The type of identifier (e.g., external_id, onesignal_id, or a custom alias label).
  • alias_id: The corresponding value for that label.

See Users and Aliases for more info.


Headers

Authorization
string
default:Key YOUR_APP_API_KEY
required

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

onesignal-subscription-id
string

Optional. Identifies a specific subscription to update. Some user properties, such as Session Time and Session Count, will update values on both the User and the Subscription.

Path Parameters

app_id
string
required

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

alias_label
string
required

The alias name or key to locate the user. Most commonly set as external_id but can be the onesignal_id or a custom alias.

alias_id
string
required

The specific identifier for the given alias to identify the user.

Body

application/json

Response

202
application/json

202

The response is of type object.