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

Overview

Use this API to add or update aliases associated with a user when you know at least one of those aliases like the external_id, onesignal_id, or a custom alias. This endpoint performs an upsert—if the user already has an alias with the specified alias label, it gets updated; otherwise, a new alias will be created.

This is similar to the Create user API but only updates the identity object.

If you only know a subscription_id associated with the user, use the Create alias (by subscription) API.

For details on OneSignal ID and External ID, see Users. For custom aliases, see Aliases.

To remove an alias, see Delete alias API.


How to use this API

In most cases, you will use your external_id as the alias_label and the value of that ID in the alias_id. You an also use custom Aliases but we highly recommend setting the external_id as your main user ID.

To look up a user via OneSignal ID, use onesignal_id as the alias_label. The OneSignal ID is read-only and used only for fetching. See Users for details.

The request body must include an identity object containing one or more aliases to be created or updated.

Aliases are updated immediately upon request.


Language