Preview campaign
curl --request POST \
--url https://www.dench.com/api/v1/email/campaigns/{campaignId}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"sample": 5
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sample: 5})
};
fetch('https://www.dench.com/api/v1/email/campaigns/{campaignId}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.dench.com/api/v1/email/campaigns/{campaignId}/preview"
payload = { "sample": 5 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"campaignId": "ecmp_abc123",
"previews": [
{
"recipientId": "ecr_abc123",
"to": "ada@lovelace.dev",
"subject": "Hi Ada",
"htmlBody": "<p>Hi Ada, saw your work at Lovelace Labs.</p>"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}email
Preview campaign
Preview rendered messages for a campaign sample.
POST
/
email
/
campaigns
/
{campaignId}
/
preview
Preview campaign
curl --request POST \
--url https://www.dench.com/api/v1/email/campaigns/{campaignId}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"sample": 5
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sample: 5})
};
fetch('https://www.dench.com/api/v1/email/campaigns/{campaignId}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.dench.com/api/v1/email/campaigns/{campaignId}/preview"
payload = { "sample": 5 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"campaignId": "ecmp_abc123",
"previews": [
{
"recipientId": "ecr_abc123",
"to": "ada@lovelace.dev",
"subject": "Hi Ada",
"htmlBody": "<p>Hi Ada, saw your work at Lovelace Labs.</p>"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Authorizations
DenchApiKeyAgentSession
Workspace-scoped Dench API key from workspace settings. This is the same key used by DENCH_API_KEY in sandboxes.
Path Parameters
Body
application/json
Number of rendered previews to return (default 5).
Required range:
-9007199254740991 <= x <= 9007199254740991