Skip to main content

Overview

The Email Bot API provides endpoints for automated email handling, AI-powered composition, and email tracking. Base Path: /email_bot

Endpoints

Compose Email

Generate email draft with AI.
POST /email_bot/compose
Request Body:
{
  "recipient": "john@acmecorp.com",
  "company_name": "Acme Corp",
  "purpose": "follow_up",
  "context": "Following up on partnership discussion",
  "tone": "professional",
  "length": "medium"
}
Response:
{
  "subject": "Following up on our partnership discussion",
  "body": "Hi John,\n\nIt was great meeting with you last week...",
  "suggested_send_time": "2024-01-23T09:00:00Z"
}

Send Email

Send email via connected Gmail/Outlook account.
POST /email_bot/send
Request Body:
{
  "to": ["john@acmecorp.com"],
  "subject": "Partnership proposal",
  "body": "Email content...",
  "provider": "google",
  "cc": [],
  "bcc": [],
  "attachments": []
}
Response:
{
  "sent": true,
  "message_id": "msg-123",
  "sent_at": "2024-01-22T11:00:00Z"
}

Gmail OAuth

Initialize OAuth

POST /email_bot/gmail/oauth/init

OAuth Callback

GET /email_bot/gmail/oauth/callback

Outlook OAuth

Initialize OAuth

POST /email_bot/outlook/oauth/init

OAuth Callback

GET /email_bot/outlook/oauth/callback

Complete OAuth Guide

See the full OAuth setup documentation

Next Steps