AI Email Assistant
Integrate DraftEmail's AI-powered email generation into your applications, workflows, and tools with our comprehensive REST API.
Sign up and generate your API key from the dashboard
Send HTTP requests to our API endpoints
Receive AI-generated email content in JSON format
All API requests require authentication using your API key. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Security Note: Never expose your API key in client-side code. Always use it from your backend server.
https://api.draftemail.com
/v1/generateGenerate an email based on context and parameters
contexttonerecipientpurpose/v1/templatesRetrieve available email templates
categorylimitoffset/v1/improveImprove an existing email draft
contentimprovementstone/v1/usageGet usage statistics and analytics
periodgranularitycurl -X POST https://api.draftemail.com/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"context": "Follow up on project proposal meeting",
"tone": "professional",
"recipient": "client",
"purpose": "follow_up",
"additional_notes": "Meeting was yesterday, they seemed interested"
}'{
"success": true,
"email": {
"subject": "Thank you for your time yesterday - Next steps",
"content": "Hi [Name],\n\nThank you for taking the time to meet with me yesterday to discuss our project proposal. I was encouraged by your interest and the thoughtful questions you raised.\n\nAs promised, I'm following up with the additional information you requested...\n\nBest regards,\n[Your Name]",
"tone": "professional",
"word_count": 87
},
"usage": {
"tokens_used": 150,
"remaining_credits": 850
}
}400 Bad RequestInvalid request parameters401 UnauthorizedInvalid or missing API key429 Too Many RequestsRate limit exceeded500 Server ErrorInternal server errornpm install draftemailpip install draftemailgem install draftemailComing SoonOur technical team is here to help you integrate DraftEmail into your applications and workflows.