> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Update the current customer's marketing consent

**Published**: 2026-11-30
**Category**: Commerce

## `PATCH /customers/me/marketing-consent`

**Update the current customer's marketing consent**

Opts the signed-in customer in or out of marketing on one channel, or on every channel
with `channel: "all"`. Send `optIn: true` to opt in and `optIn: false` to opt out.

On an opt-in, the optional `locale` and `consentVersion` record the language and
version of the consent text the buyer saw. An opt-out ignores them and keeps the
record of the earlier opt-in.

Returns 200 with the updated `{ channels }`. A customer whose email is not verified
gets 403 `CUSTOMER_EMAIL_NOT_VERIFIED`. Without a valid session token, returns 401
`CUSTOMER_AUTH_REQUIRED`.

> **Note:** Available only on sites with e-commerce enabled.

### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `channel` | "whatsapp" \| "email" \| "all" | Yes | Required. One of: whatsapp, email, all |
| `optIn` | boolean | Yes | Required. Opt-in verb: true re-opts the channel in, false opts it out (opt-out always wins). |
| `locale` | string | No | Language of the consent text, recorded with an opt-in. An opt-out or an unusable value is ignored |
| `consentVersion` | string | No | Label of the consent text shown, recorded with an opt-in. Cut to 100 characters; an unusable value is ignored. |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Missing or invalid storefront publishable key or customer session token |
| `402` | The site subscription does not currently permit this operation |
| `403` | The storefront key origin is not allowed |
| `404` | Site, resource, or commerce feature not found |
| `422` | Validation error |


### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({
  siteId: process.env.LYNKOW_SITE_ID!,
  publishableKey: process.env.LYNKOW_PK,
})

await lynkow.customers.marketingConsent.update({ channel: 'email', optIn: false })
```

---