Skip to content

feat(docs): add suggested_email to the customer object and update_customer - #1692

Merged
oliwiapolec merged 11 commits into
masterfrom
EUEE-1740-suggested-email
Sep 10, 2026
Merged

feat(docs): add suggested_email to the customer object and update_customer#1692
oliwiapolec merged 11 commits into
masterfrom
EUEE-1740-suggested-email

Conversation

@mdojwa

@mdojwa mdojwa commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

PR information

What does this PR do?

Documents a new public field, suggested_email: an email address captured for a customer without their confirmation. The widget can propose one; an agent accepts it (sets email, clears the suggestion) or dismisses it. It never keys identity merging and never counts towards a segment, including the built-in lead segments — though a customer holding only a suggestion is still returned by the customer list. It is independent of email: both can be set at once, and only an explicit accept or dismiss removes the suggestion.

Backend PR chain: https://github.com/livechat/api/pull/6203 and the ten PRs stacked on it. This PR should merge together with them, not before.

Where the field shows up

Agent Chat API Customer Chat API
Customer data structure
get_customer (Web + RTM)
update_customer (Web + RTM)
login request (RTM) customer.suggested_email
customer_updated push

Versions: 3.6 and 3.7, with one real difference

The field exists in 3.6 and 3.7 only, following phone_number and address.

Both versions model it as a nullable string, so an empty value clears a suggestion in either — the field therefore joins the existing "Allows to clear the values of…" sentence on the 3.7 pages, and the 3.6 tables say plainly that an empty value clears it.

This is not the usual 3.6/3.7 split. name, email, phone_number and address cannot be cleared in 3.6 because their shapes were frozen when that version shipped; suggested_email is new in 3.6, so nothing depended on it collapsing an empty value into an absent one, and an agent or widget on 3.6 can dismiss a suggestion.

On login an omitted field means "leave it alone", never "clear it" — only an explicit empty value dismisses.

Not in this PR

src/configs/redoc/customer-data-platform-api/spec.yml is untouched — the documentation team syncs it from the monorepo CDP spec, which gains the field in https://github.com/livechat/api/pull/6342.

Type of change

  • Update
  • New feature
  • Fix

Deploy preview

The deploy preview link will appear in the checks section below once the build is complete.


Also fixed here, in separate commits

  • phone_number and omnichannel on the v3.7 Agent Customer table — the page looks branched from before they landed in 3.6 and never caught up. Both are real in 3.7 (agent-api/parsers/3.7/objects.go, and both SDKs on their v3.7 branches). Restored in their 3.6 positions.
  • phone_number on the customer update_customercustomer-api has accepted it since 3.6 (validated as E.164) and both SDKs expose it; only the docs were missing it, on all four pages.

Pre-existing drift noticed, deliberately not fixed

The Customer SDK updateCustomer reference lists only name, email and sessionFields. That page documents the chat-widget SDK, a different package from lc-sdk-js — out of scope here.

@mdojwa
mdojwa force-pushed the EUEE-1740-suggested-email branch 2 times, most recently from d4e230b to 4d1ab61 Compare August 27, 2026 10:08
…tomer

EUEE-1740. `suggested_email` holds an email address captured for a customer
without their confirmation - the widget can propose one, and an agent accepts or
dismisses it. It never keys identity merging and never counts towards a segment,
including the built-in lead segments, although a customer holding only a
suggestion is still returned by the customer list.

The field exists in 3.6 and 3.7 only, following `phone_number` and `address`.
The two versions differ on one point: 3.7 models it as a nullable string, so an
empty value clears a suggestion, while 3.6 collapses an empty value to "field
not sent" - and since the empty value then counts as no update at all, a 3.6
`update_customer` request carrying nothing else fails validation. That is the
same split that already applies to `name`, `email`, `phone_number` and
`address`, so the field joins the "Allows to clear the values of..." sentence on
the 3.7 pages, and the 3.6 tables spell out that clearing needs 3.7.

Both APIs get read and write coverage: the Customer data structure,
`get_customer`, `update_customer` and the `customer_updated` push. Customer Chat
API additionally documents `customer.suggested_email` on `login`, which accepts
it the way it already accepts `phone_number`; on that method an omitted field
means "leave it alone" and only an explicit empty value clears a suggestion.

The Agent Chat API push sample uses the acceptance shape - a confirmed `email`
together with an empty `suggested_email` - because a delta carrying a valid
`email` and a non-empty suggestion cannot occur: the backend applies `email`
first and then drops the suggestion.

The Customer Data Platform spec under src/configs/redoc is deliberately left
alone: the documentation team syncs it from the monorepo spec.
@mdojwa
mdojwa force-pushed the EUEE-1740-suggested-email branch from 4d1ab61 to 92783b4 Compare August 28, 2026 06:58
mdojwa added 2 commits August 28, 2026 13:12
The v3.7 Agent Chat API Customer table lost both fields at some point - the page
looks like it was branched before they landed in 3.6 and was never caught up.
Both are real in 3.7: services/agent-api/parsers/3.7/objects.go carries
PhoneNumber and Omnichannel on UserCustomer, and both lc-sdk-go and lc-sdk-js
declare them on the agent Customer in their v3.7 branches.

