# Contact

## Get contact field definitions

`contact.definitions()  -> ContactDefinitionsResponse`

**get** `/v1/contacts/definitions`

Returns the schema for all field and relationship definitions available on contacts, including both system-defined and custom fields. Useful for understanding the shape of contact data before creating or updating records. See <u>[Fields and relationships](/using-the-api/fields-and-relationships/)</u> for more details.

**[Required scope](/using-the-api/scopes/):** `contacts:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Returns

- `class ContactDefinitionsResponse: …`

  - `field_definitions: Dict[str, FieldDefinitions]`

    Map of field keys to their definitions, including both system and custom fields.

    - `description: Optional[str]`

      Description of the field, or null.

    - `label: str`

      Human-readable display name of the field.

    - `type_configuration: FieldDefinitionsTypeConfiguration`

      Type-specific configuration (e.g. select options, currency code).

      - `currency: Optional[str]`

        ISO 4217 3-letter currency code.

      - `handle_service: Optional[Literal["TWITTER", "LINKEDIN", "FACEBOOK", "INSTAGRAM"]]`

        Social platform associated with this handle field.

        - `"TWITTER"`

        - `"LINKEDIN"`

        - `"FACEBOOK"`

        - `"INSTAGRAM"`

      - `multiple_values: Optional[bool]`

        Whether this field accepts multiple values.

      - `options: Optional[List[FieldDefinitionsTypeConfigurationOption]]`

        Available options for select fields.

        - `id: str`

          Unique identifier of the select option.

        - `label: str`

          Human-readable display name of the option.

        - `description: Optional[str]`

          Description of the option, or null.

        - `parent_id: Optional[str]`

          For a dependent select, the ID of the option in the parent field named by `typeConfiguration.parentFieldKey` that owns this option. Absent for ordinary selects.

      - `parent_field_key: Optional[str]`

        For a dependent select, the field key whose selected option determines which of this field's options apply. Absent for ordinary selects.

      - `unique: Optional[bool]`

        Whether values for this field must be unique.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      Data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

    - `id: Optional[str]`

      Unique identifier of the field definition.

    - `read_only: Optional[bool]`

      `true` for fields that are not writable via the API (e.g. AI-generated summaries). `false` or absent for writable fields.

  - `object_type: str`

    The object type these definitions belong to (e.g. `account`).

  - `relationship_definitions: Dict[str, RelationshipDefinitions]`

    Map of relationship keys to their definitions. Self-referential relationships include optional directional metadata on the bare definition.

    - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

      Whether this is a `has_one` or `has_many` relationship.

      - `"HAS_ONE"`

      - `"HAS_MANY"`

    - `description: Optional[str]`

      Description of the relationship, or null.

    - `label: str`

      Human-readable display name of the relationship.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `id: Optional[str]`

      Unique identifier of the relationship definition.

    - `directions: Optional[RelationshipDefinitionsDirections]`

      Directional metadata for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipDefinitionsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `label: str`

          Human-readable display name for this endpoint direction.

      - `as_source: RelationshipDefinitionsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `label: str`

          Human-readable display name for this endpoint direction.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_definitions_response = client.contact.definitions()
print(contact_definitions_response.field_definitions)
```

#### Response

```json
{
  "fieldDefinitions": {
    "foo": {
      "description": "description",
      "label": "label",
      "typeConfiguration": {
        "currency": "currency",
        "handleService": "TWITTER",
        "multipleValues": true,
        "options": [
          {
            "id": "id",
            "label": "label",
            "description": "description",
            "parentId": "parentId"
          }
        ],
        "parentFieldKey": "parentFieldKey",
        "unique": true
      },
      "valueType": "ADDRESS",
      "id": "id",
      "readOnly": true
    }
  },
  "objectType": "objectType",
  "relationshipDefinitions": {
    "foo": {
      "cardinality": "HAS_ONE",
      "description": "description",
      "label": "label",
      "objectType": "objectType",
      "id": "id",
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "label": "label"
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "label": "label"
        }
      }
    }
  }
}
```

## Get field value history

`contact.field_history(strfield_key, ContactFieldHistoryParams**kwargs)  -> ContactFieldHistoryResponse`

**get** `/v1/contacts/{id}/fields/{fieldKey}/history`

Returns the value-change history for a single field on a record, newest first. Consecutive identical values are collapsed. History is cursor-paginated: pass `nextCursor` from the previous response as `after` to page through older values. Only attribute-backed fields (custom attributes and attribute-backed system fields) have history — column-backed system fields return an error. A record you may see by name only has no visible history and returns 404, like a record that does not exist.

**[Required scope](/using-the-api/scopes/):** `contacts:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the record.

