Organizations

Organization resource

Access organizations through client.organizations.

📋

Prerequisites

Get started with Vi SDK →

This class provides methods to access organization information including billing, users, datasets, and features.


Methods

info()

Display formatted information about the current organization.

This method prints a formatted summary of the organization to the console. It does not return a value - use get() to retrieve an Organization object for programmatic access.

# Display formatted organization info
client.organizations.info()  # Prints formatted organization summary

Returns: None (prints to console)


get()

Get the current organization object for programmatic access.

# Basic usage
org = client.organizations.get()

print(f"Organization: {org.name}")
print(f"ID: {org.organization_id}")
print(f"Datasets: {len(org.datasets)}")
# Get complete organization details
import vi

client = vi.Client()
org = client.organizations.get()

print(f"Organization: {org.name}")
print(f"ID: {org.organization_id}")
print(f"Plan: {org.billing.tier}")
print(f"Datasets: {len(org.datasets)}")
print(f"Users: {len(org.users)}")
# List organization users
from vi.api.responses import User

org = client.organizations.get()

print("Organization Users:")
for user_id, user in org.users.items():
    print(f"  {user_id}: {user.workspace_role}")

    if user.datasets:
        print(f"    Datasets: {len(user.datasets)}")
# Check organization features
org = client.organizations.get()

print("Enabled Features:")
for feature, enabled in org.features.items():
    status = "✓" if enabled else "✗"
    print(f"  {status} {feature}")
# Check organization status
org = client.organizations.get()

# Check lock status
if org.lock_status.is_locked:
    print(f"⚠️ Organization is locked")
    if org.lock_status.lockDate:
        from datetime import datetime
        lock_date = datetime.fromtimestamp(org.lock_status.lockDate / 1000)
        print(f"   Locked on: {lock_date}")
else:
    print("✓ Organization is active")

# Check billing status
print(f"Billing Tier: {org.billing.tier}")
print(f"Billing Email: {org.billing.email}")
# List all datasets in organization
org = client.organizations.get()

print(f"Datasets in {org.name}:")
for dataset_id in org.datasets:
    dataset = client.datasets.get(dataset_id)
    print(f"  {dataset.name} ({dataset_id})")
    print(f"    Assets: {dataset.statistic.asset_total}")
    print(f"    Annotations: {dataset.statistic.annotation_total}")
# Get organization metadata
from datetime import datetime

org = client.organizations.get()

print("Organization Metadata:")
if org.metadata.create_date:
    created = datetime.fromtimestamp(org.metadata.create_date / 1000)
    print(f"  Created: {created}")

print(f"  Public: {org.metadata.is_public}")

if org.metadata.account_manager:
    print(f"  Account Manager: {org.metadata.account_manager}")

if org.metadata.sales_engineer:
    print(f"  Sales Engineer: {org.metadata.sales_engineer}")
# Display info method on organization object
org = client.organizations.get()
org.info()  # Prints formatted organization summary

Returns: Organization


Response types

Organization

Main organization response object.

from vi.api.resources.organizations.responses import Organization
PropertyTypeDescription
namestrDisplay name
kindstrOrganization type
organization_idstrUnique identifier
last_accessintLast access timestamp
datasetslist[str]List of dataset IDs
billingOrganizationBillingBilling information
usersdict[str, User]Users mapping
metadataOrganizationMetadataOrganization metadata
featuresdictEnabled features
lock_statusOrganizationLockStatusLock status
self_linkstrAPI link
etagstrEntity tag

Methods:

MethodReturnsDescription
info()NoneDisplay formatted organization information

OrganizationBilling

from vi.api.resources.organizations.responses import OrganizationBilling
PropertyTypeDescription
payerstrPayment entity
emailstrBilling email
subscriber_idstrSubscriber identifier
ledgerlistBilling ledger entries
tierstrCurrent billing tier

OrganizationMetadata

from vi.api.resources.organizations.responses import OrganizationMetadata
PropertyTypeDescription
create_dateint | NoneCreation timestamp
is_publicbool | NonePublic visibility
account_managerstr | NoneAccount manager
sales_engineerstr | NoneSales engineer

OrganizationLockStatus

from vi.api.resources.organizations.responses import OrganizationLockStatus
PropertyTypeDescription
is_lockedboolLock status
lockDateint | NoneLock timestamp

Related resources