---
title: "Update user"
method: PATCH
path: "/apps/{app_id}/users/by/{alias_label}/{alias_id}"
---

# Update user

`PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}`

Modify a user's properties.

## Path parameters

- `app_id` string, required
- `alias_label` string, required
- `alias_id` string, required

## Headers

- `Authorization` string, required
- `onesignal-subscription-id` string

## Request body

- object
  - `properties` object — Represents user profile data for a given user, including tags, preferences, user activity, and other valuable properties.
    - `tags` object — Custom user events or properties made of key-value pairs of string values. See [Tags](/docs/en/add-user-data-tags). Does not support arrays or other nested objects. Example: `{'foo':'bar','this':'that'}`
    - `language` string — Language Abbreviation in ISO 639-1 format. See [supported languages](/docs/en/multi-language-messaging#supported-languages). Must be lower-case.
    - `timezone_id` string — Timezone ID based on the [tz database "TZ identifier"](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
    - `lat` number, float — User's current latitude. Acceptable values range between `-90` to `90`.
    - `long` number, float — User's current longitude. Acceptable values range between `-180` to `180`.
    - `country` string — Country code in [ISO 3166-1 Alpha 2 format](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). Must be upper-case.
    - `first_active` integer — Unix timestamp in seconds representing when the user was created.
    - `last_active` integer — Unix timestamp in seconds representing the most recent time the user was active in your app.
    - `ip` string — IPv4 or IPv6, response only
    - `test_user_name` string — A label for marking this user as a [Test user](/docs/en/test-users).
  - `deltas` object — User properties that change frequently and generally only increment.
    - `session_time` integer — The total amount of time the user has had the app open in seconds.
    - `session_count` integer — The total amount of times the user has opened the app.
    - `purchases` object[] — List of purchases
      - `sku` string — The SKU of the item purchased.
      - `iso` string — The Currency Code
      - `amount` string — The amount spent on the item.
      - `count` integer — The number of times the item has been purchased.

## Response `202`

202

- object
  - `properties` object
    - `language` string
    - `timezone_id` string
    - `lat` integer
    - `long` integer
    - `country` string
    - `first_active` integer
    - `last_active` integer
    - `test_user_name` string
    - `purchases` object[]
      - `amount` string
      - `count` integer
      - `iso` string
      - `sku` string

## Other responses

- `400` — 400
- `401` — 401
- `409` — 409
- `429` — Rate limit exceeded. Wait the number of seconds in the `Retry-After` header before retrying.
- `503` — Service temporarily unavailable. Retry after a short backoff. The body may be empty or non-JSON in some failure modes.

---

[API](https://skmtc.dev/onesignal/apis/api-onesignal-com.md) · [All operations](https://skmtc.dev/onesignal/apis/api-onesignal-com/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/onesignal/api-onesignal-com/revisions/0fc223f7e338/schema)