- `field_key: str`

  Field key whose value history to return. System fields use a `$` prefix (e.g. `$status`); custom attributes use their bare slug.

- `after: Optional[str]`

  Cursor from a previous response’s `nextCursor` to fetch the next page.

- `limit: Optional[int]`

  Maximum number of history entries to return. Defaults to 20, maximum 100.

### Returns

- `class ContactFieldHistoryResponse: …`

  - `data: List[Data]`

    Recorded values for the field, newest first.

    - `display_value: str`

      Human-readable rendering of the value (e.g. a select option label), suitable for display.

    - `is_create: bool`

      True for the record’s original value. Only set when the full history fits in the response (never on a truncated/paginated page).

    - `recorded_at: str`

      ISO 8601 timestamp of when this value was recorded.

    - `value: Optional[DataValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class DataValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class DataValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `has_more: bool`

    Whether more history exists beyond this page.

  - `next_cursor: Optional[str]`

    Cursor to pass as `after` to fetch the next page, or null when there are no more entries.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_field_history_response = client.contact.field_history(
    field_key="fieldKey",
    id="id",
)
print(contact_field_history_response.data)
```

#### Response

```json
{
  "data": [
    {
      "displayValue": "displayValue",
      "isCreate": true,
      "recordedAt": "recordedAt",
      "value": "string",
      "valueType": "ADDRESS"
    }
  ],
  "hasMore": true,
  "nextCursor": "nextCursor"
}
```

## Create a contact

`contact.create(ContactCreateParams**kwargs)  -> ContactCreateResponse`

**post** `/v1/contacts`

Creates a new contact record.

After creation, Lightfield automatically enriches the contact in the background unless `skipEnrichment` is true. Enrichment is a metered event, so when bulk-loading 50 or more records that do not require additional enrichment, we recommend setting `skipEnrichment` to true.

Supports idempotency via the `Idempotency-Key` header.

