Preview: conversation part type filtering parameters - #653
Open
robertlangner-fin wants to merge 6 commits into
Open
Preview: conversation part type filtering parameters#653robertlangner-fin wants to merge 6 commits into
robertlangner-fin wants to merge 6 commits into
Conversation
Adds include_part_types and exclude_part_types query parameters to
GET /conversations/{id} in the Preview spec, mirroring
intercom/intercom#568321.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The filter is gated on a Preview-only version change, not the 2.6 part type change, so it is not available on released versions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Matches the comma-separated query params on /content/search, so generated clients get a list rather than one opaque string. maxItems encodes the 50-value cap the endpoint already enforces. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The parameters accepted any string with no indication of what the 115 valid names are, and a wrong value is a hard 422. State the rule instead of an enum: the values are the names this version returns in part_type, which stays true as part types are added, since name_to_type_ids derives them from subclass_types rather than a maintained list. Call out the two names that surprise callers. "comment" is the fallback the read path uses for any id it does not recognise, so filtering on it matches a broader set than its name suggests. Type 13 serializes as note_and_unsnooze here but note_and_reopen below 2.6, so a pinned integration moving to Preview hits a 422 on the name it has been receiving. Also point conversation_part.part_type at the filters, since that field is where a caller discovers the vocabulary. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The parameter descriptions said an invalid filter returns a 422, but the operation only declared 200, 404, 401 and 403, so the generated contract had no shape for the error a caller is most likely to hit. Adds a 422 with the four messages part_type_filter actually raises, all carrying the parameter_invalid code that raise_invalid_param emits, and the shared error schema. Also carries over the conversation parts limit note that only landed in developer-docs, so the source of truth is not missing a sentence its downstream copy has. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Drop the version number from both parameter descriptions — say Preview-only instead.
|
AddConversationPartTypeFiltering ships with define_is_ready_for_release false, so the 2.17 cut will not pick it up and naming that version would go stale on release day. A version can be named once the change is marked ready. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
Conversation part events (assignments, snoozes, workflow steps, etc.) get mixed in with the real messages on a conversation, and the parts limit means those events can crowd out the messages a caller actually wants. There was previously no way to ask for just the part types you care about.
How?
Adds two optional, mutually exclusive query parameters to the Preview spec for retrieving a single conversation: one to keep only the part types you name, the other to drop them. Both accept up to 50 comma-separated values and are applied before the parts limit, so you get the newest matching parts.
Available on Preview only; any other version returns a 422.
Generated with Claude Code