Create or update a user

Changed on

Synchronously create or update a user in an environment. Requires the write:entities API key scope or admin member access. This scope also grants deletion through the corresponding entity DELETE endpoints, but does not grant membership changes or flag targeting; grant write:flag:targeting separately to assign flags and read for GET requests. Attributes accept JSON values and are normalized and merged using the same rules as ingestion. Recognized name, email, and avatar attributes also update the corresponding user fields; top-level name takes precedence over name attributes. Omitting a field preserves its existing value. New users may omit all fields. When this request succeeds, a subsequent user targeting request can read the user. Flag configuration propagation to SDKs is independent. Delayed ingestion writes may later replace overlapping values because the last database writer wins.

put/apps/{appId}/envs/{envId}/users/{userId}

Request

  • Base URL
    https://app.reflag.com/api
  • Auth
    HTTP bearer

Path parameters

appIdstring required

App identifier

envIdstring required

Environment identifier

userIdstring required

User ID within your application

Request body

namestring

User name. Omit it to preserve an existing name; new users may be unnamed.

attributesEntityAttributesInput nullable

Entity attributes. Values are normalized exactly like ingestion before being merged with existing attributes.

Response

User created or updated successfully

namestring

User name. Omit it to preserve an existing name; new users may be unnamed.

attributesEntityAttributesInputOutput nullable

Entity attributes. Values are normalized exactly like ingestion before being merged with existing attributes.

idstring required

User ID within your application

Changes