Skip to content

Account-level getMessages with filters and a cursor iterator - #2

Merged
vernu merged 3 commits into
mainfrom
feat/account-level-get-messages
Aug 9, 2026
Merged

Account-level getMessages with filters and a cursor iterator#2
vernu merged 3 commits into
mainfrom
feat/account-level-get-messages

Conversation

@vernu

@vernu vernu commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Companion to the API's new GET /gateway/messages endpoint.

  • getMessages(options) targets the account-level endpoint: deviceIds, smsBatchId, direction, status, search, from/to (Date or string, serialized to the explicit-timezone form the API requires), order, cursor.
  • The device-scoped getMessages(deviceId, options) form is removed rather than deprecated: the SDK just launched with no consumers, so there is nothing to keep compatible. 0.0.x installs keep working against the still-served device-scoped route.
  • iterateMessages(options) is an async generator that follows meta.nextCursor until exhaustion, so pollers do not hand-roll the cursor loop.
  • Message gains direction (lowercase, feeds straight back into filters), channel, and the populated device object; type is deprecated in TSDoc.
  • Version bumped to 0.1.0. Publish after merge.

🤖 Generated with Claude Code

vernu and others added 3 commits August 9, 2026 13:06
getMessages(options) now calls GET /gateway/messages with deviceIds,
direction, status, search, from/to, order, and cursor support; the
device-scoped getMessages(deviceId, options) form keeps working but is
marked deprecated. iterateMessages() follows the pagination cursor to
drain every match, which is the loop pollers would otherwise hand-roll.
Message gains direction, channel, and device fields.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The SDK is days old with no consumers, so getMessages takes a single
options object and always calls the account-level endpoint. Anyone on
0.0.x keeps working against the still-served device-scoped route.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vernu
vernu merged commit 2fe4c83 into main Aug 9, 2026
1 check passed
@vernu
vernu deleted the feat/account-level-get-messages branch August 9, 2026 10:51
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.

1 participant