Skip to main content
GET
/
inbox_messages
/
{id}
JavaScript
import Moonbase from '@moonbaseai/sdk';

const client = new Moonbase({
  apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});

const emailMessage = await client.inboxMessages.retrieve('id');

console.log(emailMessage.id);
{
"id": "1CLJt2v17V1yuCdrUwA4PW",
"type": "email_message",
"body": {
"markdown": "html"
},
"created_at": "2025-02-17T16:00:00.000Z",
"unread": false,
"bulk": false,
"spam": false,
"trash": false,
"draft": false,
"subject": "subject",
"summary": "Summary"
}

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Path Parameters

id
string
required

The ID of the Message to retrieve.

Query Parameters

include[]
enum<string>[]

Specifies which related objects to include in the response. Valid options are addresses, attachments, and conversation.

Available options:
addresses,
attachments,
conversation

Response

Successful response.

The Email Message object represents a single email within a Conversation.

type
string
required

String representing the object’s type. Always email_message for this object.

Allowed value: "email_message"
id
string
required

Unique identifier for the object.

created_at
string<date-time>
required

The time the message was received, as an ISO 8601 timestamp in UTC.

unread
boolean
required

true if the message has not been read.

bulk
boolean
required

true if the message appears to be part of a bulk mailing.

spam
boolean
required

true if the message is classified as spam.

trash
boolean
required

true if the message is in the trash.

draft
boolean
required

true if the message is a draft that has not been sent.

subject
string
required

The subject line of the email.

body
FormattedText · object
required

Structured content that can be rendered in multiple formats, currently supporting Markdown.

summary
string

A concise, system-generated summary of the email content.

addresses
MessageAddress · object[]

A list of Address objects associated with the message (sender and recipients).

Note: Only present when requested using the include query parameter.

attachments
MessageAttachment · object[]

A list of Attachment objects on the message.

Note: Only present when requested using the include query parameter.

conversation
InboxConversation · object

The Conversation thread this message is part of.

Note: Only present when requested using the include query parameter.