To avoid duplicates, we recommend a find-or-create pattern — use <u>[list filtering](/using-the-api/list-endpoints/#filtering)</u> to check if a record exists before creating.

**[Required scope](/using-the-api/scopes/):** `contacts:create`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `fields: Union[Dict[str, Optional[FieldsUntypedFieldsUntypedItem]]]`

  Field values for the new contact. System fields use a `$` prefix (e.g. `$email`, `$name`); custom attributes use their bare slug. Note: `$name` is an object `{ firstName, lastName }`, not a plain string. Call the <u>[definitions endpoint](/api/resources/contact/methods/definitions)</u> to discover available fields and their types. See <u>[Fields and relationships](/using-the-api/fields-and-relationships/)</u> for value type details.

  Read definitions for the object type’s configured `$pipeline` and `$stage` fields and options. See <u>[Pipelines and stages](/using-the-api/fields-and-relationships/#pipelines-and-stages)</u> for write rules.

  - `Dict[str, Optional[FieldsUntypedFieldsUntypedItem]]`

    - `str`

    - `float`

    - `bool`

    - `Sequence[str]`

    - `class FieldsUntypedFieldsUntypedItemAddress: …`

      - `city: Optional[str]`

        City name.

      - `country: Optional[str]`

        2-letter ISO 3166-1 alpha-2 country code.

      - `latitude: Optional[float]`

        Latitude coordinate.

      - `longitude: Optional[float]`

        Longitude coordinate.

      - `postal_code: Optional[str]`

        Postal or ZIP code.

      - `state: Optional[str]`

        State or province.

      - `street: Optional[str]`

        Street address line 1.

      - `street2: Optional[str]`

        Street address line 2.

    - `class FieldsUntypedFieldsUntypedItemFullName: …`

      - `first_name: Optional[str]`

        The contact's first name.

      - `last_name: Optional[str]`

        The contact's last name.

- `relationships: Optional[Union[Dict[str, Union[str, Sequence[str]]]]]`

  Relationships to set on the new contact. System relationships use a `$` prefix (e.g. `$account`); custom relationships use their bare slug. Each value is a single entity ID or an array of IDs. Call the <u>[definitions endpoint](/api/resources/contact/methods/definitions)</u> to list available relationship keys.

  - `Dict[str, Union[str, Sequence[str]]]`

    - `str`

    - `Sequence[str]`

- `skip_enrichment: Optional[bool]`

  Skip background enrichment for this contact creation. Defaults to false. Enrichment is a metered event, so when bulk-loading 50 or more records that do not require additional enrichment, we recommend `true`.

### Returns

- `class ContactCreateResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_create_response = client.contact.create(
    fields={
        "foo": "string"
    },
)
print(contact_create_response.id)
```

#### Response

```json
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ],
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        }
      }
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}
```

## Update a contact

`contact.update(strid, ContactUpdateParams**kwargs)  -> ContactUpdateResponse`

**post** `/v1/contacts/{id}`

Updates an existing contact by ID. Only included fields and relationships are modified.

Supports idempotency via the `Idempotency-Key` header.

**[Required scope](/using-the-api/scopes/):** `contacts:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the contact to update.

- `fields: Optional[Union[Dict[str, Optional[FieldsUntypedFieldsUntypedItem]]]]`

  Field values to update — only provided fields are modified; omitted fields are left unchanged. System fields use a `$` prefix (e.g. `$email`); custom attributes use their bare slug. Note: `$name` is an object `{ firstName, lastName }`, not a plain string. Call the <u>[definitions endpoint](/api/resources/contact/methods/definitions)</u> for available fields and types. See <u>[Fields and relationships](/using-the-api/fields-and-relationships/)</u> for value type details.

  Read definitions for the object type’s configured `$pipeline` and `$stage` fields and options. See <u>[Pipelines and stages](/using-the-api/fields-and-relationships/#pipelines-and-stages)</u> for write rules.

  - `Dict[str, Optional[FieldsUntypedFieldsUntypedItem]]`

    - `str`

    - `float`

    - `bool`

    - `Sequence[str]`

    - `class FieldsUntypedFieldsUntypedItemAddress: …`

      - `city: Optional[str]`

        City name.

      - `country: Optional[str]`

        2-letter ISO 3166-1 alpha-2 country code.

      - `latitude: Optional[float]`

        Latitude coordinate.

      - `longitude: Optional[float]`

        Longitude coordinate.

      - `postal_code: Optional[str]`

        Postal or ZIP code.

      - `state: Optional[str]`

        State or province.

      - `street: Optional[str]`

        Street address line 1.

      - `street2: Optional[str]`

        Street address line 2.

    - `class FieldsUntypedFieldsUntypedItemFullName: …`

      - `first_name: Optional[str]`

        The contact's first name.

      - `last_name: Optional[str]`

        The contact's last name.

- `relationships: Optional[Union[Dict[str, RelationshipsUntypedRelationshipsUntypedItem]]]`

  Relationship operations to apply. System relationships use a `$` prefix (e.g. `$account`). Each value is an operation object with `add`, `remove`, or `replace`.

  - `Dict[str, RelationshipsUntypedRelationshipsUntypedItem]`

    - `add: Optional[Union[str, Sequence[str]]]`

      Entity ID(s) to add to the relationship.

      - `str`

      - `Sequence[str]`

    - `remove: Optional[Union[str, Sequence[str]]]`

      Entity ID(s) to remove from the relationship.

      - `str`

      - `Sequence[str]`

    - `replace: Optional[str]`

      The entity ID to set as the relationship replacement, or null to clear supported relationships.

### Returns

- `class ContactUpdateResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_update_response = client.contact.update(
    id="id",
)
print(contact_update_response.id)
```

#### Response

```json
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ],
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        }
      }
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}
```

## Retrieve a contact

`contact.retrieve(strid)  -> ContactRetrieveResponse`

**get** `/v1/contacts/{id}`

Retrieves a single contact by its ID. A record you may see by name only is returned as `{ id, restricted: { name, reason } }`, with no `fields` or `relationships`; check for `restricted` before reading them.

**[Required scope](/using-the-api/scopes/):** `contacts:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the contact to retrieve.

### Returns

