# Channel preferences

Python inputs, results, permissions and executable examples for channel preferences.

Use this reference with the [complete developer tour](https://beepgrid.com/docs/sdks/python/tour.md) and [Python types](https://beepgrid.com/docs/sdks/python/types.md). The example at the end runs after the tour setup.

## delivery_preferences

Read a Person's versioned delivery defaults and Agent/Agent-role overrides.

```text
delivery_preferences(self, person_id: str)
```

| Parameter | Type and default | Usage |
| --- | --- | --- |
| `person_id` | `str` (required) | Stable recipient Person identity ID. |

**Returns:** DeliveryPreferences with person_id, version, default and ordered overrides.

**Permissions, lifecycle and errors:** Person self, administrator or authorized identity manager only. Reload after a stale-version conflict; preferences grant no contact authority.

[Working Python example](https://beepgrid.com/docs/sdks/python/channels/#example). Input/output fields are in the [types reference](https://beepgrid.com/docs/sdks/python/types.md).

## save_delivery_preferences

Save a Person's channel policy using its observed version.

```text
save_delivery_preferences(self, person_id: str, preferences: dict[str, Any])
```

| Parameter | Type and default | Usage |
| --- | --- | --- |
| `person_id` | `str` (required) | Stable recipient Person identity ID. |
| `preferences` | `dict[str, Any]` (required) | The recipient delivery preferences to save, including the observed version, default policy and ordered overrides. |

**Returns:** DeliveryPreferences with the incremented version; pending external sends from the previous configuration stop.

**Permissions, lifecycle and errors:** Person self, administrator or authorized identity manager only. Reload after a stale-version conflict; preferences grant no contact authority.

[Working Python example](https://beepgrid.com/docs/sdks/python/channels/#example). Input/output fields are in the [types reference](https://beepgrid.com/docs/sdks/python/types.md).

## Example

Run this region after [the shared setup](https://beepgrid.com/docs/sdks/python/tour.md). Assertions check the returned data; the full tour is a runnable program.



```python
preferences = owner.delivery_preferences(person_id)
saved_preferences = owner.save_delivery_preferences(person_id, {
    'version': preferences['version'],
    'default': {'mode': 'preferred', 'destinations': [], 'followup_seconds': 0},
    'overrides': []})
assert saved_preferences['version'] > preferences['version']
```
