> ## 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.

# Ticket

> Event payload details and trigger documentation for Ticket 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 Ticket event payload from Hubspot.

* `Hubspot Ticket Created`
* `Hubspot Ticket Properties Updated`
* `Hubspot Ticket Deleted`
* `Hubspot Ticket Restored`
* `Hubspot Ticket Merged`
* `Hubspot Ticket 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_contact_id": "123456",
    "associated_contacts": [
      {
        "id": "39580875173",
        "type": "contact_to_company"
      }
    ],
    "associated_deals": [
      {
        "id": "39580875173",
        "type": "contact_to_company"
      }
    ],
    "created_at": "2024-07-04T10:32:12+00:00",
    "id": "2970281109",
    "pipeline_id": "123456",
    "properties": {
      "content": "Ticket description",
      "createdate": "2024-07-16T10:41:02.266Z",
      "hs_lastmodifieddate": "2024-07-16T14:27:29.505Z",
      "hs_object_id": "2970281109",
      "hs_pipeline": "0",
      "hs_pipeline_stage": "1",
      "subject": "My Subject"
    },
    "recently_updated_property_names": [
      "subject",
      "hs_pipeline_stage"
    ],
    "updated_at": "2024-07-04T10:32:12+00:00"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Description theme={null}
  {
    "archived": "Whether the ticket was archived",
    "archived_at": "When the ticket was archived",
    "associated_companies": {
      "id": "ID",
      "type": "Type (label) of the association"
    },
    "associated_contact_id": "The ID of the associated contact, or the first associated contact if there are multiple",
    "associated_contacts": {
      "id": "ID",
      "type": "Type (label) of the association"
    },
    "associated_deals": {
      "id": "ID",
      "type": "Type (label) of the association"
    },
    "created_at": "When the ticket was created",
    "id": "ID",
    "pipeline_id": "The ID of the pipeline the ticket is associated with",
    "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 ticket was updated"
  }
  ```
</ResponseExample>

### Payload Field Details

<ResponseField name="Ticket" 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}
      "2970281109"
      ```
    </ResponseField>

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

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

      ```json Example theme={null}
      {
      "content": "Ticket description",
      "createdate": "2024-07-16T10:41:02.266Z",
      "hs_lastmodifieddate": "2024-07-16T14:27:29.505Z",
      "hs_object_id": "2970281109",
      "hs_pipeline": "0",
      "hs_pipeline_stage": "1",
      "subject": "My Subject"
      }
      ```
    </ResponseField>

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

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

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

    <ResponseField name="archived_at" type="timing.v1.Timestamp">
      When the ticket 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 ticket 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 ticket 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}
      [
      "subject",
      "hs_pipeline_stage"
      ]
      ```
    </ResponseField>

    <ResponseField name="pipeline_id" type="string" required>
      The ID of the pipeline the ticket is associated with

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

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

    <ResponseField name="associated_contact_id" type="string">
      The ID of the associated contact, or the first associated contact if there are multiple

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

      ```json Example theme={null}
      "123456"
      ```
    </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_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>
