Repository navigation
Document the contact identifiers accepted when creating a conversation - #749
yasser-aboelgheit-intercom wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cathalging
left a comment
There was a problem hiding this comment.
One wording fix. user_id only matches contacts with the user role, so type: lead with a user_id returns a 404. With type: lead, email matches leads, and fails with multiple_users if several leads share it. Suggested for 2.17 and Preview:
user_id:
description: The external identifier you gave the user. Matches users only; for a lead, use `id` or `email`.
email:
description: The contact's email. Matches a user or a lead, depending on `type`. If several leads share the email, the request fails with `multiple_users`; use `id` instead.@yasser-aboelgheit-intercom, your call: fix this here, or approve as-is and take the wording as a follow-up?
~ Automated via Claude (about: https://github.com/intercom/claude-plugins/blob/main/plugins/base/docs/external-message-attribution.md)
cathalging
left a comment
There was a problem hiding this comment.
Approving. The point in my earlier comment is your call: fix it here or take it as a follow-up.
~ Automated via Claude (about: https://github.com/intercom/claude-plugins/blob/main/plugins/base/docs/external-message-attribution.md)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
yasser-aboelgheit-intercom
left a comment
There was a problem hiding this comment.
Thanks for this. I checked it with the spec comparator, ref checks, and fern check (0 errors, same warnings as main), and checked each claim against how the API behaves.
A few questions:
- Lookup order — Should the
fromdescriptions say thatemailis used only whenuser_idisn't sent? The API triesidfirst, whatever thetype. Next it triesuser_id, thenemail, but only when nouser_idwas given. Sotype: leadwith bothuser_idandemailignores the email and returns 404 "User Not Found". Something like "If you send more than one,idis used first, thenuser_id.emailis used only when neither is sent." multiple_users— This error (400) only happens whentypeisleadandemailis the only identifier sent. Withidoruser_idas well, the request never returns it. Could theemaildescription say so?- Dropping
contactfromfrom.type— This matches the API: from 2.6 afrom.typeofcontactis treated as an admin. It returns 404not_foundwith anid, or 400parameter_invalidwithout one. But removing an enum value from 2.17, and from the Preview SDK'sfrom.type, is a breaking schema change. Could someone who owns the public contract sign off before merge?
Holding approval until item 3 has that sign-off.
~ Automated via Claude
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
yasser-aboelgheit-intercom
left a comment
There was a problem hiding this comment.
Thanks for the follow-up. I re-ran the spec comparator, ref checks and fern check (0 errors, same warnings as main, no new unknown types in the Preview SDK), and rechecked the new wording against how the API behaves.
Resolved:
- Lookup order — "
idis used first, thenuser_id" and "email... used only whenuser_idisn't sent" match the API. Anidthat doesn't match falls back to the other identifiers, andemailis tried only when nouser_idwas given. This is more accurate than my earlier suggestion. multiple_users— "If several leads share the email and it's the only identifier sent" matches the API. The 400 only happens whentypeisleadand neitheridnoruser_idis sent.
Nothing is wrong with the new wording.
Still open:
- Dropping
contactfromfrom.type— Unchanged by this commit. Removing an enum value from 2.17, and from the Preview SDKfrom.type, is a breaking schema change. Could someone who owns the public contract sign off before merge?
Holding approval until item 3 has that sign-off.
~ Automated via Claude
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Why?
Creating a conversation finds the contact by any one of
from.id,from.user_idorfrom.email, but the spec requiredidand didn't list the other two.How?
Lists all three identifiers with only
typerequired, in 2.17 and Preview. In the Preview SDK,from.idbecomes optional andfrom.user_idandfrom.emailare added.Generated with Claude Code