> For the complete documentation index, see [llms.txt](https://flapjax.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flapjax.gitbook.io/docs/rest-api/reference/people-events/update-email-consent.md).

# Update Email Consent

## Update email consent

> Updates a person's email marketing consent preference. Identify the person by providing exactly \*\*one\*\* of \`internal\_id\` (UUID) or \`external\_id\`.\
> \
> Set \`allow\` to \`true\` to opt the person in to email marketing, or \`false\` to opt them out. This uses patch semantics internally — only the email consent field is changed; all other person data remains untouched.\
> \
> The flag summarises the person's consent answers on the email channel: \`false\` refuses every consent purpose on the channel, \`true\` grants only the purpose marked as that channel's default and leaves the other purposes on their own defaults. To answer individual purposes, send \`consents\` on the person \`PATCH\` endpoint instead.\
> \
> Returns a 400 error if you provide both identifiers or neither.<br>

```json
{"openapi":"3.0.3","info":{"title":"Listener API","version":"1.0.0"},"tags":[{"name":"update-email-consent"}],"servers":[{"url":"https://{domain}/v1","variables":{"domain":{"default":"your-domain","description":"Your deployment domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token with the required scope for the endpoint. Pass via the `Authorization: Bearer <token>` header.\n"}},"schemas":{"ConsentUpdateRequest":{"type":"object","description":"Request body for updating a person's consent preference. Provide exactly one of `internal_id` or `external_id` to identify the person.\n","required":["allow"],"properties":{"internal_id":{"type":"string","description":"Internal UUID of the person. Provide this **or** `external_id`, not both.\n"},"external_id":{"type":"string","description":"External identifier of the person. Provide this **or** `internal_id`, not both.\n"},"allow":{"type":"boolean","description":"Set to `true` to opt in, or `false` to opt out."}}},"SuccessResponse":{"type":"object","description":"Standard success response envelope.","properties":{"status":{"type":"string","enum":["Success"]},"data":{"type":"boolean"}}},"ErrorResponse":{"type":"object","description":"Standard error response envelope.","properties":{"error":{"type":"string","description":"Machine-readable error type. Use this for programmatic error handling.\n","enum":["operation_failed","failed_binding_json","invalid_json","invalid_parameter","not_found","duplicate_entry","rate_limit_exceeded"]},"errorstack":{"type":"object","nullable":true,"description":"Detailed error stack (only present for server errors)."}}}}},"paths":{"/people/email-consent":{"put":{"summary":"Update email consent","operationId":"updateEmailConsent","tags":["update-email-consent"],"description":"Updates a person's email marketing consent preference. Identify the person by providing exactly **one** of `internal_id` (UUID) or `external_id`.\n\nSet `allow` to `true` to opt the person in to email marketing, or `false` to opt them out. This uses patch semantics internally — only the email consent field is changed; all other person data remains untouched.\n\nThe flag summarises the person's consent answers on the email channel: `false` refuses every consent purpose on the channel, `true` grants only the purpose marked as that channel's default and leaves the other purposes on their own defaults. To answer individual purposes, send `consents` on the person `PATCH` endpoint instead.\n\nReturns a 400 error if you provide both identifiers or neither.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentUpdateRequest"}}}},"responses":{"200":{"description":"Consent updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid identifier or validation failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Person not found or internal error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
