Skip to main content
GET
/
personas
/
{persona_id}
/
emails
python
import datetime as dt

from notte_sdk.client import NotteClient

notte = NotteClient()
# retrieve an existing persona or use console.notte.cc/personas to create a new one
persona = notte.Persona("<my-persona-id>")
# read recent emails (received in the past 5 minutes)
recent_emails = persona.emails(
    only_unread=True,
    limit=10,
    timedelta=dt.timedelta(minutes=5),
)
print(f"Recent emails: {recent_emails}")
[
  {
    "subject": "<string>",
    "email_id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "sender_email": "<string>",
    "sender_name": "<string>",
    "text_content": "<string>",
    "html_content": "<string>"
  }
]

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

x-notte-request-origin
string | null
x-notte-sdk-version
string | null

Path Parameters

persona_id
string
required

Query Parameters

limit
integer
default:10

Maximum number of emails

Required range: 1 <= x <= 100
timedelta
string<duration> | null

Maximum time since email reception

only_unread
boolean
default:false

Whether to only return unread messages

Response

Successful Response

subject
string
required

Subject of the email

email_id
string
required

Email UUID

created_at
string<date-time>
required

Creation date

sender_email
string | null
required

Email address of the sender

sender_name
string | null
required

Name (if available) of the sender

text_content
string | null

Raw textual body, can be uncorrelated with html content

html_content
string | null

HTML body, can be uncorrelated with raw content