Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions fern/definition/inboxes/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <inbox_id> --message-id <id1> --message-id <id2>
```
request: messages.BatchGetMessagesRequest
response: messages.BatchGetMessagesResponse
errors:
- global.ValidationError

getAttachment:
method: GET
path: /{message_id}/attachments/{attachment_id}
Expand Down
23 changes: 23 additions & 0 deletions fern/definition/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,29 @@ types:
type: list<MessageItem>
docs: Ordered by `timestamp` descending.

BatchGetMessagesMessageIds:
type: list<MessageId>
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<Message>
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:
Expand Down
Loading