curl --request PATCH \
--url https://{dsn}/api/v1/emails/{email_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"unread": false
}
'{
"object": "Email",
"id": "<string>",
"account_id": "<string>",
"provider_id": "<string>",
"message_id": "<string>",
"thread_id": "<string>",
"date": "2023-11-07T05:31:56Z",
"subject": "<string>",
"snippet": "<string>",
"body": "<string>",
"body_plain": "<string>",
"from_attendee": {
"identifier": "jsmith@example.com",
"display_name": "<string>"
},
"to_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"cc_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"bcc_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"reply_to_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"in_reply_to": {
"message_id": "<string>",
"id": "<string>"
},
"references": [
"<string>"
],
"folders": [
"<string>"
],
"folder_ids": [
"<string>"
],
"role": "INBOX",
"unread": true,
"starred": true,
"has_attachments": true,
"attachments": [
{
"id": "<string>",
"name": "<string>",
"extension": "<string>",
"size": 123,
"mime": "<string>",
"cid": "<string>",
"inline": true
}
],
"size": 123,
"origin": "api",
"tracking_id": "<string>",
"draft_id": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
]
}{
"status": 400,
"type": "errors/invalid_parameters",
"title": "Invalid parameters",
"detail": "limit must be between 1 and 250"
}{
"status": 401,
"type": "errors/invalid_credentials",
"title": "Invalid credentials",
"detail": "the mail provider rejected the credentials: invalid_grant"
}{
"status": 404,
"type": "errors/not_found",
"title": "Not found",
"detail": "email email_94a0d77db739407e932c3b97fef44aac not found"
}{
"status": 502,
"type": "errors/provider_error",
"title": "Mail provider error",
"detail": "timed out talking to imap.example.com"
}Emails
Update an email
Marks an email read or unread, stars it, or moves it to another folder, in the user’s
real mailbox. Send only what you want to change. Returns the updated email, which keeps
its id. An email.update event follows.
PATCH
/
emails
/
{email_id}
curl --request PATCH \
--url https://{dsn}/api/v1/emails/{email_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"unread": false
}
'{
"object": "Email",
"id": "<string>",
"account_id": "<string>",
"provider_id": "<string>",
"message_id": "<string>",
"thread_id": "<string>",
"date": "2023-11-07T05:31:56Z",
"subject": "<string>",
"snippet": "<string>",
"body": "<string>",
"body_plain": "<string>",
"from_attendee": {
"identifier": "jsmith@example.com",
"display_name": "<string>"
},
"to_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"cc_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"bcc_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"reply_to_attendees": [
{
"identifier": "jsmith@example.com",
"display_name": "<string>"
}
],
"in_reply_to": {
"message_id": "<string>",
"id": "<string>"
},
"references": [
"<string>"
],
"folders": [
"<string>"
],
"folder_ids": [
"<string>"
],
"role": "INBOX",
"unread": true,
"starred": true,
"has_attachments": true,
"attachments": [
{
"id": "<string>",
"name": "<string>",
"extension": "<string>",
"size": 123,
"mime": "<string>",
"cid": "<string>",
"inline": true
}
],
"size": 123,
"origin": "api",
"tracking_id": "<string>",
"draft_id": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
]
}{
"status": 400,
"type": "errors/invalid_parameters",
"title": "Invalid parameters",
"detail": "limit must be between 1 and 250"
}{
"status": 401,
"type": "errors/invalid_credentials",
"title": "Invalid credentials",
"detail": "the mail provider rejected the credentials: invalid_grant"
}{
"status": 404,
"type": "errors/not_found",
"title": "Not found",
"detail": "email email_94a0d77db739407e932c3b97fef44aac not found"
}{
"status": 502,
"type": "errors/provider_error",
"title": "Mail provider error",
"detail": "timed out talking to imap.example.com"
}Authorizations
Your access token, from your dashboard under API keys.
Path Parameters
The email's email_… id.
Body
application/json
Response
The updated email.
Available options:
Email, Draft email_…; stays the same when the email moves.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
INBOX, SENT, DRAFTS, TRASH, SPAM, ARCHIVE, ALL, IMPORTANT, STARRED, UNKNOWN Show child attributes
Show child attributes
api: sent through this API.
Available options:
api, external Open/click tracking of this email (trk_…).
Drafts only.
Show child attributes
Show child attributes