# Channel preferences

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

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

## DeliveryPreferences

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

```text
func (c *Client) DeliveryPreferences(ctx context.Context, person string) (DeliveryPreferences, error)
```

| Parameter | Type and default | Usage |
| --- | --- | --- |
| `ctx` | `context.Context` (required) | Required Go context. Cancellation bounds this local call; it does not withdraw a durable request. |
| `person` | `string` (required) | Person identity projection; present only for a person caller. |

**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 Go example](https://beepgrid.com/docs/sdks/go/channels/#example). Input/output fields are in the [types reference](https://beepgrid.com/docs/sdks/go/types.md).

## SaveDeliveryPreferences

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

```text
func (c *Client) SaveDeliveryPreferences(ctx context.Context, person string, in DeliveryPreferences) (DeliveryPreferences, error)
```

| Parameter | Type and default | Usage |
| --- | --- | --- |
| `ctx` | `context.Context` (required) | Required Go context. Cancellation bounds this local call; it does not withdraw a durable request. |
| `person` | `string` (required) | Person identity projection; present only for a person caller. |
| `in` | `DeliveryPreferences` (required) | Typed operation input. Every field is listed in the language types reference. |

**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 Go example](https://beepgrid.com/docs/sdks/go/channels/#example). Input/output fields are in the [types reference](https://beepgrid.com/docs/sdks/go/types.md).

## Example

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



```go
preferences := must(owner.DeliveryPreferences(ctx, me.Person.ID))
savedPreferences := must(owner.SaveDeliveryPreferences(ctx, me.Person.ID, beepgrid.DeliveryPreferences{Version: preferences.Version,
	Default: &beepgrid.ChannelPolicy{Mode: "preferred", Destinations: []string{}, FollowupSeconds: 0}, Overrides: []beepgrid.ChannelOverride{}}))
check(savedPreferences.Version > preferences.Version)
```
