From fd97971b8a8afcdc356f295093003b697b95f5eb Mon Sep 17 00:00:00 2001 From: duharry0915 Date: Sun, 10 May 2026 18:23:54 -0700 Subject: [PATCH] adding batch get message --- fern/definition/inboxes/messages.yml | 18 ++++++++++++++++++ fern/definition/messages.yml | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/fern/definition/inboxes/messages.yml b/fern/definition/inboxes/messages.yml index ea63744..82ec4e8 100644 --- a/fern/definition/inboxes/messages.yml +++ b/fern/definition/inboxes/messages.yml @@ -55,6 +55,24 @@ service: errors: - global.NotFoundError + batchGet: + method: POST + path: /batch-get + display-name: Batch Get Messages + docs: | + Fetch metadata for up to 500 messages in one request. Missing or + restricted IDs are silently omitted; compare `count` against `limit` + to detect misses. + + **CLI:** + ```bash + agentmail inboxes:messages batch-get --inbox-id --message-id --message-id + ``` + request: messages.BatchGetMessagesRequest + response: messages.BatchGetMessagesResponse + errors: + - global.ValidationError + getAttachment: method: GET path: /{message_id}/attachments/{attachment_id} diff --git a/fern/definition/messages.yml b/fern/definition/messages.yml index 503896f..398e67b 100644 --- a/fern/definition/messages.yml +++ b/fern/definition/messages.yml @@ -145,6 +145,29 @@ types: type: list docs: Ordered by `timestamp` descending. + BatchGetMessagesMessageIds: + type: list + docs: | + IDs of messages to fetch. Maximum 500 ids per request. Duplicates are + rejected with a validation error. IDs not found in the inbox (including + cross-inbox or permission-restricted) are silently omitted from the + response; callers detect misses by comparing `count` against `limit`. + + BatchGetMessagesRequest: + properties: + message_ids: BatchGetMessagesMessageIds + + BatchGetMessagesResponse: + properties: + limit: global.Limit + count: global.Count + messages: + type: list + docs: | + Found messages. Order matches `message_ids` in the request. Body + fields (`text`, `html`, `extracted_text`, `extracted_html`) are + never populated; use the single-message endpoint to retrieve bodies. + RawMessageResponse: docs: S3 presigned URL to download the raw .eml file. properties: