Skip to content
Get started

Update an organization

client.orgs.update(stringorgID, OrgUpdateParams { metadata, orgName } body?, RequestOptionsoptions?): OrgUpdateResponse { createdAt, isActive, orgId, 6 more }
patch/v1/orgs/{orgId}

Updates an organization's properties such as name or other metadata. All fields are optional - only provided fields will be updated.

ParametersExpand Collapse
orgID: string

Unique organization identifier. Format: org_{32-hex-chars}

body: OrgUpdateParams { metadata, orgName }
metadata?: Record<string, string> | null

Updated metadata. Pass null to clear all metadata

orgName?: string

Updated name for the organization

minLength1
ReturnsExpand Collapse
OrgUpdateResponse { createdAt, isActive, orgId, 6 more }

An organization entity that groups users and studies

createdAt: string | null

Timestamp when the organization was created

formatdate-time
isActive: boolean

Whether the organization is currently active

orgId: string

Unique organization identifier. Format: org_{32-hex-chars}

orgName: string

Name of the organization

minLength1
updatedAt: string | null

Timestamp when the organization was last updated

formatdate-time
userCount: number

Number of users currently in this organization

minimum0
createdByApiKeyId?: string

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

formatuuid
createdByUserId?: string

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

metadata?: Record<string, string>

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

Update an organization
import Avara from 'avara';

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

const org = await client.orgs.update('org_1234567890abcdef1234567890abcdef');

console.log(org.createdAt);
{
  "createdAt": "2024-01-15T09:00:00Z",
  "isActive": true,
  "orgId": "org_1234567890abcdef1234567890abcdef",
  "orgName": "City Medical Center - Radiology Department",
  "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",
  "isActive": true,
  "orgId": "org_1234567890abcdef1234567890abcdef",
  "orgName": "City Medical Center - Radiology Department",
  "updatedAt": "2024-03-15T14:20:00Z",
  "userCount": 15,
  "createdByApiKeyId": "550e8400-e29b-41d4-a716-446655440000",
  "createdByUserId": "usr_1234567890abcdef1234567890abcdef",
  "metadata": {
    "department": "radiology",
    "region": "northeast"
  }
}