Generate email draft
curl --request POST \
--url https://app.nudgen.net/api/v1/ai/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignGoal": "Write a short retention email inviting users to try Nudgen."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignGoal: 'Write a short retention email inviting users to try Nudgen.'})
};
fetch('https://app.nudgen.net/api/v1/ai/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.nudgen.net/api/v1/ai/generate"
payload = { "campaignGoal": "Write a short retention email inviting users to try Nudgen." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"subject": "<string>",
"html": "<string>",
"generationMode": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}API reference
Generate email draft
Generates an email subject and HTML draft from campaign context and the active workspace brand settings.
POST
/
api
/
v1
/
ai
/
generate
Generate email draft
curl --request POST \
--url https://app.nudgen.net/api/v1/ai/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignGoal": "Write a short retention email inviting users to try Nudgen."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignGoal: 'Write a short retention email inviting users to try Nudgen.'})
};
fetch('https://app.nudgen.net/api/v1/ai/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.nudgen.net/api/v1/ai/generate"
payload = { "campaignGoal": "Write a short retention email inviting users to try Nudgen." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"subject": "<string>",
"html": "<string>",
"generationMode": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Personal Access Token created from Settings -> API Keys.
Body
application/json
Was this page helpful?