Documentation

Everything you need to start sending emails with AISend.

Quick Start

Get from zero to sending emails in under 2 minutes.

  1. Create a free account at aisend.app/signup
  2. Go to API Keys and create a key
  3. Install the SDK and send your first email

Installation

npm
npm install aisend-email
pnpm
pnpm add aisend-email
yarn
yarn add aisend-email

Send Your First Email

Node.js / TypeScript

send-email.ts
import { AISend } from 'aisend-email';

const aisend = new AISend('as_your_api_key');

const { id, status } = await aisend.emails.send({
  from: 'hello@yourdomain.com',
  to: 'user@example.com',
  subject: 'Hello from AISend',
  html: '<p>Your first AI-powered email!</p>',
});

console.log('Sent:', id, status);

cURL

Terminal
curl -X POST https://api.aisend.app/v1/emails \
  -H "Authorization: Bearer as_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "hello@yourdomain.com",
    "to": "user@example.com",
    "subject": "Hello from AISend",
    "html": "<p>Your first AI-powered email!</p>"
  }'

Python

send_email.py
import requests

response = requests.post(
    "https://api.aisend.app/v1/emails",
    headers={
        "Authorization": "Bearer as_your_api_key",
        "Content-Type": "application/json",
    },
    json={
        "from": "hello@yourdomain.com",
        "to": "user@example.com",
        "subject": "Hello from AISend",
        "html": "<p>Your first AI-powered email!</p>",
    },
)

print(response.json())

REST API Reference

Base URL: https://api.aisend.app/v1

Authentication

All requests require a Bearer token in the Authorization header.

Authorization: Bearer as_your_api_key

Endpoints

MethodEndpointDescription
POST/v1/emailsSend an email
GET/v1/emails/:idGet email status
GET/v1/emailsList emails
POST/v1/api-keysCreate API key
GET/v1/api-keysList API keys
DELETE/v1/api-keys/:idRevoke API key
POST/v1/email-validation/validateValidate email address
POST/v1/auth/agent-signupAI agent signup

Send Email — Request Body

POST /v1/emails
{
  "from": "hello@yourdomain.com",   // Required. Verified sending address
  "to": "user@example.com",         // Required. String or array of strings
  "subject": "Email subject",       // Required
  "html": "<p>HTML body</p>",       // html or text required
  "text": "Plain text body",        // html or text required
  "cc": "cc@example.com",           // Optional. String or array
  "bcc": "bcc@example.com",         // Optional. String or array
  "reply_to": "reply@example.com"   // Optional
}

Send Email — Response

200 OK
{
  "id": "em_abc123",
  "from": "hello@yourdomain.com",
  "to": ["user@example.com"],
  "subject": "Email subject",
  "status": "queued",
  "provider": "ses",
  "createdAt": "2026-03-21T00:00:00.000Z"
}

Idempotency

Include an Idempotency-Key header to prevent duplicate sends.

Idempotency-Key: unique-request-id-123

Custom Domains

To send from your own domain, add it in the dashboard and configure DNS records. AISend automatically generates SPF and DKIM records. Domain verification typically takes under 5 minutes once DNS propagates.

Webhooks

Receive real-time delivery events via HTTP webhooks. Configure endpoints in the dashboard.

Event Types

email.sentemail.deliveredemail.openedemail.clickedemail.bouncedemail.complained

Webhook Payload

{
  "type": "email.delivered",
  "data": {
    "email_id": "em_abc123",
    "to": "user@example.com",
    "timestamp": "2026-03-21T00:00:00.000Z"
  }
}

Verify webhook signatures using the x-webhook-signature header (HMAC-SHA256).

Email Validation

Validate email addresses before sending to reduce bounces.

POST /v1/email-validation/validate
// Request
{ "email": "user@example.com" }

// Response
{
  "email": "user@example.com",
  "valid": true,
  "checks": {
    "format": true,
    "mx": true,
    "disposable": false,
    "role": false
  },
  "risk": "low"
}

AI Agent Signup

AI agents can create an account and get an API key with a single request — no browser or email verification needed.

POST /v1/auth/agent-signup
// Request
{ "name": "My AI Agent" }

// Response
{
  "token": "eyJhbG...",
  "apiKey": "as_abc123...",
  "userId": "550e8400-...",
  "email": "my-ai-agent-a1b2c3@agent.aisend.app",
  "expiresAt": "2027-03-21T00:00:00.000Z"
}

Use the returned apiKey as a Bearer token to send emails. Agent accounts start on the free tier (3,000 emails/month).

MCP Server (Claude Integration)

Give Claude Desktop, Claude Code, or any MCP-compatible AI assistant the ability to send emails, check delivery status, validate addresses, and manage API keys — all through natural language.

Quick Setup

Add this to your claude_desktop_config.json or project .mcp.json:

.mcp.json
{
  "mcpServers": {
    "aisend": {
      "command": "npx",
      "args": ["-y", "aisend-mcp"],
      "env": {
        "AISEND_API_KEY": "as_your_api_key"
      }
    }
  }
}

Available Tools

ToolDescription
send_emailSend an email (from, to, subject, html/text)
get_email_statusCheck delivery status of a sent email
list_emailsList recently sent emails with status
validate_emailValidate an email address before sending
list_api_keysList all API keys
create_api_keyCreate a new API key
list_domainsList verified and pending domains
agent_signupCreate a new AISend account (no API key needed)

Zero-Config Agent Signup

Don't have an API key? The MCP server includes an agent_signup tool. Just ask Claude: "Sign up for AISend and send an email to..." — it will create an account, get credentials, and send the email automatically.

Example Prompts for Claude

>"Send an email to team@example.com with a summary of today's meeting notes"
>"Check if the last email I sent was delivered"
>"Validate these email addresses before I send the newsletter: ..."
>"Create a new API key called 'production' and show me the key"
>"List all emails I sent today and show which ones bounced"

Error Handling

AISend uses standard HTTP status codes. Error responses include a JSON body with an error field.

StatusMeaning
200Success
400Bad request — check your parameters
401Unauthorized — invalid or missing API key
404Not found
422Validation error — check required fields
429Rate limited — check Retry-After header
500Server error — retry with exponential backoff

Ready to Start Sending?

3,000 emails/month free. No credit card required.