# Express ## Create `client.express.create(ExpressCreateParamsbody, RequestOptionsoptions?): ExpressCreateResponse` **post** `/v1/express` Creates a new customer with a unique identifier and name. Customers can be used to group and manage users, studies, and access permissions across the Avara platform. ### Parameters - `body: ExpressCreateParams` - `expressCustomerName: string` Name of the Express customer to create - `metadata?: Record` Custom key-value metadata for the Express customer. Maximum 50 pairs ### Returns - `ExpressCreateResponse` An Express customer entity that groups users and studies - `createdAt: string | null` Timestamp when the Express customer was created - `expressCustomerId: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `expressCustomerName: string` Name of the Express customer - `isActive: boolean` Whether the Express customer is currently active - `updatedAt: string | null` Timestamp when the Express customer was last updated - `userCount: number` Number of users currently in this Express customer - `createdByApiKeyId?: string` UUID of the API key used to create this Express customer, for audit tracking - `createdByUserId?: string` User ID who created this Express customer via dashboard, null if created via API key - `metadata?: Record` Custom key-value metadata for the Express customer. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars ### Example ```typescript import Avara from 'avara'; const client = new Avara({ apiKey: process.env['AVARA_API_KEY'], // This is the default and can be omitted }); const express = await client.express.create({ expressCustomerName: 'City Medical Center - Radiology Department', }); console.log(express.createdAt); ``` ## List `client.express.list(ExpressListParamsquery?, RequestOptionsoptions?): CursorExpressCustomers` **get** `/v1/express` Retrieves a paginated list of customers with optional filtering by name. Returns up to 100 customers per request. ### Parameters - `query: ExpressListParams` - `cursor?: string` Base64 encoded cursor from previous response - `limit?: number` Number of results to return (1-100) ### Returns - `ExpressListResponse` An Express customer entity that groups users and studies - `createdAt: string | null` Timestamp when the Express customer was created - `expressCustomerId: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `expressCustomerName: string` Name of the Express customer - `isActive: boolean` Whether the Express customer is currently active - `updatedAt: string | null` Timestamp when the Express customer was last updated - `userCount: number` Number of users currently in this Express customer - `createdByApiKeyId?: string` UUID of the API key used to create this Express customer, for audit tracking - `createdByUserId?: string` User ID who created this Express customer via dashboard, null if created via API key - `metadata?: Record` Custom key-value metadata for the Express customer. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars ### Example ```typescript import Avara from 'avara'; const client = new Avara({ apiKey: process.env['AVARA_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const expressListResponse of client.express.list()) { console.log(expressListResponse.createdAt); } ``` ## Retrieve `client.express.retrieve(stringexpressCustomerID, RequestOptionsoptions?): ExpressRetrieveResponse` **get** `/v1/express/{expressCustomerId}` Retrieves a single customer by its unique customer ID. Returns the complete customer object with name, status, and timestamps. ### Parameters - `expressCustomerID: string` Unique Express customer identifier. Format: cus_{32-hex-chars} ### Returns - `ExpressRetrieveResponse` An Express customer entity that groups users and studies - `createdAt: string | null` Timestamp when the Express customer was created - `expressCustomerId: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `expressCustomerName: string` Name of the Express customer - `isActive: boolean` Whether the Express customer is currently active - `updatedAt: string | null` Timestamp when the Express customer was last updated - `userCount: number` Number of users currently in this Express customer - `createdByApiKeyId?: string` UUID of the API key used to create this Express customer, for audit tracking - `createdByUserId?: string` User ID who created this Express customer via dashboard, null if created via API key - `metadata?: Record` Custom key-value metadata for the Express customer. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars ### Example ```typescript import Avara from 'avara'; const client = new Avara({ apiKey: process.env['AVARA_API_KEY'], // This is the default and can be omitted }); const express = await client.express.retrieve('cus_1234567890abcdef1234567890abcdef'); console.log(express.createdAt); ``` ## Update `client.express.update(stringexpressCustomerID, ExpressUpdateParamsbody?, RequestOptionsoptions?): ExpressUpdateResponse` **patch** `/v1/express/{expressCustomerId}` Updates a customer's properties such as name or other metadata. All fields are optional - only provided fields will be updated. ### Parameters - `expressCustomerID: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `body: ExpressUpdateParams` - `expressCustomerName?: string` Updated name for the Express customer - `metadata?: Record | null` Updated metadata. Pass null to clear all metadata ### Returns - `ExpressUpdateResponse` An Express customer entity that groups users and studies - `createdAt: string | null` Timestamp when the Express customer was created - `expressCustomerId: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `expressCustomerName: string` Name of the Express customer - `isActive: boolean` Whether the Express customer is currently active - `updatedAt: string | null` Timestamp when the Express customer was last updated - `userCount: number` Number of users currently in this Express customer - `createdByApiKeyId?: string` UUID of the API key used to create this Express customer, for audit tracking - `createdByUserId?: string` User ID who created this Express customer via dashboard, null if created via API key - `metadata?: Record` Custom key-value metadata for the Express customer. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars ### Example ```typescript import Avara from 'avara'; const client = new Avara({ apiKey: process.env['AVARA_API_KEY'], // This is the default and can be omitted }); const express = await client.express.update('cus_1234567890abcdef1234567890abcdef'); console.log(express.createdAt); ``` ## Deactivate `client.express.deactivate(stringexpressCustomerID, RequestOptionsoptions?): ExpressDeactivateResponse` **post** `/v1/express/{expressCustomerId}/deactivate` Deactivates a customer, preventing it from being used for new studies or user assignments. Existing data is preserved and the customer can be reactivated later. ### Parameters - `expressCustomerID: string` Unique Express customer identifier. Format: cus_{32-hex-chars} ### Returns - `ExpressDeactivateResponse` An Express customer entity that groups users and studies - `createdAt: string | null` Timestamp when the Express customer was created - `expressCustomerId: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `expressCustomerName: string` Name of the Express customer - `isActive: boolean` Whether the Express customer is currently active - `updatedAt: string | null` Timestamp when the Express customer was last updated - `userCount: number` Number of users currently in this Express customer - `createdByApiKeyId?: string` UUID of the API key used to create this Express customer, for audit tracking - `createdByUserId?: string` User ID who created this Express customer via dashboard, null if created via API key - `metadata?: Record` Custom key-value metadata for the Express customer. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars ### Example ```typescript 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.deactivate('cus_1234567890abcdef1234567890abcdef'); console.log(response.createdAt); ``` ## Reactivate `client.express.reactivate(stringexpressCustomerID, RequestOptionsoptions?): ExpressReactivateResponse` **post** `/v1/express/{expressCustomerId}/reactivate` Restores a deactivated customer to active status, allowing it to be used for new studies and user assignments again. ### Parameters - `expressCustomerID: string` Unique Express customer identifier. Format: cus_{32-hex-chars} ### Returns - `ExpressReactivateResponse` An Express customer entity that groups users and studies - `createdAt: string | null` Timestamp when the Express customer was created - `expressCustomerId: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `expressCustomerName: string` Name of the Express customer - `isActive: boolean` Whether the Express customer is currently active - `updatedAt: string | null` Timestamp when the Express customer was last updated - `userCount: number` Number of users currently in this Express customer - `createdByApiKeyId?: string` UUID of the API key used to create this Express customer, for audit tracking - `createdByUserId?: string` User ID who created this Express customer via dashboard, null if created via API key - `metadata?: Record` Custom key-value metadata for the Express customer. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars ### Example ```typescript 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.reactivate('cus_1234567890abcdef1234567890abcdef'); console.log(response.createdAt); ``` # Users ## Add `client.express.users.add(stringexpressCustomerID, UserAddParamsbody, RequestOptionsoptions?): UserAddResponse` **post** `/v1/express/{expressCustomerId}/users` Associates an existing user with a customer, granting them access to customer-specific resources and studies. ### Parameters - `expressCustomerID: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `body: UserAddParams` - `userId: string` User ID to add to the Express customer. Format: usr_{32-hex-chars} ### Returns - `UserAddResponse` Standard success response with optional message - `success: boolean` - `message?: string` ### Example ```typescript 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); ``` ## Remove `client.express.users.remove(stringexpressCustomerID, UserRemoveParamsbody, RequestOptionsoptions?): UserRemoveResponse` **delete** `/v1/express/{expressCustomerId}/users` Removes a user's association with a customer, revoking their access to customer-specific resources. The user account remains active but is no longer linked to this customer. ### Parameters - `expressCustomerID: string` Unique Express customer identifier. Format: cus_{32-hex-chars} - `body: UserRemoveParams` - `userId: string` User ID to remove from the Express customer. Format: usr_{32-hex-chars} ### Returns - `UserRemoveResponse` Standard success response with optional message - `success: boolean` - `message?: string` ### Example ```typescript import Avara from 'avara'; const client = new Avara({ apiKey: process.env['AVARA_API_KEY'], // This is the default and can be omitted }); const user = await client.express.users.remove('cus_1234567890abcdef1234567890abcdef', { userId: 'usr_1234567890abcdef1234567890abcdef', }); console.log(user.success); ```