The optimized targeting launch has been postponed. Line items will continue to use the targeting expansion feature and the targetingExpansion field of the LineItem resource will continue to behave as it has previously.

Create a user

If assigned the Admin role for a resource, you can create a user with access to that resource or those under it.

Users are created through the user.create method.

A new user's email address must have a corresponding Google Account, which can be created for an existing email address. The user resource created must also include at least one assigned user role.

The following code is an example of how to create a new user with standard access to an advertiser:


// Create the user structure.
User user = new User();

// Create the assigned user role structure.
AssignedUserRole assignedUserRole = new AssignedUserRole();

// Add assigned user role list to the user.

// Configure the create request.
Users.Create request = service.users().create(user);

// Create the user.
User response = request.execute();

// Display the user.
System.out.printf("User %s was created with email %s.",


# Create a user object.
user_obj = {
    'email': email-address,
    'displayName': display-name,
    'assignedUserRoles': [
            'advertiserId': advertiser-id,
            'userRole': 'STANDARD'

# Build request.
request = service.users().create(

# Execute request.
response = request.execute()

# Display the new user.
print('User %s was created with email %s.'
      % (response['name'], response['email']))


// Create the user structure.
$user = new Google_Service_DisplayVideo_User();

// Create the assigned user role structure.
$assignedUserRole = new Google_Service_DisplayVideo_AssignedUserRole();

// Add assigned user role list to the user.

// Call the API, creating the user with the assigned user role.
$result = $this->service->users->create($user);

// Display the user.
    'User %s was created with email %s.\n',