---
sidebar:
  hidden: true
title: roboto.domain.custom_fields.record
---
## Module Contents

### CUSTOM_FIELD_NAME_PATTERN

```python
roboto.domain.custom_fields.record.CUSTOM_FIELD_NAME_PATTERN = '[a-z][a-z0-9_]{0,62}'
```

`from roboto.domain.custom_fields import CUSTOM_FIELD_NAME_PATTERN`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/custom_fields/record.py#L20-L20)

Regular expression a custom field's name must match.

A name is at most 63 characters long, starts with a lowercase ASCII letter, and otherwise contains only lowercase ASCII letters, digits, and underscores. The pattern is unanchored, for embedding in a larger one; to match a whole name, wrap it as `^...$`.

### CustomFieldOptions

```python
type roboto.domain.custom_fields.record.CustomFieldOptions = Annotated[EnumFieldOptions, pydantic.Field(discriminator='field_type')]
```

`from roboto.domain.custom_fields import CustomFieldOptions`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/custom_fields/record.py#L172-L172)

Type-specific configuration of any kind: one of `EnumFieldOptions`.

The options' `field_type` selects the kind.

### CustomFieldRecord

```python
class roboto.domain.custom_fields.record.CustomFieldRecord(/, **data: Any)
```

`from roboto.domain.custom_fields import CustomFieldRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/custom_fields/record.py#L180-L251)

Bases: `pydantic.BaseModel`

Data record of a custom field, as the Roboto API returns it.

A custom field is a typed field that an organization defines for one entity type, such as datasets: each entity of that type can hold a value for it, and search can filter and sort by it. [`CustomField`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField) wraps this record with methods that act on the field.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CustomFieldRecord.attempts** (`int`) = `0`: Number of times Roboto has tried to finish the custom field's current create or delete, for diagnosis.

  Reset to `0` when the field becomes `CustomFieldStatus.Ready` and when its deletion begins. Roboto sets it; no request does.

- **CustomFieldRecord.created** (`datetime.datetime`): Time the custom field was created.

- **CustomFieldRecord.created_by** (`str`): Principal that created the custom field, as `<type>:<id>`, such as `user:<user_id>`.

- **CustomFieldRecord.description** (`str | None`) = `None`: Human-readable description of the custom field, or `None` if it has none.

- **CustomFieldRecord.display_name** (`str | None`) = `None`: Human-readable label of the custom field, or `None` if it has none.

- **CustomFieldRecord.entity_type** (`TargetEntityType`): Kind of entity the custom field applies to. Fixed when the field is created.

- **CustomFieldRecord.field_id** (`str`): Unique ID of the custom field, beginning with `cf_`.

- **CustomFieldRecord.field_name** (`str`): Name of the custom field, unique among its organization's fields for its entity type.

  Fixed when the field is created.

- **CustomFieldRecord.field_type** (`CustomFieldType`): Value type of the custom field. Fixed when the field is created.

- **CustomFieldRecord.last_error** (`str | None`) = `None`: Human-readable reason the custom field's most recent create or delete failed, or `None`.

  Set when `status` becomes `CustomFieldStatus.Failed`, and cleared when the field is deleted. Roboto sets it; no request does.

- **CustomFieldRecord.metadata_path** (`str | None`) = `None`: Unused. Roboto rejects a create request that sets it, so it is always `None`.

- **CustomFieldRecord.modified** (`datetime.datetime`): Time the custom field was last modified.

- **CustomFieldRecord.modified_by** (`str`): Principal that last modified the custom field, in the same `<type>:<id>` form as `created_by`.

  Roboto's own system user when Roboto made the change, such as moving `status` to `CustomFieldStatus.Ready`.

- **CustomFieldRecord.options** (`CustomFieldOptions | None`) = `None`: Type-specific configuration of the custom field.

  Set on fields of type `CustomFieldType.Enum`; `None` on types that take no options.

- **CustomFieldRecord.org_id** (`str`): ID of the organization that owns the custom field.

- **CustomFieldRecord.status** (`CustomFieldStatus`): Lifecycle state of the custom field, which determines what can be done with it.

### CustomFieldStatus

```python
class roboto.domain.custom_fields.record.CustomFieldStatus
```

`from roboto.domain.custom_fields import CustomFieldStatus`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/custom_fields/record.py#L29-L56)

Bases: `roboto.compat.StrEnum`

Lifecycle state of a custom field, which determines what can be done with it.

After [`create()`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField.create), Roboto sets the field up and moves it from `Creating` to `Ready`. After [`delete()`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField.delete), the field is `Deleting` until Roboto removes it. Either process can end in `Failed` instead.

**Attributes**

- **CustomFieldStatus.Creating** = `'creating'`: Roboto is still setting the field up.

  Values cannot yet be set on entities, and search cannot filter or sort by the field.

- **CustomFieldStatus.Deleting** = `'deleting'`: Roboto is deleting the field.

  Treat the field as already gone: values can no longer be set on it.

- **CustomFieldStatus.Failed** = `'failed'`: The field's most recent create or delete did not finish.

  The field stays in this state until it is deleted or Roboto intervenes.

- **CustomFieldStatus.Ready** = `'ready'`: The field is set up. Values can be set on entities, and search can filter and sort by the field.

### CustomFieldType

```python
class roboto.domain.custom_fields.record.CustomFieldType
```

`from roboto.domain.custom_fields import CustomFieldType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/custom_fields/record.py#L91-L127)

