Messages
Sent and received mail.
A message belongs to an inbox and a thread. Its message_id is its RFC 5322
Message-ID, which is what lets threading work across providers.
Bodies
Three fields, and picking the right one matters:
text string
The plain-text body as it arrived, quoted history and all.
html string
The HTML body.
extracted_text string
The new content with the quoted reply chain stripped.
Read extracted_text when a model is going to reason over a thread. On a
long exchange, text repeats the entire history in every message; feeding that
to a model wastes context and invites it to answer a question from three replies
ago.
Listing
curl "https://api.carlyemail.com/v0/inboxes/$INBOX_ID/messages?limit=50" \
-H "Authorization: Bearer $CARLYEMAIL_API_KEY"
List responses carry a preview rather than a body. Fetch a single message to
get the full content — that keeps a page of fifty messages small.
Sent and received mail share one list. Every item's labels carry received
or sent, and the same names filter: ?labels=received is the inbox, and
?labels=sent is what went out. See labels.
Spam, trash and unauthenticated mail are excluded by default. Opt in with
include_spam and include_trash.
Searching
/messages/search takes q and covers sender, recipients, subject and body.
Every word in q has to appear somewhere in the message, in any order and in
any of those fields — cabbage salad recipe finds a message with "recipe" in
the subject and the other two in the body. Results are newest first, not
ranked.