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/generate
Generate an email based on context and parameters
context
tone
recipient
purpose
/v1/templates
Retrieve available email templates
category
limit
offset
/v1/improve
Improve an existing email draft
content
improvements
tone
/v1/usage
Get usage statistics and analytics
period
granularity
curl -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 Request
Invalid request parameters401 Unauthorized
Invalid or missing API key429 Too Many Requests
Rate limit exceeded500 Server Error
Internal server errornpm install draftemail
pip install draftemail
gem install draftemail
Coming Soon
Our technical team is here to help you integrate DraftEmail into your applications and workflows.