- `ContactRetrieveResponse`

  - `class Entity: …`

    - `id: str`

      Unique identifier for the entity.

    - `created_at: str`

      ISO 8601 timestamp of when the entity was created.

    - `fields: Dict[str, EntityFields]`

      Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

      - `value: Optional[EntityFieldsValue]`

        The field value, or null if unset.

        - `str`

        - `float`

        - `bool`

        - `List[str]`

        - `class EntityFieldsValueAddress: …`

          - `city: Optional[str]`

            City name.

          - `country: Optional[str]`

            2-letter ISO 3166-1 alpha-2 country code.

          - `latitude: Optional[float]`

            Latitude coordinate.

          - `longitude: Optional[float]`

            Longitude coordinate.

          - `postal_code: Optional[str]`

            Postal or ZIP code.

          - `state: Optional[str]`

            State or province.

          - `street: Optional[str]`

            Street address line 1.

          - `street2: Optional[str]`

            Street address line 2.

        - `class EntityFieldsValueFullName: …`

          - `first_name: Optional[str]`

            The contact's first name.

          - `last_name: Optional[str]`

            The contact's last name.

      - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

        The data type of the field.

        - `"ADDRESS"`

        - `"CHECKBOX"`

        - `"CURRENCY"`

        - `"DATE"`

        - `"DATETIME"`

        - `"EMAIL"`

        - `"FULL_NAME"`

        - `"MARKDOWN"`

        - `"MULTI_SELECT"`

        - `"NUMBER"`

        - `"SINGLE_SELECT"`

        - `"SOCIAL_HANDLE"`

        - `"TELEPHONE"`

        - `"TEXT"`

        - `"URL"`

        - `"HTML"`

    - `http_link: Optional[str]`

      URL to view the entity in the Lightfield web app, or null.

    - `relationships: Dict[str, EntityRelationships]`

      Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

      - `cardinality: str`

        Whether the relationship is `has_one` or `has_many`.

      - `object_type: str`

        The type of the related object (e.g. `account`, `contact`).

      - `values: List[str]`

        IDs of the related entities.

      - `directions: Optional[EntityRelationshipsDirections]`

        Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

        - `as_destination: EntityRelationshipsDirectionsAsDestination`

          The current record is the destination (incoming) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

        - `as_source: EntityRelationshipsDirectionsAsSource`

          The current record is the source (outgoing) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

    - `updated_at: Optional[str]`

      ISO 8601 timestamp of when the entity was last updated, or null.

    - `external_id: Optional[str]`

      External identifier for the entity, or null if unset.

  - `class Restricted: …`

    - `id: str`

      Unique identifier for the record, the same ID a full response carries.

    - `restricted: RestrictedRestricted`

      Present only on a record the caller may know exists but not read. Check for it before reading `fields` or `relationships`, which a restricted record does not carry.

      - `name: str`

        A label for the record's type, such as "Restricted opportunity". Never the record's name.

      - `reason: Literal["NO_ACCESS", "INHERITED"]`

        Why the record is restricted.

        - `"NO_ACCESS"`

        - `"INHERITED"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_retrieve_response = client.contact.retrieve(
    "id",
)
print(contact_retrieve_response)
```

#### Response

```json
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ],
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        }
      }
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}
```

## List contacts

`contact.list(ContactListParams**kwargs)  -> ContactListResponse`

**get** `/v1/contacts`

