Send a test email
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI({ apiKey: "your-api-key" })
await api.posts.sendTestEmail({ id: "3T2PQZlsdQtigUp4fhlb" })curl -X POST "https://public.api.paragraph.com/api/v1/posts/3T2PQZlsdQtigUp4fhlb/test-email" \
-H "Authorization: Bearer your-api-key"import requests
url = "https://public.api.paragraph.com/api/v1/posts/{postId}/test-email"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://public.api.paragraph.com/api/v1/posts/{postId}/test-email', 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://public.api.paragraph.com/api/v1/posts/{postId}/test-email",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public.api.paragraph.com/api/v1/posts/{postId}/test-email"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public.api.paragraph.com/api/v1/posts/{postId}/test-email")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.paragraph.com/api/v1/posts/{postId}/test-email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}posts
Send a test newsletter email
Sends a test newsletter email for the specified draft post to the publication owner’s email address. Useful for previewing how a post will look as a newsletter before publishing. Only works for draft posts.
POST
/
v1
/
posts
/
{postId}
/
test-email
Send a test email
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI({ apiKey: "your-api-key" })
await api.posts.sendTestEmail({ id: "3T2PQZlsdQtigUp4fhlb" })curl -X POST "https://public.api.paragraph.com/api/v1/posts/3T2PQZlsdQtigUp4fhlb/test-email" \
-H "Authorization: Bearer your-api-key"import requests
url = "https://public.api.paragraph.com/api/v1/posts/{postId}/test-email"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://public.api.paragraph.com/api/v1/posts/{postId}/test-email', 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://public.api.paragraph.com/api/v1/posts/{postId}/test-email",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public.api.paragraph.com/api/v1/posts/{postId}/test-email"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public.api.paragraph.com/api/v1/posts/{postId}/test-email")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.paragraph.com/api/v1/posts/{postId}/test-email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}Authorizations
API key for authenticating protected endpoints. Pass as Bearer token in Authorization header.
Path Parameters
Unique identifier of the post to preview
Body
application/json
Body
The body is of type object.
Response
Test email sent successfully
Whether the email was sent
Available options:
true ⌘I

