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

# Contact

> Event payload details and trigger documentation for Contact data from Hubspot

<img src="https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/hubspot.svg?fit=max&auto=format&n=EU2WCxuXGIUQcziR&q=85&s=2c859a5e64b7620515d906bc05e45339" alt="images/hubspot.svg" width="40" height="40" data-path="images/hubspot.svg" />

# Events

## Triggering Webhook Types

The following event types are associated with the Contact event payload from Hubspot.

* `Hubspot Contact Created`
* `Hubspot Contact Merged`
* `Hubspot Contact Deleted`
* `Hubspot Contact Restored`
* `Hubspot Contact Properties Updated`
* `Hubspot Contact Associations Updated`

<RequestExample>
  ```json Example theme={null}
  {
    "archived": false,
    "archived_at": "2024-07-04T10:32:12+00:00",
    "associated_companies": [
      {
        "id": "39580875173",
        "type": "contact_to_company"
      }
    ],
    "associated_contacts": [
      {
        "id": "39580875173",
        "type": "contact_to_company"
      }
    ],
    "associated_deals": [
      {
        "id": "39580875173",
        "type": "contact_to_company"
      }
    ],
    "associated_tickets": [
      {
        "id": "39580875173",
        "type": "contact_to_company"
      }
    ],
    "created_at": "2024-07-04T10:32:12+00:00",
    "id": "39580875173",
    "properties": {
      "email": "john.smith@gmail.com",
      "firstname": "John",
      "lastname": "Smith"
    },
    "recently_updated_property_names": [
      "email",
      "firstname",
      "lastname"
    ],
    "updated_at": "2024-07-04T10:32:12+00:00"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Description theme={null}
  {
    "archived": "Whether the contact was archived",
    "archived_at": "When the contact was archived",
    "associated_companies": {
      "id": "ID",
      "type": "Type (label) of the association"
    },
    "associated_contacts": {
      "id": "ID",
      "type": "Type (label) of the association"
    },
    "associated_deals": {
      "id": "ID",
      "type": "Type (label) of the association"
    },
    "associated_tickets": {
      "id": "ID",
      "type": "Type (label) of the association"
    },
    "created_at": "When the contact was created",
    "id": "ID",
    "properties": {
      "key": null,
      "value": null
    },
    "recently_updated_property_names": "The properties that were updated for a webhook event triggering this event payload to be created",
    "updated_at": "When the contact was updated"
  }
  ```
</ResponseExample>

### Payload Field Details

<ResponseField name="Contact" type="Event Payload">
  <Expandable title="fields" defaultOpen="true">
    <ResponseField name="id" type="string" required>
      `ID` ID

      ```json CEL theme={null}
      id
      ```

      ```json Example theme={null}
      "39580875173"
      ```
    </ResponseField>

    <ResponseField name="properties" type="Map<string,string>" required>
      `HI` `ID` `PII` Contact properties

      ```json CEL theme={null}
      properties
      ```

      ```json Example theme={null}
      {
      "email": "john.smith@gmail.com",
      "firstname": "John",
      "lastname": "Smith"
      }
      ```
    </ResponseField>

    <ResponseField name="archived" type="bool" required>
      Whether the contact was archived

      ```json CEL theme={null}
      archived
      ```

      ```json Example theme={null}
      false
      ```
    </ResponseField>

    <ResponseField name="archived_at" type="timing.v1.Timestamp">
      When the contact was archived

      ```json CEL theme={null}
      archived_at
      ```

      ```json Example theme={null}
      "2024-07-04T10:32:12+00:00"
      ```
    </ResponseField>

    <ResponseField name="created_at" type="timing.v1.Timestamp" required>
      When the contact was created

      ```json CEL theme={null}
      created_at
      ```

      ```json Example theme={null}
      "2024-07-04T10:32:12+00:00"
      ```
    </ResponseField>

    <ResponseField name="updated_at" type="timing.v1.Timestamp" required>
      When the contact was updated

      ```json CEL theme={null}
      updated_at
      ```

      ```json Example theme={null}
      "2024-07-04T10:32:12+00:00"
      ```
    </ResponseField>

    <ResponseField name="recently_updated_property_names" type="[]string" required>
      The properties that were updated for a webhook event triggering this event payload to be created

      ```json CEL theme={null}
      recently_updated_property_names
      ```

      ```json Example theme={null}
      [
      "email",
      "firstname",
      "lastname"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_contacts" type="[]object" required>
      Associated contacts

      ```json CEL theme={null}
      associated_contacts
      ```

      ```json Example theme={null}
      [
      {
      "id": "39580875173",
      "type": "contact_to_company"
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_contacts.map(x, x.id)" type="[]string" required>
      Mapped array of: ID

      ```json CEL theme={null}
      associated_contacts.map(x, x.id)
      ```

      ```json Example theme={null}
      [
      "39580875173"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_contacts.map(x, x.type)" type="[]string" required>
      Mapped array of: Type (label) of the association

      ```json CEL theme={null}
      associated_contacts.map(x, x.type)
      ```

      ```json Example theme={null}
      [
      "contact_to_company"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_deals" type="[]object" required>
      Associated deals

      ```json CEL theme={null}
      associated_deals
      ```

      ```json Example theme={null}
      [
      {
      "id": "39580875173",
      "type": "contact_to_company"
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_deals.map(x, x.id)" type="[]string" required>
      Mapped array of: ID

      ```json CEL theme={null}
      associated_deals.map(x, x.id)
      ```

      ```json Example theme={null}
      [
      "39580875173"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_deals.map(x, x.type)" type="[]string" required>
      Mapped array of: Type (label) of the association

      ```json CEL theme={null}
      associated_deals.map(x, x.type)
      ```

      ```json Example theme={null}
      [
      "contact_to_company"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_tickets" type="[]object" required>
      Associated tickets

      ```json CEL theme={null}
      associated_tickets
      ```

      ```json Example theme={null}
      [
      {
      "id": "39580875173",
      "type": "contact_to_company"
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_tickets.map(x, x.id)" type="[]string" required>
      Mapped array of: ID

      ```json CEL theme={null}
      associated_tickets.map(x, x.id)
      ```

      ```json Example theme={null}
      [
      "39580875173"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_tickets.map(x, x.type)" type="[]string" required>
      Mapped array of: Type (label) of the association

      ```json CEL theme={null}
      associated_tickets.map(x, x.type)
      ```

      ```json Example theme={null}
      [
      "contact_to_company"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_companies" type="[]object" required>
      Associated companies

      ```json CEL theme={null}
      associated_companies
      ```

      ```json Example theme={null}
      [
      {
      "id": "39580875173",
      "type": "contact_to_company"
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_companies.map(x, x.id)" type="[]string" required>
      Mapped array of: ID

      ```json CEL theme={null}
      associated_companies.map(x, x.id)
      ```

      ```json Example theme={null}
      [
      "39580875173"
      ]
      ```
    </ResponseField>

    <ResponseField name="associated_companies.map(x, x.type)" type="[]string" required>
      Mapped array of: Type (label) of the association

      ```json CEL theme={null}
      associated_companies.map(x, x.type)
      ```

      ```json Example theme={null}
      [
      "contact_to_company"
      ]
      ```
    </ResponseField>
  </Expandable>
</ResponseField>