Bases: `roboto.compat.StrEnum`

Value type of a custom field, which determines the values it accepts and how search can filter by it.

A field's type is fixed when the field is created. Search can sort by a field of any type, and can check whether an entity has a value for it.

**Attributes**

- **CustomFieldType.Boolean** = `'boolean'`: Boolean value. Search can test it for equality.

- **CustomFieldType.Enum** = `'enum'`: String value from a fixed set of allowed values. Search can test it for equality.

  The allowed values are declared by `EnumFieldOptions` when the field is created. Values can be added to the set later, with [`add_enum_values()`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField.add_enum_values), but not removed from it.

- **CustomFieldType.Number** = `'number'`: Numeric value. Search can test it for equality and compare it against a range.

- **CustomFieldType.String** = `'string'`: Free-form string value. Search can test it for equality, a substring, or a wildcard pattern.

- **CustomFieldType.Timestamp** = `'timestamp'`: Point in time. Search can test it for equality and compare it against a range.

  Values may be given as a `datetime`, an ISO 8601 string, an `int` of nanoseconds since the Unix epoch, or a `float`, `decimal.Decimal` or numeric string of seconds since it. A string is read as seconds whenever it parses as a number, so the all-digit date `20260101` names a moment in 1970 rather than a day in 2026.

  A value carrying no time zone, whether a naive `datetime` or an ISO 8601 string with no offset, is read as UTC; a date with no time, such as `2026-05-14`, resolves to midnight UTC. Sub-microsecond precision is not retained.

  Values are returned as ISO 8601 strings, which `datetime.datetime.fromisoformat` parses.

### EnumFieldOptions

```python
class roboto.domain.custom_fields.record.EnumFieldOptions(/, **data: Any)
```

`from roboto.domain.custom_fields import EnumFieldOptions`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/custom_fields/record.py#L148-L169)

Bases: `pydantic.BaseModel`

Configuration of an enum custom field: the values it accepts.

Required when creating a field of type `CustomFieldType.Enum`; fields of other types take no options. Building the options raises `pydantic.ValidationError` when `enum_values` is empty or `field_type` is not `Enum`. Carried in `CustomFieldRecord.options`, [`options`](/docs/reference/python-sdk/roboto/domain/custom_fields/operations#roboto.domain.custom_fields.operations.CreateCustomFieldRequest.options) and [`options`](/docs/reference/python-sdk/roboto/domain/custom_fields/operations#roboto.domain.custom_fields.operations.UpdateCustomFieldRequest.options).

**Parameters**

- **data** (`Any`)

**Attributes**

- **EnumFieldOptions.enum_values** (`list[str]`) = `None`: Values the field accepts. At least one is required.
- **EnumFieldOptions.field_type** (`Literal[CustomFieldType]`): Kind of field these options configure, always `CustomFieldType.Enum`.

### TargetEntityType

```python
class roboto.domain.custom_fields.record.TargetEntityType
```

`from roboto.domain.custom_fields import TargetEntityType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/custom_fields/record.py#L59-L88)

Bases: `roboto.compat.StrEnum`

Kind of Roboto entity a custom field applies to.

Each custom field applies to one entity type, and its name is unique among its organization's fields for that type.

**Attributes**

- **TargetEntityType.Collection** = `'collection'`: Collections ([`Collection`](/docs/reference/python-sdk/roboto/domain/collections/collection#roboto.domain.collections.collection.Collection)).
- **TargetEntityType.Dataset** = `'dataset'`: Datasets ([`Dataset`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset)).
- **TargetEntityType.Device** = `'device'`: Devices ([`Device`](/docs/reference/python-sdk/roboto/domain/devices/device#roboto.domain.devices.device.Device)).
- **TargetEntityType.Event** = `'event'`: Events ([`Event`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event)).
- **TargetEntityType.Session** = `'session'`: Sessions ([`Session`](/docs/reference/python-sdk/roboto/experimental/sessions/session#roboto.experimental.sessions.session.Session)).

**Properties**

- **TargetEntityType.url_safe_value** (`str`): Value of the entity type, URL-encoded for use in a request path.

  [`from_name_and_entity_type()`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField.from_name_and_entity_type) builds its request path through it, so most code never calls it.
