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

# contacts.setConsent

> Record that a customer opted out of messages, or back in.

When a customer changes their email preferences in your product, tell the CRM so it stops, or starts again, messaging them.

```ts theme={null}
const [contact, error] = await crm.contacts.setConsent({ partyId: contact.id, unsubscribed: true });
```

**partyId** `string` *required*

The CRM's id for the customer, from [`contacts.upsert`](https://docs.revenuebee.ai/sdk/upsert-contact) or
[`contacts.resolve`](https://docs.revenuebee.ai/sdk/resolve-contact).

**unsubscribed** `boolean` *required*

`true` when they opted out, `false` when they opted back in.

## Returns

The contact, with `unsubscribed` as now set.


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