Skip to content
Get started

Add a user to a customer

client.express.users.add(stringexpressCustomerID, UserAddParams { userId } body, RequestOptionsoptions?): UserAddResponse { success, message }
POST/v1/express/{expressCustomerId}/users

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

ParametersExpand Collapse
expressCustomerID: string

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

body: UserAddParams { userId }
userId: string

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

ReturnsExpand Collapse
UserAddResponse { success, message }

Standard success response with optional message

success: boolean
message?: string

Add a user to a customer

import Avara from 'avara';

const client = new Avara({
  apiKey: process.env['AVARA_API_KEY'], // This is the default and can be omitted
});

const response = await client.express.users.add('cus_1234567890abcdef1234567890abcdef', {
  userId: 'usr_1234567890abcdef1234567890abcdef',
});

console.log(response.success);
{
  "success": true,
  "message": "Operation completed successfully"
}
Returns Examples
{
  "success": true,
  "message": "Operation completed successfully"
}