> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interaction

> Calendar events and emails

Interactions are quite a generic concept, used to model when a given actor interacted with a record in a particular way. Presently, Attio has just two types of interaction:

* Email interactions (`first_email_interaction` and `last_email_interaction`)
* Calendar interactions (`first_calendar_interaction`, `last_calendar_interaction` and `next_calendar_interaction`)

These attributes are available on both the Company and Person objects, although they are enriched and not available on every billing plan. For more information about these attributes, [please see our Enriched data help page](https://attio.com/help/reference/data-and-syncing/enriched-data#communication-intelligence).

### Reading values

Interaction attribute values have an `interaction_type` property, which can be either `"email"` or `"calendar-event"`, and an `interacted_at` timestamp property in ISO8601 format.

There is also an `owner_actor` property, which is an object relating the [actor](/docs/actors) who created this interaction (this is different from the `created_by` attribute value property which could be e.g. a system actor).

<CodeGroup>
  ```jsonc Example: last email received by Tom on 2023-11-25 theme={"system"}
  {
    "active_from": "2023-11-25T15:21:06.447000000Z",
    "active_until": null,
    "created_by_actor": {
      "type": "system",
      "id": null
    },
    "attribute_type": "interaction",
    "interaction_type": "email",
    "interacted_at": "2023-11-25T15:21:06.447000000Z",
    "owner_actor": {
      "type": "workspace-member",
      "id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b" // Tom
    }
  }
  ```
</CodeGroup>

### Writing values

It is not currently possible to write Interaction values, they are only created by the Attio system.

### Filtering

There are three properties of interactions that can be used in filtering:

* `owner_member_id` filters by the workspace member ID that is the `owner_actor`, this supports `$eq` and `$not_empty` operators
* `interacted_at` (timestamp) supports `$eq`, `$gte`, `$gt`, `$lte` and `$lt` operators
* `interaction_type` can also be filtered by `$eq` and `$not_empty`

<CodeGroup>
  ```json Companies ... which have had an email interaction theme={"system"}
  {
    "filter": {
      "last_email_interaction": {
        "owner_member_id": {
          "$not_empty": true
        }
      }
    }
  }
  ```

  ```json ... with whom Tom had a recent meeting theme={"system"}
  {
    "filter": {
      "last_calendar_interaction": {
        "owner_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b",
        "interacted_at": {
          "$gte": "2023-11-01"
        }
      }
    }
  }
  ```

  ```json ... via email theme={"system"}
  {
    "filter": {
      "first_email_interaction": {
        "interaction_type": "email"
      }
    }
  }
  ```
</CodeGroup>
