Skip to content
Get started

Add a user to a customer

UserAddResponse express().users().add(UserAddParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/express/{expressCustomerId}/users

Associates an existing user with a customer, granting them access to customer-specific resources and studies.

ParametersExpand Collapse
UserAddParams params
Optional<String> expressCustomerId

Unique Express customer identifier. Format: cus_{32-hex-chars}

String userId

User ID to add to the Express customer. Format: usr_{32-hex-chars}

ReturnsExpand Collapse
class UserAddResponse:

Standard success response with optional message

boolean success
Optional<String> message

Add a user to a customer

package com.avara.example;

import com.avara.client.AvaraClient;
import com.avara.client.okhttp.AvaraOkHttpClient;
import com.avara.models.express.users.UserAddParams;
import com.avara.models.express.users.UserAddResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        AvaraClient client = AvaraOkHttpClient.fromEnv();

        UserAddParams params = UserAddParams.builder()
            .expressCustomerId("cus_1234567890abcdef1234567890abcdef")
            .userId("usr_1234567890abcdef1234567890abcdef")
            .build();
        UserAddResponse response = client.express().users().add(params);
    }
}
{
  "success": true,
  "message": "Operation completed successfully"
}
Returns Examples
{
  "success": true,
  "message": "Operation completed successfully"
}