--- title: customerEmailMarketingConsentUpdate - GraphQL Admin description: Update a customer's email marketing information information. api_version: 2025-10 api_name: admin type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerEmailMarketingConsentUpdate md: https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerEmailMarketingConsentUpdate.md --- # customer​Email​Marketing​Consent​Update mutation Requires `write_customers` access scope. Update a customer's email marketing information information. ## Arguments * input [Customer​Email​Marketing​Consent​Update​Input!](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/CustomerEmailMarketingConsentUpdateInput) required Specifies the input fields to update a customer's email marketing consent information. *** ## Customer​Email​Marketing​Consent​Update​Payload returns * customer [Customer](https://shopify.dev/docs/api/admin-graphql/latest/objects/Customer) The updated customer. * user​Errors [\[Customer​Email​Marketing​Consent​Update​User​Error!\]!](https://shopify.dev/docs/api/admin-graphql/latest/objects/CustomerEmailMarketingConsentUpdateUserError) non-null The list of errors that occurred from executing the mutation. *** ## Examples * ### customerEmailMarketingConsentUpdate reference ## Mutation Reference ```graphql mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) { customerEmailMarketingConsentUpdate(input: $input) { customer { # Customer fields } userErrors { field message } } } ``` ## Input ```json { "input": { "customerId": "gid://shopify//10079785100", "emailMarketingConsent": { "marketingOptInLevel": "SINGLE_OPT_IN", "marketingState": "NOT_SUBSCRIBED", "consentUpdatedAt": "2019-09-07T15:50:00Z", "sourceLocationId": "gid://shopify//10079785100" } } } ``` ##### Variables ``` { "input": { "customerId": "gid://shopify//10079785100", "emailMarketingConsent": { "marketingOptInLevel": "SINGLE_OPT_IN", "marketingState": "NOT_SUBSCRIBED", "consentUpdatedAt": "2019-09-07T15:50:00Z", "sourceLocationId": "gid://shopify//10079785100" } } } ``` ##### Schema ``` input CustomerEmailMarketingConsentUpdateInput { customerId: ID! emailMarketingConsent: CustomerEmailMarketingConsentInput! } input CustomerEmailMarketingConsentInput { marketingOptInLevel: CustomerMarketingOptInLevel marketingState: CustomerEmailMarketingState! consentUpdatedAt: DateTime sourceLocationId: ID } ```