Skip to content

Custom Field Schemas

Accessed via client.custom_field_schemas.

pycomad.client.CustomFieldSchemasClient

CustomFieldSchemasClient(http: _HttpSession)

Methods for the /teams/{team_id}/custom-field-schemas resource.

list

list(team_id: str) -> List[CustomFieldSchema]

Return all custom field schemas for a team.

Parameters:

Name Type Description Default
team_id str

Team ID string.

required

Returns:

Type Description
List[CustomFieldSchema]

List of :class:~pycomad.models.CustomFieldSchema objects.

Raises:

Type Description
ComadAuthError

If not authenticated or not a team member (403).

create

create(team_id: str, key: str, name: str, field_type: Union[FieldType, str], *, required: Optional[bool] = None) -> CustomFieldSchema

Create a custom field schema for a team.

The key is immutable after creation and is used as the JSONB property key on assets (e.g. "project_code"). It must be unique within the team.

Parameters:

Name Type Description Default
team_id str

Team ID string.

required
key str

Immutable slug used as the JSONB key on assets.

required
name str

Human-readable display label (editable later).

required
field_type Union[FieldType, str]

Data type — "String", "Boolean", "Integer", "Float", or "DateTime".

required
required Optional[bool]

Whether the field is required (default False).

None

Returns:

Type Description
CustomFieldSchema

The newly created :class:~pycomad.models.CustomFieldSchema.

Raises:

Type Description
ComadAuthError

If not authenticated or not a team owner/leader.

ComadValidationError

On a 400 response (e.g. duplicate key).

update

update(team_id: str, schema_id: Union[UUID, str], *, name: Optional[str] = None, required: Optional[bool] = None) -> CustomFieldSchema

Update a custom field schema's display label or required flag.

The key field is immutable and cannot be changed.

Parameters:

Name Type Description Default
team_id str

Team ID string.

required
schema_id Union[UUID, str]

UUID of the schema to update.

required
name Optional[str]

New display label.

None
required Optional[bool]

New required flag.

None

Returns:

Type Description
CustomFieldSchema

The updated :class:~pycomad.models.CustomFieldSchema.

Raises:

Type Description
ComadAuthError

If not authenticated or not a team owner/leader.

ComadNotFoundError

If the schema does not exist.

delete

delete(team_id: str, schema_id: Union[UUID, str]) -> None

Delete a custom field schema.

Parameters:

Name Type Description Default
team_id str

Team ID string.

required
schema_id Union[UUID, str]

UUID of the schema to delete.

required

Raises:

Type Description
ComadAuthError

If not authenticated or not a team owner/leader.

ComadNotFoundError

If the schema does not exist.