DraftEmail

AI Email Assistant

API Documentation

Integrate DraftEmail's AI-powered email generation into your applications, workflows, and tools with our comprehensive REST API.

Getting Started

1. Get API Key

Sign up and generate your API key from the dashboard

2. Make Request

Send HTTP requests to our API endpoints

3. Get Response

Receive AI-generated email content in JSON format

Authentication

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.

Base URL

https://api.draftemail.com

API Endpoints

POST/v1/generate

Generate an email based on context and parameters

Parameters:

contexttonerecipientpurpose
GET/v1/templates

Retrieve available email templates

Parameters:

categorylimitoffset
POST/v1/improve

Improve an existing email draft

Parameters:

contentimprovementstone
GET/v1/usage

Get usage statistics and analytics

Parameters:

periodgranularity

Email Generation Example

Request

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"
  }'

Response

{
  "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
  }
}

Rate Limits

Free Plan
100 requests/day
Professional
1,000 requests/hour
Enterprise
Custom limits

Error Codes

400 Bad RequestInvalid request parameters
401 UnauthorizedInvalid or missing API key
429 Too Many RequestsRate limit exceeded
500 Server ErrorInternal server error

SDK Libraries

📦

Node.js

npm install draftemail
🐍

Python

pip install draftemail
💎

Ruby

gem install draftemail

Java

Coming Soon

Need Help with Integration?

Our technical team is here to help you integrate DraftEmail into your applications and workflows.