messages
Fields = Literal['standard', 'include_headers']
module-attribute
Literal representing which headers to include with a message.
ListMessagesQueryParams = TypedDict('ListMessagesQueryParams', {None: get_type_hints(ListQueryParams), 'subject': NotRequired[str], 'any_email': NotRequired[str], 'from': NotRequired[str], 'to': NotRequired[str], 'cc': NotRequired[str], 'bcc': NotRequired[str], 'in': NotRequired[str], 'unread': NotRequired[bool], 'starred': NotRequired[bool], 'thread_id': NotRequired[str], 'received_before': NotRequired[int], 'received_after': NotRequired[int], 'has_attachment': NotRequired[bool], 'fields': NotRequired[Fields], 'search_query_native': NotRequired[str]})
module-attribute
Query parameters for listing messages.
Attributes:
Name | Type | Description |
---|---|---|
subject |
Return messages with matching subject. |
|
any_email |
Return messages that have been sent or received by this comma-separated list of email addresses. |
|
from |
Return messages sent from this email address. |
|
to |
Return messages sent to this email address. |
|
cc |
Return messages cc'd to this email address. |
|
bcc |
Return messages bcc'd to this email address. |
|
in |
Return messages in this specific folder or label, specified by ID. |
|
unread |
Filter messages by unread status. |
|
starred |
Filter messages by starred status. |
|
thread_id |
Filter messages by thread_id. |
|
received_before |
Return messages with received dates before received_before. |
|
received_after |
Return messages with received dates after received_after. |
|
has_attachment |
Filter messages by whether they have an attachment. |
|
fields |
Specify "include_headers" to include headers in the response. "standard" is the default. |
|
search_query_native |
A native provider search query for Google or Microsoft. |
|
limit |
NotRequired[int]
|
The maximum number of objects to return. This field defaults to 50. The maximum allowed value is 200. |
page_token |
NotRequired[str]
|
An identifier that specifies which page of data to return. This value should be taken from a ListResponse object's next_cursor parameter. |
Attachment
dataclass
An attachment on a message.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Globally unique object identifier. |
size |
int
|
Size of the attachment in bytes. |
filename |
Optional[str]
|
Name of the attachment. |
content_type |
Optional[str]
|
MIME type of the attachment. |
Source code in nylas/models/messages.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
FindMessageQueryParams
Bases: TypedDict
Query parameters for finding a message.
Attributes:
Name | Type | Description |
---|---|---|
fields |
NotRequired[Fields]
|
Specify "include_headers" to include headers in the response. "standard" is the default. |
Source code in nylas/models/messages.py
147 148 149 150 151 152 153 154 155 |
|
Message
dataclass
A Message object.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Globally unique object identifier. |
grant_id |
str
|
The grant that this message belongs to. |
thread_id |
str
|
The thread that this message belongs to. |
subject |
str
|
The subject of the message. |
from_ |
List[Participant]
|
The sender of the message. |
to |
List[Participant]
|
The recipients of the message. |
cc |
Optional[List[Participant]]
|
The CC recipients of the message. |
bcc |
Optional[List[Participant]]
|
The BCC recipients of the message. |
reply_to |
Optional[List[Participant]]
|
The reply-to recipients of the message. |
date |
datetime
|
The date the message was received. |
unread |
bool
|
Whether the message is unread. |
starred |
bool
|
Whether the message is starred. |
snippet |
str
|
A snippet of the message body. |
body |
str
|
The body of the message. |
attachments |
Optional[List[Attachment]]
|
The attachments on the message. |
folders |
Optional[List[str]]
|
The folders that the message is in. |
headers |
Optional[List[str]]
|
The headers of the message. |
Source code in nylas/models/messages.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
Participant
dataclass
A participant in a message.
Attributes:
Name | Type | Description |
---|---|---|
name |
Optional[str]
|
Participant's name |
email |
str
|
Participant's email |
Source code in nylas/models/messages.py
14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
UpdateMessageQueryParams
Bases: TypedDict
Query parameters for updating a message.
Attributes:
Name | Type | Description |
---|---|---|
starred |
NotRequired[bool]
|
The message's starred status |
unread |
NotRequired[bool]
|
The message's unread status |
folders |
NotRequired[List[str]]
|
The message's folders |
Source code in nylas/models/messages.py
158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
UpdateMessageRequest
Request payload for updating a message.
Source code in nylas/models/messages.py
173 174 175 176 177 178 179 |
|