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

# Update Communication Preferences

> Documentation for the Update Communication Preferences action for Hubspot

![images/hubspot.svg](https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/hubspot.svg?fit=max\&auto=format\&n=EU2WCxuXGIUQcziR\&q=85\&s=2c859a5e64b7620515d906bc05e45339)

# Parameters

**Action** `Parameters`

**parameters**

**Subscriber ID** `string` *required*

`ID` `PII`
This field maps to the destination API `subscriber_id_string` field.

**Channel** `hubspot.v1.CommunicationChannel` *required*

This field maps to the destination API `channel` field.

```json Allowed Enumeration Values theme={null}
COMMUNICATION_CHANNEL_EMAIL
```

**Status State** `hubspot.v1.CommunicationStatusState` *required*

This field maps to the destination API `status_state` field.

```json Allowed Enumeration Values theme={null}
COMMUNICATION_STATUS_STATE_SUBSCRIBED
COMMUNICATION_STATUS_STATE_UNSUBSCRIBED
COMMUNICATION_STATUS_STATE_NOT_SPECIFIED
```

**Subscription ID** `string (Subscription ID)` *required*

This field maps to the destination API `subscription_id` field.

**Legal Basis** `hubspot.v1.LegalBasis`

This field maps to the destination API `legal_basis` field.

```json Allowed Enumeration Values theme={null}
LEGAL_BASIS_LEGITIMATE_INTEREST_PQL
LEGAL_BASIS_LEGITIMATE_INTEREST_CLIENT
LEGAL_BASIS_PERFORMANCE_OF_CONTRACT
LEGAL_BASIS_CONSENT_WITH_NOTICE
LEGAL_BASIS_NON_GDPR
LEGAL_BASIS_PROCESS_AND_STORE
LEGAL_BASIS_LEGITIMATE_INTEREST_OTHER
```

**Legal Basis Explanation** `string`

This field maps to the destination API `legal_basis_explanation` field.

```json Result Object Example theme={null}
{
  "$result_object_key": {
    "completed_at": null,
    "results": [
      {
        "business_unit_id": null,
        "channel": "EMAIL",
        "legal_basis": "LEGITIMATE_INTEREST_PQL",
        "legal_basis_explanation": null,
        "set_status_success_reason": "REQUESTED_CHANGE_OCCURRED",
        "source": "Self Service Resubscription",
        "status": "UNSUBSCRIBED",
        "subscriber_id_string": "user@example.com",
        "subscription_id": "12345",
        "subscription_name": "Marketing Information",
        "timestamp": null
      }
    ],
    "started_at": null,
    "status": "COMPLETE"
  }
}
```

```json Result Object Description theme={null}
{
  "$result_object_key": {
    "completed_at": "The timestamp when the operation completed",
    "results": {
      "business_unit_id": "The business unit ID",
      "channel": "The communication channel",
      "legal_basis": "The legal basis for the subscription status",
      "legal_basis_explanation": "The legal basis explanation",
      "set_status_success_reason": "The reason the status was set successfully",
      "source": "The source of the subscription status",
      "status": "The status of this subscription update",
      "subscriber_id_string": "The contact identifier (email or contact ID)",
      "subscription_id": "The unique identifier of the subscription",
      "subscription_name": "The name of the subscription",
      "timestamp": "The timestamp of the status change"
    },
    "started_at": "The timestamp when the operation started",
    "status": "The status of the operation"
  }
}
```

### Result Object Field Details

You can use the result of the action's data as inputs to downstream workflow actions.

Each fetch action requires an object name, which nests the action's result data inside the downstream data context in the workflow. See [Passing Data Between Actions](https://docs.morf.health/docs/knowledge_base/passing_data_between_actions.md) for how to set it and reference the result from downstream nodes.

Here we demonstrate how to refer to this data using the prefix `$result_object_key`.

**UpdateCommunicationPreferencesResult** `Fetch Action Response Object`

**fields**

**completed\_at** `timing.v1.Timestamp` *required*

The timestamp when the operation completed

```json CEL theme={null}
$result_object_key.completed_at
```

```json Example theme={null}
null
```

**started\_at** `timing.v1.Timestamp` *required*

The timestamp when the operation started

```json CEL theme={null}
$result_object_key.started_at
```

```json Example theme={null}
null
```

**status** `hubspot.v1.CommunicationPreferencesStatus` *required*

The status of the operation

```json CEL theme={null}
$result_object_key.status
```

```json Example theme={null}
hubspot.v1.CommunicationPreferencesStatus.COMMUNICATION_PREFERENCES_STATUS_PENDING
hubspot.v1.CommunicationPreferencesStatus.COMMUNICATION_PREFERENCES_STATUS_PROCESSING
hubspot.v1.CommunicationPreferencesStatus.COMMUNICATION_PREFERENCES_STATUS_CANCELED
hubspot.v1.CommunicationPreferencesStatus.COMMUNICATION_PREFERENCES_STATUS_COMPLETE
```