Restored in the positions they hold in the 3.6 table.
customer-api has accepted `phone_number` on `update_customer` since 3.6
(services/customer-api/parsers/3.{6,7}/methods/update_customer.go, validated as
E.164), and both SDKs expose it on the customer side - lc-sdk-go's
customer.UpdateCustomer takes it and lc-sdk-js declares it on the customer
CustomerParameters, on v3.6 and v3.7 alike. Only the docs were missing it, on
all four pages: Web and RTM, both versions.

Placed after `avatar`, the position it holds on the agent pages.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Documents suggested_email across Agent and Customer Chat APIs for v3.6/v3.7.

Changes:

  • Adds field, update, retrieval, login, push, and changelog documentation.
  • Documents version-specific clearing behavior.
  • Restores missing phone_number and omnichannel fields.
File summaries
File Description
src/pages/messaging/customer-chat-api/v3.7/rtm-reference/index.mdx Updates v3.7 RTM methods.
src/pages/messaging/customer-chat-api/v3.7/rtm-pushes/index.mdx Explains cleared suggestions.
src/pages/messaging/customer-chat-api/v3.7/index.mdx Updates v3.7 Web methods.
src/pages/messaging/customer-chat-api/v3.7/data-structures/index.mdx Adds the customer field.
src/pages/messaging/customer-chat-api/rtm-reference/index.mdx Updates v3.6 RTM methods.
src/pages/messaging/customer-chat-api/rtm-pushes/index.mdx Documents push semantics.
src/pages/messaging/customer-chat-api/index.mdx Updates v3.6 Web methods.
src/pages/messaging/customer-chat-api/data-structures/index.mdx Adds the v3.6 field.
src/pages/messaging/customer-chat-api/changelog/index.mdx Records Customer API changes.
src/pages/messaging/agent-chat-api/v3.7/rtm-reference/index.mdx Updates v3.7 RTM methods.
src/pages/messaging/agent-chat-api/v3.7/rtm-pushes/index.mdx Adds acceptance push example.
src/pages/messaging/agent-chat-api/v3.7/index.mdx Updates v3.7 Web methods.
src/pages/messaging/agent-chat-api/v3.7/data-structures/index.mdx Adds and restores customer fields.
src/pages/messaging/agent-chat-api/rtm-reference/index.mdx Updates v3.6 RTM methods.
src/pages/messaging/agent-chat-api/rtm-pushes/index.mdx Adds suggestion-clearing semantics.
src/pages/messaging/agent-chat-api/index.mdx Updates v3.6 Web methods.
src/pages/messaging/agent-chat-api/data-structures/index.mdx Adds the v3.6 field.
src/pages/messaging/agent-chat-api/changelog/index.mdx Records Agent API changes.
payloads/messaging/v3.7/customer-chat-api/users/customer.json Adds the field to fixture.
payloads/messaging/v3.7/agent-chat-api/users/customer.json Adds the field to fixture.
payloads/messaging/v3.6/customer-chat-api/users/customer.json Adds the field to fixture.
payloads/messaging/v3.6/agent-chat-api/users/customer.json Adds the field to fixture.
Review details
  • Files reviewed: 22/22 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/pages/messaging/customer-chat-api/v3.7/rtm-reference/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/changelog/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/v3.7/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/rtm-reference/index.mdx Outdated
Comment thread src/pages/messaging/agent-chat-api/rtm-reference/index.mdx Outdated
mdojwa and others added 7 commits August 31, 2026 09:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
suggested_email is stored as sent, like every other customer field: the
confirmed email does not hold a suggestion back, and the address format is
not checked on the way in - matching email, which documents neither.
The field is new in 3.6, so it is modelled as a nullable string there as
well - it never had the frozen plain-string shape that stops email and
phone_number from being cleared in that version.
Comment thread src/pages/messaging/agent-chat-api/changelog/index.mdx Outdated
Comment thread src/pages/messaging/agent-chat-api/data-structures/index.mdx Outdated
Comment thread src/pages/messaging/agent-chat-api/rtm-reference/index.mdx Outdated
Comment thread src/pages/messaging/agent-chat-api/rtm-reference/index.mdx Outdated
Comment thread src/pages/messaging/agent-chat-api/v3.7/data-structures/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/v3.7/rtm-reference/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/v3.7/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/v3.7/index.mdx Outdated
Comment thread src/pages/messaging/customer-chat-api/index.mdx Outdated
Co-authored-by: oliwiapolec <54406259+oliwiapolec@users.noreply.github.com>
@mdojwa
mdojwa requested a review from oliwiapolec September 8, 2026 09:24
@oliwiapolec
oliwiapolec merged commit 7a0e1ae into master Sep 10, 2026
8 checks passed
@oliwiapolec
oliwiapolec deleted the EUEE-1740-suggested-email branch September 10, 2026 09:11
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.104.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants