Skip to content
Get started

Deactivate a customer

client.express.deactivate(stringexpressCustomerID, RequestOptionsoptions?): ExpressDeactivateResponse { createdAt, expressCustomerId, expressCustomerName, 6 more }
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.

ParametersExpand Collapse
expressCustomerID: string

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

ReturnsExpand Collapse
ExpressDeactivateResponse { createdAt, expressCustomerId, expressCustomerName, 6 more }

An Express customer entity that groups users and studies

createdAt: string | null

Timestamp when the Express customer was created

formatdate-time
expressCustomerId: string

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

expressCustomerName: string

Name of the Express customer

minLength1
isActive: boolean

Whether the Express customer is currently active

updatedAt: string | null

Timestamp when the Express customer was last updated

formatdate-time
userCount: number

Number of users currently in this Express customer

minimum0
createdByApiKeyId?: string

UUID of the API key used to create this Express customer, for audit tracking

formatuuid
createdByUserId?: string

User ID who created this Express customer via dashboard, null if created via API key

metadata?: Record<string, string>

Custom key-value metadata for the Express customer. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars

Deactivate 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.deactivate('cus_1234567890abcdef1234567890abcdef');

console.log(response.createdAt);
{
  "createdAt": "2024-01-15T09:00:00Z",
  "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
  "expressCustomerName": "City Medical Center - Radiology Department",
  "isActive": true,
  "updatedAt": "2024-03-15T14:20:00Z",
  "userCount": 15,
  "createdByApiKeyId": "550e8400-e29b-41d4-a716-446655440000",
  "createdByUserId": "usr_1234567890abcdef1234567890abcdef",
  "metadata": {
    "department": "radiology",
    "region": "northeast"
  }
}
Returns Examples
{
  "createdAt": "2024-01-15T09:00:00Z",
  "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
  "expressCustomerName": "City Medical Center - Radiology Department",
  "isActive": true,
  "updatedAt": "2024-03-15T14:20:00Z",
  "userCount": 15,
  "createdByApiKeyId": "550e8400-e29b-41d4-a716-446655440000",
  "createdByUserId": "usr_1234567890abcdef1234567890abcdef",
  "metadata": {
    "department": "radiology",
    "region": "northeast"
  }
}