Emails
List sent emails
GET
/emails Retrieve a page of the emails your team has sent.
Parameters
limitintegerqueryHow many to return, 1–100.
afterstringqueryCursor from the previous page.
Code samples
TypeScript
const res = await fetch('https://api.postwick.dev/emails?limit=&after=', {
method: 'GET',
});
const data = await res.json();PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.postwick.dev/emails?limit=&after=');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Python
import requests
res = requests.request(
"GET",
"https://api.postwick.dev/emails?limit=&after=",
)
data = res.json()Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.postwick.dev/emails?limit=&after=')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyGo
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.postwick.dev/emails?limit=&after=", nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}cURL
curl -X GET "https://api.postwick.dev/emails?limit=&after="Responses
200 OK
{
"object": "list",
"has_more": false,
"data": [
{
"id": "4ee5d4c7",
"subject": "hello world",
"last_event": "delivered"
}
]
}Was this page helpful?