Skip to content

feat: add a search filter to messages.list - #27

Merged
tuyakhov merged 1 commit into
mainfrom
claude/gallant-einstein-q7okur
Aug 31, 2026
Merged

tuyakhov merged 1 commit into
mainfrom
claude/gallant-einstein-q7okur

Conversation

@tuyakhov

Copy link
Copy Markdown
Contributor

Summary

Mirrors the new search filter on the messages list endpoint
(GET /v1/messages) for the Python SDK, keeping it in sync with the
TypeScript and PHP clients.

search is a case-insensitive substring match over a message's public id,
recipient, template slug, and metadata keys/values. It composes with the
existing filters and cursor pagination; use metadata for an exact match.
Terms are capped at 512 characters by the API.

Changes

  • messages.list() and messages.iter() (and their async equivalents,
    AsyncMessages.list() / aiter()) accept a search keyword argument.
  • list_messages_query() serializes it as the search query param (omitted
    when None).
  • Test coverage extended to assert search is forwarded on the request.
  • README updated with the new option.

Verified locally: pytest (82 passed), ruff check, and mypy src all pass.

🤖 Generated with Claude Code


Generated by Claude Code

`messages.list` / `messages.iter` (and their async equivalents) accept a
`search` argument, forwarded as the `search` query param — a
case-insensitive substring match over a message's public id, recipient,
template slug, and metadata keys/values. Use `metadata` for an exact
match; terms are capped at 512 characters by the API.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018sQnT9HQ2y7oiMdygaPPdv
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tuyakhov
tuyakhov merged commit f3dbde7 into main Aug 31, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants