Skip to content
Get started

Create a new organization

orgs.create(OrgCreateParams**kwargs) -> OrgCreateResponse
post/v1/orgs

Creates a new organization with a unique identifier and name. Organizations can be used to group and manage users, studies, and access permissions across the Avara platform.

ParametersExpand Collapse
org_name: str

Name of the organization to create

minLength1
metadata: Optional[Dict[str, str]]

Custom key-value metadata for the organization. Maximum 50 pairs

ReturnsExpand Collapse
class OrgCreateResponse:

An organization entity that groups users and studies

created_at: Optional[datetime]

Timestamp when the organization was created

formatdate-time
is_active: bool

Whether the organization is currently active

org_id: str

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

org_name: str

Name of the organization

minLength1
updated_at: Optional[datetime]

Timestamp when the organization was last updated

formatdate-time
user_count: int

Number of users currently in this organization

minimum0
created_by_api_key_id: Optional[str]

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

formatuuid
created_by_user_id: Optional[str]

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

metadata: Optional[Dict[str, str]]

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

Create a new organization
import os
from avara import Avara

client = Avara(
    api_key=os.environ.get("AVARA_API_KEY"),  # This is the default and can be omitted
)
org = client.orgs.create(
    org_name="City Medical Center - Radiology Department",
)
print(org.created_at)
{
  "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"
  }
}