The sample shows the POST /environments/{environmentId}/users/{userId}/devices operation to add an EMAIL device to the specified user resource.

The status parameter is optional. Use cases:

  1. If the actor makes the request on behalf of another user, the value assigned to status can be one of:
  2. If the actor making the request is the same user for whom the device is created, the status can only be ACTIVATION_REQUIRED (default, if not provided). Thus in this case, a user is required to activate the device before performing its first authentication.

If the status is ACTIVATION_REQUIRED, you can use the notification property during device creation to create a custom device pairing notification. This is only applicable with SMS, Voice and Email devices. This property is not returned with GET operations and cannot be used with PUT operations. For more information, see Custom device pairing notification with device creation.

Note: An actor making a self request must have an access token that includes the p1:create:device scope.