**results** `[]object` *required*

Per-subscription update results

```json CEL theme={null}
$result_object_key.results
```

```json Example theme={null}
[
{
"business_unit_id": null,
"channel": "EMAIL",
"legal_basis": "LEGITIMATE_INTEREST_PQL",
"legal_basis_explanation": null,
"set_status_success_reason": "REQUESTED_CHANGE_OCCURRED",
"source": "Self Service Resubscription",
"status": "UNSUBSCRIBED",
"subscriber_id_string": "user@example.com",
"subscription_id": "12345",
"subscription_name": "Marketing Information",
"timestamp": null
}
]
```

**channel** `hubspot.v1.CommunicationChannel` *required*

Mapped array of: The communication channel

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

```json Example theme={null}
hubspot.v1.CommunicationChannel.COMMUNICATION_CHANNEL_EMAIL
```

**status** `hubspot.v1.CommunicationStatusState` *required*

Mapped array of: The status of this subscription update

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

```json Example theme={null}
hubspot.v1.CommunicationStatusState.COMMUNICATION_STATUS_STATE_SUBSCRIBED
hubspot.v1.CommunicationStatusState.COMMUNICATION_STATUS_STATE_UNSUBSCRIBED
hubspot.v1.CommunicationStatusState.COMMUNICATION_STATUS_STATE_NOT_SPECIFIED
```

**results.map(x, x.subscriber\_id\_string)** `[]string` *required*

`PII` Mapped array of: The contact identifier (email or contact ID)

```json CEL theme={null}
$result_object_key.results.map(x, x.subscriber_id_string)
```

```json Example theme={null}
[
"user@example.com"
]
```

**results.map(x, x.subscription\_id)** `[]int64` *required*

Mapped array of: The unique identifier of the subscription

```json CEL theme={null}
$result_object_key.results.map(x, x.subscription_id)
```

```json Example theme={null}
[
"12345"
]
```

**results.map(x, x.subscription\_name)** `[]string` *required*

Mapped array of: The name of the subscription

```json CEL theme={null}
$result_object_key.results.map(x, x.subscription_name)
```

```json Example theme={null}
[
"Marketing Information"
]
```

**results.map(x, x.timestamp)** `[]timing.v1.Timestamp` *required*

Mapped array of: The timestamp of the status change

```json CEL theme={null}
$result_object_key.results.map(x, x.timestamp)
```

```json Example theme={null}
[
null
]
```

**legal\_basis** `hubspot.v1.LegalBasis`

Mapped array of: The legal basis for the subscription status

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

```json Example theme={null}
hubspot.v1.LegalBasis.LEGAL_BASIS_LEGITIMATE_INTEREST_PQL
hubspot.v1.LegalBasis.LEGAL_BASIS_LEGITIMATE_INTEREST_CLIENT
hubspot.v1.LegalBasis.LEGAL_BASIS_PERFORMANCE_OF_CONTRACT
hubspot.v1.LegalBasis.LEGAL_BASIS_CONSENT_WITH_NOTICE
hubspot.v1.LegalBasis.LEGAL_BASIS_NON_GDPR
hubspot.v1.LegalBasis.LEGAL_BASIS_PROCESS_AND_STORE
hubspot.v1.LegalBasis.LEGAL_BASIS_LEGITIMATE_INTEREST_OTHER
```

**set\_status\_success\_reason** `hubspot.v1.SetStatusSuccessReason` *required*

Mapped array of: The reason the status was set successfully

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

```json Example theme={null}
hubspot.v1.SetStatusSuccessReason.SET_STATUS_SUCCESS_REASON_NO_STATUS_CHANGE
hubspot.v1.SetStatusSuccessReason.SET_STATUS_SUCCESS_REASON_REQUESTED_CHANGE_OCCURRED
hubspot.v1.SetStatusSuccessReason.SET_STATUS_SUCCESS_REASON_RESUBSCRIBE_OCCURRED
hubspot.v1.SetStatusSuccessReason.SET_STATUS_SUCCESS_REASON_UNSUBSCRIBE_FROM_ALL_OCCURRED
```

**results.map(x, x.legal\_basis\_explanation)** `[]string` *required*

Mapped array of: The legal basis explanation

```json CEL theme={null}
$result_object_key.results.map(x, x.legal_basis_explanation)
```

```json Example theme={null}
[
null
]
```

**results.map(x, x.business\_unit\_id)** `[]int64` *required*

Mapped array of: The business unit ID

```json CEL theme={null}
$result_object_key.results.map(x, x.business_unit_id)
```

```json Example theme={null}
[
null
]
```

**results.map(x, x.source)** `[]string` *required*

Mapped array of: The source of the subscription status

```json CEL theme={null}
$result_object_key.results.map(x, x.source)
```

```json Example theme={null}
[
"Self Service Resubscription"
]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.