Returns a paginated list of contacts. Results are sorted by when the record was created in Lightfield (`createdAt`), newest first. Each page holds only the records you can currently read, so a page can contain fewer records than `limit`, or none, while more remain, and `totalCount` can include records you can no longer read. To read every record, keep advancing `offset` by `limit` until it reaches `totalCount`; do not stop at a short or empty page. Use `offset` and `limit` to paginate through results, and `$field` query parameters to filter. Pass `status=trashed` to list contacts currently in the trash instead of live records. Listing trashed records additionally requires the `contacts:restore` scope. See <u>[List endpoints](/using-the-api/list-endpoints/)</u> for more information about <u>[pagination](/using-the-api/list-endpoints/#pagination)</u> and <u>[filtering](/using-the-api/list-endpoints/#filtering)</u>.

**[Required scope](/using-the-api/scopes/):** `contacts:read`

**[Rate limit category](/using-the-api/rate-limits/):** Search

### Parameters

- `limit: Optional[int]`

  Maximum number of records to return. Defaults to 25, maximum 25.

- `offset: Optional[int]`

  Number of records to skip for pagination. Defaults to 0.

- `status: Optional[Literal["active", "trashed"]]`

  Which records to return by trash state. Defaults to "active". Use "trashed" to list records currently in the trash; this additionally requires this resource's `restore` scope.

  - `"active"`

  - `"trashed"`

### Returns

- `class ContactListResponse: …`

  - `data: List[Data]`

    Array of entity objects for the current page.

    - `id: str`

      Unique identifier for the entity.

    - `created_at: str`

      ISO 8601 timestamp of when the entity was created.

    - `fields: Dict[str, DataFields]`

      Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

      - `value: Optional[DataFieldsValue]`

        The field value, or null if unset.

        - `str`

        - `float`

        - `bool`

        - `List[str]`

        - `class DataFieldsValueAddress: …`

          - `city: Optional[str]`

            City name.

          - `country: Optional[str]`

            2-letter ISO 3166-1 alpha-2 country code.

          - `latitude: Optional[float]`

            Latitude coordinate.

          - `longitude: Optional[float]`

            Longitude coordinate.

          - `postal_code: Optional[str]`

            Postal or ZIP code.

          - `state: Optional[str]`

            State or province.

          - `street: Optional[str]`

            Street address line 1.

          - `street2: Optional[str]`

            Street address line 2.

        - `class DataFieldsValueFullName: …`

          - `first_name: Optional[str]`

            The contact's first name.

          - `last_name: Optional[str]`

            The contact's last name.

      - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

        The data type of the field.

        - `"ADDRESS"`

        - `"CHECKBOX"`

        - `"CURRENCY"`

        - `"DATE"`

        - `"DATETIME"`

        - `"EMAIL"`

        - `"FULL_NAME"`

        - `"MARKDOWN"`

        - `"MULTI_SELECT"`

        - `"NUMBER"`

        - `"SINGLE_SELECT"`

        - `"SOCIAL_HANDLE"`

        - `"TELEPHONE"`

        - `"TEXT"`

        - `"URL"`

        - `"HTML"`

    - `http_link: Optional[str]`

      URL to view the entity in the Lightfield web app, or null.

    - `relationships: Dict[str, DataRelationships]`

      Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

      - `cardinality: str`

        Whether the relationship is `has_one` or `has_many`.

      - `object_type: str`

        The type of the related object (e.g. `account`, `contact`).

      - `values: List[str]`

        IDs of the related entities.

      - `directions: Optional[DataRelationshipsDirections]`

        Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

        - `as_destination: DataRelationshipsDirectionsAsDestination`

          The current record is the destination (incoming) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

        - `as_source: DataRelationshipsDirectionsAsSource`

          The current record is the source (outgoing) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

    - `updated_at: Optional[str]`

      ISO 8601 timestamp of when the entity was last updated, or null.

    - `external_id: Optional[str]`

      External identifier for the entity, or null if unset.

  - `object: str`

    The object type, always `"list"`.

  - `total_count: int`

    Total number of entities matching the query.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_list_response = client.contact.list()
print(contact_list_response.data)
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "createdAt": "createdAt",
      "fields": {
        "foo": {
          "value": "string",
          "valueType": "ADDRESS"
        }
      },
      "httpLink": "httpLink",
      "relationships": {
        "foo": {
          "cardinality": "cardinality",
          "objectType": "objectType",
          "values": [
            "string"
          ],
          "directions": {
            "asDestination": {
              "cardinality": "HAS_ONE",
              "values": [
                "string"
              ]
            },
            "asSource": {
              "cardinality": "HAS_ONE",
              "values": [
                "string"
              ]
            }
          }
        }
      },
      "updatedAt": "updatedAt",
      "externalId": "externalId"
    }
  ],
  "object": "object",
  "totalCount": 0
}
```

## Delete a contact

`contact.delete(strid, ContactDeleteParams**kwargs)  -> ContactDeleteResponse`

**delete** `/v1/contacts/{id}`

Moves a contact to the trash. The contact is soft-deleted and may be restored from the Lightfield UI.

Calling delete on an already-trashed contact is a no-op and returns the existing record.

**[Required scope](/using-the-api/scopes/):** `contacts:delete`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the contact to delete.

- `body: Optional[Body]`

### Returns

- `class ContactDeleteResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_delete_response = client.contact.delete(
    id="id",
)
print(contact_delete_response.id)
```

#### Response

```json
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ],
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        }
      }
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}
```

## Restore a contact

`contact.restore(strid, ContactRestoreParams**kwargs)  -> ContactRestoreResponse`

**post** `/v1/contacts/{id}/restore`

Restores a trashed contact, bringing it back to active. Find trashed contacts via `GET /v1/contacts?status=trashed`.

Calling restore on a contact that is not trashed is a no-op and returns the existing record.

**[Required scope](/using-the-api/scopes/):** `contacts:restore`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the contact to restore.

- `body: Optional[Body]`

### Returns

- `class ContactRestoreResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
contact_restore_response = client.contact.restore(
    id="id",
)
print(contact_restore_response.id)
```

#### Response

```json
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ],
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "values": [
            "string"
          ]
        }
      }
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}
```

## Domain Types

### Contact Create Response

- `class ContactCreateResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.

