Schema API
Overview

Schema API Overview

The Schema API provides methods to query your DealCloud site's configuration: objects, fields, users, currencies, and metadata types. Calls use the SDK’s HTTP client (intapp-rest-client); tune timeouts and retries via configuration and the underlying RestClient where applicable.

All examples assume dealcloud-sdk 1.x and a DealCloudConfig (or equivalent credentials). See Configuration files and Installation.

Key Methods

MethodReturnsDescription
get_objects()List[Object]All objects/entry types
get_entry_type()ObjectSingle object by ID or API name
get_fields()List[Field]Fields for an object or all fields
get_schema()SchemaComplete site schema
get_users()List[User]All users
get_currencies()List[str]Enabled currencies
get_field_types()List[dict]Available field types
get_mappings_types()List[MappingsType]Object mappings types
get_mappings()List[Mapping]Mappings for a given type
get_contract()strSchema contract by UUID
append_choice_values()listAdd choices to a choice field
get_field_units()List[FieldUnit]Available field units
get_timezones()List[Timezone]Available timezones

Quick Examples

List Objects

from dealcloud_sdk import DealCloud, DealCloudConfig
 
config = DealCloudConfig(
    siteUrl="yoursite.dealcloud.com",
    clientId=12345,
    clientSecret="your-secret",
)
dc = DealCloud.from_config_object(config)
 
objects = dc.get_objects()
for obj in objects:
    print(f"{obj.apiName}: {obj.pluralName}")

Get Fields for an Object

fields = dc.get_fields("Company")
for field in fields:
    print(f"{field.apiName} ({field.fieldType}): {field.name}")

Get Complete Schema

schema = dc.get_schema()
 
# Access by API name
company = schema.objects["Company"]
print(f"Company has {len(company.fields)} fields")
 
# Iterate all objects
for obj_name, obj_data in schema.objects.items():
    print(f"{obj_name}: {len(obj_data.fields)} fields")

Get Users

users = dc.get_users()
for user in users:
    print(f"{user.name}: {user.email}")
 
# Active users only
active_users = dc.get_users(active_only=True)

Pydantic Models

Schema data is returned as Pydantic models for type safety:

# Object model
object.id          # int
object.name        # str
object.apiName     # str
object.pluralName  # str
object.singularName # str
 
# Field model
field.id           # int
field.name         # str
field.apiName      # str
field.fieldType    # int
field.isRequired   # bool
field.isMultiSelect # bool
field.choiceValues # List[ChoiceValue] | None
field.entryLists   # List[int] | None (reference targets)
 
# User model
user.id            # int
user.name          # str
user.email         # str
user.isActive      # bool

Caching

Schema methods include automatic caching where appropriate:

MethodCaching
get_field_types()✅ Cached (immutable)
get_system_field_types()✅ Cached (immutable)
get_system_entry_types()✅ Cached (immutable)
get_filter_operations()❌ Not cached (can change)
get_objects()❌ Not cached
get_entry_type()❌ Not cached
get_fields()❌ Not cached
get_users()❌ Not cached
get_mappings_types()❌ Not cached
get_mappings()❌ Not cached
get_contract()❌ Not cached
get_field_units()❌ Not cached
get_timezones()❌ Not cached
💡

For frequently accessed schema data, call get_schema() once and reuse the result.

Related