Mailboxes
List mailbox messages
List messages in a mailbox folder, newest first. Folder membership and read state are the mailbox’s own (shared with IMAP), separate from the dashboard’s read state.
GET
/
api
/
e2
/
mailboxes
/
{id}
/
messages
TypeScript
import Inbound from "inboundemail";
const inbound = new Inbound();
const result = await inbound.messages.list("<mailboxId>", {
limit: 25,
offset: 0
});curl -X GET 'https://inbound.new/api/e2/mailboxes/<mailboxId>/messages?limit=25&offset=0' \
-H "Authorization: Bearer $INBOUND_API_KEY"import requests
url = "https://inbound.new/api/e2/mailboxes/{id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://inbound.new/api/e2/mailboxes/{id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inbound.new/api/e2/mailboxes/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://inbound.new/api/e2/mailboxes/{id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://inbound.new/api/e2/mailboxes/{id}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/mailboxes/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"folder": "<string>",
"messages": [
{
"id": "<string>",
"folder": "inbox",
"folderPath": "<string>",
"threadId": "<string>",
"subject": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"date": "<string>",
"preview": "<string>",
"isRead": true,
"isJunk": true,
"hasAttachments": true
}
],
"pagination": {
"limit": 123,
"offset": 123,
"hasMore": true
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Your Inbound API key. Include it in the Authorization header as: Bearer
Path Parameters
Query Parameters
Available options:
inbox, archive, junk, sent 'true' for unread only
Match subject, sender or recipients (received mail) or the raw header block (sent and other stored mail; bodies are not searched)
1-100, default 25
Default 0
Was this page helpful?
⌘I
TypeScript
import Inbound from "inboundemail";
const inbound = new Inbound();
const result = await inbound.messages.list("<mailboxId>", {
limit: 25,
offset: 0
});curl -X GET 'https://inbound.new/api/e2/mailboxes/<mailboxId>/messages?limit=25&offset=0' \
-H "Authorization: Bearer $INBOUND_API_KEY"import requests
url = "https://inbound.new/api/e2/mailboxes/{id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://inbound.new/api/e2/mailboxes/{id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inbound.new/api/e2/mailboxes/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://inbound.new/api/e2/mailboxes/{id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://inbound.new/api/e2/mailboxes/{id}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/mailboxes/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"folder": "<string>",
"messages": [
{
"id": "<string>",
"folder": "inbox",
"folderPath": "<string>",
"threadId": "<string>",
"subject": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"date": "<string>",
"preview": "<string>",
"isRead": true,
"isJunk": true,
"hasAttachments": true
}
],
"pagination": {
"limit": 123,
"offset": 123,
"hasMore": true
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}