### Contact Definitions Response

- `class ContactDefinitionsResponse: …`

  - `field_definitions: Dict[str, FieldDefinitions]`

    Map of field keys to their definitions, including both system and custom fields.

    - `description: Optional[str]`

      Description of the field, or null.

    - `label: str`

      Human-readable display name of the field.

    - `type_configuration: FieldDefinitionsTypeConfiguration`

      Type-specific configuration (e.g. select options, currency code).

      - `currency: Optional[str]`

        ISO 4217 3-letter currency code.

      - `handle_service: Optional[Literal["TWITTER", "LINKEDIN", "FACEBOOK", "INSTAGRAM"]]`

        Social platform associated with this handle field.

        - `"TWITTER"`

        - `"LINKEDIN"`

        - `"FACEBOOK"`

        - `"INSTAGRAM"`

      - `multiple_values: Optional[bool]`

        Whether this field accepts multiple values.

      - `options: Optional[List[FieldDefinitionsTypeConfigurationOption]]`

        Available options for select fields.

        - `id: str`

          Unique identifier of the select option.

        - `label: str`

          Human-readable display name of the option.

        - `description: Optional[str]`

          Description of the option, or null.

        - `parent_id: Optional[str]`

          For a dependent select, the ID of the option in the parent field named by `typeConfiguration.parentFieldKey` that owns this option. Absent for ordinary selects.

      - `parent_field_key: Optional[str]`

        For a dependent select, the field key whose selected option determines which of this field's options apply. Absent for ordinary selects.

      - `unique: Optional[bool]`

        Whether values for this field must be unique.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      Data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

    - `id: Optional[str]`

      Unique identifier of the field definition.

    - `read_only: Optional[bool]`

      `true` for fields that are not writable via the API (e.g. AI-generated summaries). `false` or absent for writable fields.

  - `object_type: str`

    The object type these definitions belong to (e.g. `account`).

  - `relationship_definitions: Dict[str, RelationshipDefinitions]`

    Map of relationship keys to their definitions. Self-referential relationships include optional directional metadata on the bare definition.

    - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

      Whether this is a `has_one` or `has_many` relationship.

      - `"HAS_ONE"`

      - `"HAS_MANY"`

    - `description: Optional[str]`

      Description of the relationship, or null.

    - `label: str`

      Human-readable display name of the relationship.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `id: Optional[str]`

      Unique identifier of the relationship definition.

    - `directions: Optional[RelationshipDefinitionsDirections]`

      Directional metadata for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipDefinitionsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `label: str`

          Human-readable display name for this endpoint direction.

      - `as_source: RelationshipDefinitionsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `label: str`

          Human-readable display name for this endpoint direction.

### Contact Delete Response

- `class ContactDeleteResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.

### Contact Field History Response

