---
title: "Create alias (by subscription)"
method: PATCH
path: "/apps/{app_id}/subscriptions/{subscription_id}/user/identity"
---

# Create alias (by subscription)

`PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity`

Create or update an alias for a user using a known subscription ID.

## Path parameters

- `app_id` string, required
- `subscription_id` string, required

## Request body

- object
  - `identity` object — One or more aliases to be created for this user.
    - `external_id` string — The main user ID to identify the user. See [Users](/docs/users).
    - `onesignal_id` string

## Response `200`

200

- object
  - `identity` object
    - `external_id` string
    - `onesignal_id` string

## Other responses

- `400` — 400
- `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)
