List messages for an email
curl --request GET \
--url https://api.tempmaillab.com/v1/emails/{email_id}/messages \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tempmaillab.com/v1/emails/{email_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tempmaillab.com/v1/emails/{email_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tempmaillab.com/v1/emails/{email_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;
}{
"data": [
{
"id": "msg_7c2m9v4k8q",
"email_id": "eml_4p9g2t7n8w",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"size_bytes": 1,
"attachment_count": 1
}
],
"pagination": {
"has_more": true,
"next_cursor": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "The request parameters are invalid.",
"request_id": "req_a1b2c3d4e5f6g7h8",
"details": [
{
"field": "cursor",
"reason": "invalid"
}
]
}
}{
"error": {
"code": "invalid_api_key",
"message": "A valid API key is required.",
"request_id": "req_a1b2c3d4e5f6g7h8"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"reason": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "resource_not_found",
"message": "The requested resource was not found.",
"request_id": "req_a1b2c3d4e5f6g7h8"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated delay.",
"request_id": "req_a1b2c3d4e5f6g7h8"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"reason": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"reason": "<string>",
"field": "<string>"
}
]
}
}List messages for an email
Returns non-expired messages for an email owned by the authenticated account. The service never calls this endpoint automatically. Messages disappear from reads 15 minutes after arrival even if physical cleanup is still running. A 304 response is still charged.
GET
/
v1
/
emails
/
{email_id}
/
messages
List messages for an email
curl --request GET \
--url https://api.tempmaillab.com/v1/emails/{email_id}/messages \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tempmaillab.com/v1/emails/{email_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tempmaillab.com/v1/emails/{email_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tempmaillab.com/v1/emails/{email_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;
}{
"data": [
{
"id": "msg_7c2m9v4k8q",
"email_id": "eml_4p9g2t7n8w",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"size_bytes": 1,
"attachment_count": 1
}
],
"pagination": {
"has_more": true,
"next_cursor": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "The request parameters are invalid.",
"request_id": "req_a1b2c3d4e5f6g7h8",
"details": [
{
"field": "cursor",
"reason": "invalid"
}
]
}
}{
"error": {
"code": "invalid_api_key",
"message": "A valid API key is required.",
"request_id": "req_a1b2c3d4e5f6g7h8"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"reason": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "resource_not_found",
"message": "The requested resource was not found.",
"request_id": "req_a1b2c3d4e5f6g7h8"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated delay.",
"request_id": "req_a1b2c3d4e5f6g7h8"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"reason": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"reason": "<string>",
"field": "<string>"
}
]
}
}Authorizations
Path Parameters
Query Parameters
Last modified on September 2, 2026