- `class ContactFieldHistoryResponse: …`

  - `data: List[Data]`

    Recorded values for the field, newest first.

    - `display_value: str`

      Human-readable rendering of the value (e.g. a select option label), suitable for display.

    - `is_create: bool`

      True for the record’s original value. Only set when the full history fits in the response (never on a truncated/paginated page).

    - `recorded_at: str`

      ISO 8601 timestamp of when this value was recorded.

    - `value: Optional[DataValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class DataValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class DataValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `has_more: bool`

    Whether more history exists beyond this page.

  - `next_cursor: Optional[str]`

    Cursor to pass as `after` to fetch the next page, or null when there are no more entries.

### Contact List Response

- `class ContactListResponse: …`

  - `data: List[Data]`

    Array of entity objects for the current page.

    - `id: str`

      Unique identifier for the entity.

    - `created_at: str`

      ISO 8601 timestamp of when the entity was created.

    - `fields: Dict[str, DataFields]`

      Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

      - `value: Optional[DataFieldsValue]`

        The field value, or null if unset.

        - `str`

        - `float`

        - `bool`

        - `List[str]`

        - `class DataFieldsValueAddress: …`

          - `city: Optional[str]`

            City name.

          - `country: Optional[str]`

            2-letter ISO 3166-1 alpha-2 country code.

          - `latitude: Optional[float]`

            Latitude coordinate.

          - `longitude: Optional[float]`

            Longitude coordinate.

          - `postal_code: Optional[str]`

            Postal or ZIP code.

          - `state: Optional[str]`

            State or province.

          - `street: Optional[str]`

            Street address line 1.

          - `street2: Optional[str]`

            Street address line 2.

        - `class DataFieldsValueFullName: …`

          - `first_name: Optional[str]`

            The contact's first name.

          - `last_name: Optional[str]`

            The contact's last name.

      - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

        The data type of the field.

        - `"ADDRESS"`

        - `"CHECKBOX"`

        - `"CURRENCY"`

        - `"DATE"`

        - `"DATETIME"`

        - `"EMAIL"`

        - `"FULL_NAME"`

        - `"MARKDOWN"`

        - `"MULTI_SELECT"`

        - `"NUMBER"`

        - `"SINGLE_SELECT"`

        - `"SOCIAL_HANDLE"`

        - `"TELEPHONE"`

        - `"TEXT"`

        - `"URL"`

        - `"HTML"`

    - `http_link: Optional[str]`

      URL to view the entity in the Lightfield web app, or null.

    - `relationships: Dict[str, DataRelationships]`

      Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

      - `cardinality: str`

        Whether the relationship is `has_one` or `has_many`.

      - `object_type: str`

        The type of the related object (e.g. `account`, `contact`).

      - `values: List[str]`

        IDs of the related entities.

      - `directions: Optional[DataRelationshipsDirections]`

        Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

        - `as_destination: DataRelationshipsDirectionsAsDestination`

          The current record is the destination (incoming) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

        - `as_source: DataRelationshipsDirectionsAsSource`

          The current record is the source (outgoing) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

    - `updated_at: Optional[str]`

      ISO 8601 timestamp of when the entity was last updated, or null.

    - `external_id: Optional[str]`

      External identifier for the entity, or null if unset.

  - `object: str`

    The object type, always `"list"`.

  - `total_count: int`

    Total number of entities matching the query.

### Contact Restore Response

- `class ContactRestoreResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.

### Contact Retrieve Response

- `ContactRetrieveResponse`

  - `class Entity: …`

    - `id: str`

      Unique identifier for the entity.

    - `created_at: str`

      ISO 8601 timestamp of when the entity was created.

    - `fields: Dict[str, EntityFields]`

      Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

      - `value: Optional[EntityFieldsValue]`

        The field value, or null if unset.

        - `str`

        - `float`

        - `bool`

        - `List[str]`

        - `class EntityFieldsValueAddress: …`

          - `city: Optional[str]`

            City name.

          - `country: Optional[str]`

            2-letter ISO 3166-1 alpha-2 country code.

          - `latitude: Optional[float]`

            Latitude coordinate.

          - `longitude: Optional[float]`

            Longitude coordinate.

          - `postal_code: Optional[str]`

            Postal or ZIP code.

          - `state: Optional[str]`

            State or province.

          - `street: Optional[str]`

            Street address line 1.

          - `street2: Optional[str]`

            Street address line 2.

        - `class EntityFieldsValueFullName: …`

          - `first_name: Optional[str]`

            The contact's first name.

          - `last_name: Optional[str]`

            The contact's last name.

      - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

        The data type of the field.

        - `"ADDRESS"`

        - `"CHECKBOX"`

        - `"CURRENCY"`

        - `"DATE"`

        - `"DATETIME"`

        - `"EMAIL"`

        - `"FULL_NAME"`

        - `"MARKDOWN"`

        - `"MULTI_SELECT"`

        - `"NUMBER"`

        - `"SINGLE_SELECT"`

        - `"SOCIAL_HANDLE"`

        - `"TELEPHONE"`

        - `"TEXT"`

        - `"URL"`

        - `"HTML"`

    - `http_link: Optional[str]`

      URL to view the entity in the Lightfield web app, or null.

    - `relationships: Dict[str, EntityRelationships]`

      Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

      - `cardinality: str`

        Whether the relationship is `has_one` or `has_many`.

      - `object_type: str`

        The type of the related object (e.g. `account`, `contact`).

      - `values: List[str]`

        IDs of the related entities.

      - `directions: Optional[EntityRelationshipsDirections]`

        Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

        - `as_destination: EntityRelationshipsDirectionsAsDestination`

          The current record is the destination (incoming) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

        - `as_source: EntityRelationshipsDirectionsAsSource`

          The current record is the source (outgoing) endpoint.

          - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

            Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

            - `"HAS_ONE"`

            - `"HAS_MANY"`

          - `values: List[str]`

            IDs of the related entities in this direction.

    - `updated_at: Optional[str]`

      ISO 8601 timestamp of when the entity was last updated, or null.

    - `external_id: Optional[str]`

      External identifier for the entity, or null if unset.

  - `class Restricted: …`

    - `id: str`

      Unique identifier for the record, the same ID a full response carries.

    - `restricted: RestrictedRestricted`

      Present only on a record the caller may know exists but not read. Check for it before reading `fields` or `relationships`, which a restricted record does not carry.

      - `name: str`

        A label for the record's type, such as "Restricted opportunity". Never the record's name.

      - `reason: Literal["NO_ACCESS", "INHERITED"]`

        Why the record is restricted.

        - `"NO_ACCESS"`

        - `"INHERITED"`

### Contact Update Response

- `class ContactUpdateResponse: …`

  - `id: str`

    Unique identifier for the entity.

  - `created_at: str`

    ISO 8601 timestamp of when the entity was created.

  - `fields: Dict[str, Fields]`

    Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug.

    - `value: Optional[FieldsValue]`

      The field value, or null if unset.

      - `str`

      - `float`

      - `bool`

      - `List[str]`

      - `class FieldsValueAddress: …`

        - `city: Optional[str]`

          City name.

        - `country: Optional[str]`

          2-letter ISO 3166-1 alpha-2 country code.

        - `latitude: Optional[float]`

          Latitude coordinate.

        - `longitude: Optional[float]`

          Longitude coordinate.

        - `postal_code: Optional[str]`

          Postal or ZIP code.

        - `state: Optional[str]`

          State or province.

        - `street: Optional[str]`

          Street address line 1.

        - `street2: Optional[str]`

          Street address line 2.

      - `class FieldsValueFullName: …`

        - `first_name: Optional[str]`

          The contact's first name.

        - `last_name: Optional[str]`

          The contact's last name.

    - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 13 more]`

      The data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATE"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

  - `http_link: Optional[str]`

    URL to view the entity in the Lightfield web app, or null.

  - `relationships: Dict[str, Relationships]`

    Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). A self-referential relationship keeps its merged values and includes optional directional values. List filters select the current record's role with `:asSource` or `:asDestination`, for example `?parent:asSource[contains]=account_id`.

    - `cardinality: str`

      Whether the relationship is `has_one` or `has_many`.

    - `object_type: str`

      The type of the related object (e.g. `account`, `contact`).

    - `values: List[str]`

      IDs of the related entities.

    - `directions: Optional[RelationshipsDirections]`

      Directional values for a self-referential relationship. List filters use the relationship key with `:asSource` or `:asDestination`; writes continue to use the bare key.

      - `as_destination: RelationshipsDirectionsAsDestination`

        The current record is the destination (incoming) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

      - `as_source: RelationshipsDirectionsAsSource`

        The current record is the source (outgoing) endpoint.

        - `cardinality: Literal["HAS_ONE", "HAS_MANY"]`

          Whether this endpoint direction is `HAS_ONE` or `HAS_MANY`.

          - `"HAS_ONE"`

          - `"HAS_MANY"`

        - `values: List[str]`

          IDs of the related entities in this direction.

  - `updated_at: Optional[str]`

    ISO 8601 timestamp of when the entity was last updated, or null.

  - `external_id: Optional[str]`

    External identifier for the entity, or null if unset.
