Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat: Add smtp2go-api skill (via api-doc-scraper)

Jez10a1f16679a5
diff --git a/skills/smtp2go-api/.claude-plugin/plugin.json b/skills/smtp2go-api/.claude-plugin/plugin.json
new file mode 100644
index 00000000..39fdeab8
--- /dev/null
+++ b/skills/smtp2go-api/.claude-plugin/plugin.json
@@ -0,0 +1,12 @@
+{
+ "name": "smtp2go-api",
+ "description": "Send transactional emails and SMS via SMTP2GO API. Covers authentication, /email/send and /email/mime endpoints, template management, attachments (base64/URL), webhooks for delivery events, statistics, and suppressions. Use when sending emails from Cloudflare Workers, building notifications, tracking delivery status, handling bounces. Prevents auth errors, attachment encoding issues.",
+ "version": "1.0.0",
+ "author": {
+ "name": "Jeremy Dawes",
+ "email": "[email protected]"
+ },
+ "license": "MIT",
+ "repository": "https://github.com/jezweb/claude-skills",
+ "keywords": []
+}
diff --git a/skills/smtp2go-api/README.md b/skills/smtp2go-api/README.md
new file mode 100644
index 00000000..e49bd113
--- /dev/null
+++ b/skills/smtp2go-api/README.md
@@ -0,0 +1,36 @@
+# SMTP2GO API Skill
+
+Transactional email and SMS delivery via SMTP2GO API for Cloudflare Workers and Node.js applications.
+
+## Keywords
+
+smtp2go, smtp, email api, transactional email, email delivery, send email, email service, email provider, email gateway, smtp relay, email notifications, email templates, handlebars templates, email attachments, base64 attachment, inline images, cid images, email webhooks, delivery webhooks, bounce handling, bounce notifications, spam reports, unsubscribe handling, email suppressions, suppression list, email statistics, delivery reports, email tracking, open tracking, click tracking, sms api, send sms, bulk email, mass email, email marketing api, cloudflare workers email, serverless email, api email sending
+
+## Error Keywords
+
+401 unauthorized api key, sender not verified, E_ApiResponseCodes.ENDPOINT_PERMISSION_DENIED, E_ApiResponseCodes.NON_VALIDATING_IN_PAYLOAD, 429 too many requests, rate limit exceeded, attachment too large, template variable not replaced, webhook timeout, bounce soft hard, email rejected suppression
+
+## Use Cases
+
+- Send transactional emails from Cloudflare Workers
+- Contact form email handlers
+- Order confirmation emails
+- Password reset notifications
+- Email verification flows
+- Marketing email campaigns
+- SMS notifications and alerts
+- Webhook-based delivery tracking
+- Bounce and complaint handling
+- Email template management
+- Attachment handling (PDFs, images)
+- Multi-region email delivery
+
+## Related Skills
+
+- cloudflare-worker-base - Worker foundation
+- hono-routing - API routing for email endpoints
+- email-gateway - Multi-provider email abstraction
+
+## Version
+
+SMTP2GO API v3.0.3
diff --git a/skills/smtp2go-api/SKILL.md b/skills/smtp2go-api/SKILL.md
new file mode 100644
index 00000000..ce615687
--- /dev/null
+++ b/skills/smtp2go-api/SKILL.md
@@ -0,0 +1,642 @@
+---
+name: smtp2go-api
+description: Send transactional emails and SMS via SMTP2GO API. Covers authentication, /email/send and /email/mime endpoints, template management, attachments (base64/URL), webhooks for delivery events, statistics, and suppressions. Use when sending emails from Cloudflare Workers, building notifications, tracking delivery status, handling bounces. Prevents auth errors, attachment encoding issues.
+---
+
+# SMTP2GO API Integration
+
+Build email and SMS delivery with the SMTP2GO transactional API.
+
+## Quick Start
+
+```typescript
+// Send email with SMTP2GO
+const response = await fetch('https://api.smtp2go.com/v3/email/send', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ sender: '[email protected]',
+ subject: 'Hello from SMTP2GO',
+ html_body: '<h1>Welcome!</h1><p>Your account is ready.</p>',
+ text_body: 'Welcome! Your account is ready.',
+ }),
+});
+
+const result = await response.json();
+// { request_id: "uuid", data: { succeeded: 1, failed: 0, email_id: "1er8bV-6Tw0Mi-7h" } }
+```
+
+## Base URLs
+
+| Region | Base URL |
+|--------|----------|
+| Global | `https://api.smtp2go.com/v3` |
+| US | `https://us-api.smtp2go.com/v3` |
+| EU | `https://eu-api.smtp2go.com/v3` |
+| AU | `https://au-api.smtp2go.com/v3` |
+
+## Authentication
+
+Two methods supported:
+
+```typescript
+// Method 1: Header (recommended)
+headers: {
+ 'X-Smtp2go-Api-Key': 'your-api-key'
+}
+
+// Method 2: Request body
+body: JSON.stringify({
+ api_key: 'your-api-key',
+ // ... other params
+})
+```
+
+Get API keys from SMTP2GO dashboard: **Sending > API Keys**
+
+## Core Endpoints
+
+### Send Standard Email
+
+**POST** `/email/send`
+
+```typescript
+interface EmailSendRequest {
+ // Required
+ sender: string; // Verified sender email
+ to: string[]; // Recipients (max 100)
+ subject: string;
+
+ // Content (at least one required)
+ html_body?: string;
+ text_body?: string;
+
+ // Optional
+ cc?: string[]; // CC recipients (max 100)
+ bcc?: string[]; // BCC recipients (max 100)
+ reply_to?: string;
+ custom_headers?: Array<{ header: string; value: string }>;
+ attachments?: Attachment[];
+ inlines?: InlineImage[];
+
+ // Templates
+ template_id?: string;
+ template_data?: Record<string, any>;
+
+ // Subaccounts
+ subaccount_id?: string;
+}
+
+interface Attachment {
+ filename: string;
+ mimetype: string;
+ fileblob?: string; // Base64-encoded content
+ url?: string; // OR URL to fetch from
+}
+
+interface InlineImage {
+ filename: string;
+ mimetype: string;
+ fileblob: string;
+ cid: string; // Content-ID for HTML reference
+}
+```
+
+**Response:**
+
+```typescript
+interface EmailSendResponse {
+ request_id: string;
+ data: {
+ succeeded: number;
+ failed: number;
+ failures: string[];
+ email_id: string;
+ };
+}
+```
+
+### Send MIME Email
+
+**POST** `/email/mime`
+
+For pre-encoded MIME messages:
+
+```typescript
+const response = await fetch('https://api.smtp2go.com/v3/email/mime', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ mime_email: mimeEncodedString,
+ }),
+});
+```
+
+## Attachments
+
+### Base64 Encoding
+
+```typescript
+// Convert file to base64
+const fileBuffer = await file.arrayBuffer();
+const base64 = btoa(String.fromCharCode(...new Uint8Array(fileBuffer)));
+
+const email = {
+ sender: '[email protected]',
+ subject: 'Document attached',
+ text_body: 'Please find the document attached.',
+ attachments: [{
+ filename: 'report.pdf',
+ fileblob: base64,
+ mimetype: 'application/pdf',
+ }],
+};
+```
+
+### URL Reference (Cached 24h)
+
+```typescript
+const email = {
+ sender: '[email protected]',
+ subject: 'Image attached',
+ text_body: 'Photo from our event.',
+ attachments: [{
+ filename: 'photo.jpg',
+ url: 'https://cdn.example.com/photos/event.jpg',
+ mimetype: 'image/jpeg',
+ }],
+};
+```
+
+### Inline Images in HTML
+
+```typescript
+const email = {
+ sender: '[email protected]',
+ subject: 'Newsletter',
+ html_body: '<h1>Welcome</h1><img src="cid:logo123" alt="Logo">',
+ inlines: [{
+ filename: 'logo.png',
+ fileblob: logoBase64,
+ mimetype: 'image/png',
+ cid: 'logo123', // Reference in HTML as src="cid:logo123"
+ }],
+};
+```
+
+**Limits:** Maximum total email size: 50 MB (content + attachments + headers)
+
+## Templates
+
+### Create Template
+
+**POST** `/template/add`
+
+```typescript
+const response = await fetch('https://api.smtp2go.com/v3/template/add', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ template_name: 'welcome-email',
+ html_body: '<h1>Welcome, {{ name }}!</h1><p>Thanks for joining {{ company }}.</p>',
+ text_body: 'Welcome, {{ name }}! Thanks for joining {{ company }}.',
+ }),
+});
+```
+
+### Send with Template
+
+```typescript
+const email = {
+ sender: '[email protected]',
+ subject: 'Welcome aboard!',
+ template_id: 'template-uuid-here',
+ template_data: {
+ name: 'John',
+ company: 'Acme Corp',
+ },
+};
+```
+
+**Template Syntax:** HandlebarsJS with `{{ variable }}` placeholders.
+
+### Template Endpoints
+
+| Endpoint | Method | Description |
+|----------|--------|-------------|
+| `/template/add` | POST | Create new template |
+| `/template/edit` | POST | Update existing template |
+| `/template/delete` | POST | Remove template |
+| `/template/search` | POST | List/search templates |
+| `/template/view` | POST | Get template details |
+
+## Webhooks
+
+Configure webhooks to receive real-time delivery notifications.
+
+### Event Types
+
+**Email Events:**
+
+| Event | Description |
+|-------|-------------|
+| `processed` | Email queued for delivery |
+| `delivered` | Successfully delivered |
+| `open` | Recipient opened email |
+| `click` | Link clicked |
+| `bounce` | Delivery failed |
+| `spam` | Marked as spam |
+| `unsubscribe` | User unsubscribed |
+| `resubscribe` | User resubscribed |
+| `reject` | Blocked (suppression/sandbox) |
+
+**SMS Events:**
+
+| Event | Description |
+|-------|-------------|
+| `sending` | Processing |
+| `submitted` | Sent to provider |
+| `delivered` | Confirmed delivery |
+| `failed` | Delivery failed |
+| `rejected` | Network blocked |
+| `opt-out` | Recipient opted out |
+
+### Webhook Payload (Email)
+
+```typescript
+interface WebhookPayload {
+ event: string;
+ time: string; // Event timestamp
+ sendtime: string; // Original send time
+ sender: string;
+ from_address: string;
+ rcpt: string; // Recipient
+ recipients: string[];
+ email_id: string;
+ subject: string;
+ bounce?: string; // Bounce type if applicable
+ client?: string; // Email client (for opens)
+ 'geoip-country'?: string;
+}
+```
+
+### Webhook Configuration
+
+**POST** `/webhook/add`
+
+```typescript
+await fetch('https://api.smtp2go.com/v3/webhook/add', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ url: 'https://api.yourdomain.com/webhooks/smtp2go',
+ events: ['delivered', 'bounce', 'spam', 'unsubscribe'],
+ }),
+});
+```
+
+### Webhook Endpoints
+
+| Endpoint | Method | Description |
+|----------|--------|-------------|
+| `/webhook/view` | POST | List webhooks |
+| `/webhook/add` | POST | Create webhook |
+| `/webhook/edit` | POST | Update webhook |
+| `/webhook/remove` | POST | Delete webhook |
+
+**Retry Policy:** Up to 35 retries over 48 hours. Timeout: 10 seconds.
+
+## Statistics
+
+### Email Summary
+
+**POST** `/stats/email_summary`
+
+Combined report of bounces, cycles, spam, and unsubscribes.
+
+```typescript
+const response = await fetch('https://api.smtp2go.com/v3/stats/email_summary', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({}),
+});
+```
+
+### Statistics Endpoints
+
+| Endpoint | Method | Description |
+|----------|--------|-------------|
+| `/stats/email_summary` | POST | Combined statistics |
+| `/stats/email_bounces` | POST | Bounce summary (30 days) |
+| `/stats/email_cycle` | POST | Email cycle data |
+| `/stats/email_history` | POST | Historical data |
+| `/stats/email_spam` | POST | Spam reports |
+| `/stats/email_unsubs` | POST | Unsubscribe data |
+
+## Activity Search
+
+**POST** `/activity/search` (Rate limited: 60/min)
+
+Search for email events:
+
+```typescript
+const response = await fetch('https://api.smtp2go.com/v3/activity/search', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ // Filter parameters
+ }),
+});
+```
+
+**Note:** Returns max 1,000 items. For real-time data, use webhooks instead.
+
+## Suppressions
+
+Manage email addresses that should not receive emails.
+
+### Add Suppression
+
+**POST** `/suppression/add`
+
+```typescript
+await fetch('https://api.smtp2go.com/v3/suppression/add', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ email: '[email protected]',
+ }),
+});
+```
+
+### Suppression Endpoints
+
+| Endpoint | Method | Description |
+|----------|--------|-------------|
+| `/suppression/add` | POST | Add to suppression list |
+| `/suppression/view` | POST | View suppressions |
+| `/suppression/remove` | POST | Remove from list |
+
+## SMS
+
+**POST** `/sms/send`
+
+```typescript
+const response = await fetch('https://api.smtp2go.com/v3/sms/send', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ to: ['+61400000000'], // Max 100 numbers
+ message: 'Your verification code is 123456',
+ }),
+});
+```
+
+### SMS Endpoints
+
+| Endpoint | Method | Description |
+|----------|--------|-------------|
+| `/sms/send` | POST | Send SMS |
+| `/sms/received` | POST | View received SMS |
+| `/sms/sent` | POST | View sent SMS |
+| `/sms/summary` | POST | SMS statistics |
+
+## Response Codes
+
+| Code | Status | Description |
+|------|--------|-------------|
+| 200 | OK | Success |
+| 400 | Bad Request | Invalid parameters |
+| 401 | Unauthorized | Invalid/missing API key |
+| 402 | Request Failed | Valid params, request failed |
+| 403 | Forbidden | Insufficient permissions |
+| 404 | Not Found | Resource not found |
+| 429 | Too Many Requests | Rate limited |
+| 5xx | Server Error | SMTP2GO server issue |
+
+### Error Response Format
+
+```typescript
+interface ErrorResponse {
+ request_id: string;
+ data: {
+ error: string;
+ error_code: string;
+ field_validation_errors?: Record<string, string>;
+ };
+}
+```
+
+Common error codes:
+- `E_ApiResponseCodes.ENDPOINT_PERMISSION_DENIED` - API key lacks permission
+- `E_ApiResponseCodes.NON_VALIDATING_IN_PAYLOAD` - Invalid JSON/email format
+- `E_ApiResponseCodes.API_EXCEPTION` - General API error
+
+## Rate Limiting
+
+- **Activity Search:** 60 requests/minute
+- **Email Search (deprecated):** 20 requests/minute
+- **Other endpoints:** Configurable per API key
+
+**Handling 429:**
+
+```typescript
+async function sendWithRetry(payload: any, maxRetries = 3) {
+ for (let i = 0; i < maxRetries; i++) {
+ const response = await fetch('https://api.smtp2go.com/v3/email/send', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify(payload),
+ });
+
+ if (response.status === 429) {
+ await new Promise(r => setTimeout(r, Math.pow(2, i) * 1000));
+ continue;
+ }
+
+ return response.json();
+ }
+ throw new Error('Rate limit exceeded after retries');
+}
+```
+
+## Cloudflare Workers Integration
+
+```typescript
+// wrangler.jsonc
+{
+ "name": "email-service",
+ "vars": {
+ "SMTP2GO_REGION": "api" // or "us-api", "eu-api", "au-api"
+ }
+}
+
+// .dev.vars
+SMTP2GO_API_KEY=api-XXXXXXXXXXXX
+```
+
+```typescript
+// src/index.ts
+export default {
+ async fetch(request: Request, env: Env) {
+ const baseUrl = `https://${env.SMTP2GO_REGION}.smtp2go.com/v3`;
+
+ // Send transactional email
+ const response = await fetch(`${baseUrl}/email/send`, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ sender: '[email protected]',
+ subject: 'Order Confirmation',
+ template_id: 'order-confirmation-template',
+ template_data: {
+ order_id: '12345',
+ total: '$99.00',
+ },
+ }),
+ });
+
+ const result = await response.json();
+ return Response.json(result);
+ },
+} satisfies ExportedHandler<Env>;
+
+interface Env {
+ SMTP2GO_API_KEY: string;
+ SMTP2GO_REGION: string;
+}
+```
+
+## Sender Verification
+
+Before sending, verify your sender identity:
+
+1. **Sender Domain (Recommended):** Add and verify domain in SMTP2GO dashboard for SPF/DKIM alignment
+2. **Single Sender Email:** Verify individual email address
+
+Unverified senders are rejected with 400 error.
+
+## Common Patterns
+
+### Contact Form Handler
+
+```typescript
+export async function handleContactForm(formData: FormData, env: Env) {
+ const name = formData.get('name') as string;
+ const email = formData.get('email') as string;
+ const message = formData.get('message') as string;
+
+ const response = await fetch('https://api.smtp2go.com/v3/email/send', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Smtp2go-Api-Key': env.SMTP2GO_API_KEY,
+ },
+ body: JSON.stringify({
+ sender: '[email protected]',
+ reply_to: email,
+ subject: `Contact form: ${name}`,
+ text_body: `From: ${name} <${email}>\n\n${message}`,
+ html_body: `
+ <p><strong>From:</strong> ${name} &lt;${email}&gt;</p>
+ <hr>
+ <p>${message.replace(/\n/g, '<br>')}</p>
+ `,
+ }),
+ });
+
+ if (!response.ok) {
+ throw new Error('Failed to send email');
+ }
+
+ return response.json();
+}
+```
+
+### Webhook Handler
+
+```typescript
+export async function handleWebhook(request: Request) {
+ const payload = await request.json();
+
+ switch (payload.event) {
+ case 'bounce':
+ // Handle bounce - update user record, retry logic
+ console.log(`Bounce: ${payload.rcpt} - ${payload.bounce}`);
+ break;
+
+ case 'unsubscribe':
+ // Update preferences
+ console.log(`Unsubscribe: ${payload.rcpt}`);
+ break;
+
+ case 'spam':
+ // Add to suppression, alert team
+ console.log(`Spam report: ${payload.rcpt}`);
+ break;
+ }
+
+ return new Response('OK', { status: 200 });
+}
+```
+
+## Troubleshooting
+
+| Issue | Cause | Solution |
+|-------|-------|----------|
+| 401 Unauthorized | Missing/invalid API key | Check API key in header or body |
+| 400 sender not verified | Unverified sender domain | Verify domain in SMTP2GO dashboard |
+| 429 Too Many Requests | Rate limit exceeded | Implement exponential backoff |
+| Attachment too large | Over 50MB total | Compress or use URL references |
+| Template variables not replaced | Wrong syntax | Use `{{ variable }}` Handlebars syntax |
+| Webhook not receiving events | Timeout/errors | Check endpoint returns 200 within 10s |
+
+## References
+
+- [SMTP2GO API Documentation](https://developers.smtp2go.com/)
+- [API Reference](https://developers.smtp2go.com/reference/)
+- [Getting Started Guide](https://developers.smtp2go.com/docs/getting-started)
+- [Webhook Documentation](https://developers.smtp2go.com/docs/webhooks-overview)
+- [Template Guide](https://developers.smtp2go.com/docs/getting-started-with-templates)
+
+---
+
+**Last Updated:** 2026-02-06
+**API Version:** v3.0.3
diff --git a/skills/smtp2go-api/references/endpoints.md b/skills/smtp2go-api/references/endpoints.md
new file mode 100644
index 00000000..afb42433
--- /dev/null
+++ b/skills/smtp2go-api/references/endpoints.md
@@ -0,0 +1,689 @@
+# SMTP2GO API Endpoints Reference
+
+Complete reference of all SMTP2GO API v3 endpoints.
+
+## Base URLs
+
+| Region | URL |
+|--------|-----|
+| Global | `https://api.smtp2go.com/v3` |
+| US | `https://us-api.smtp2go.com/v3` |
+| EU | `https://eu-api.smtp2go.com/v3` |
+| AU | `https://au-api.smtp2go.com/v3` |
+
+## Authentication
+
+All requests require API key via header or body:
+
+```
+X-Smtp2go-Api-Key: api-XXXXXXXXXXXX
+```
+
+Or in request body:
+```json
+{ "api_key": "api-XXXXXXXXXXXX" }
+```
+
+---
+
+## Email Endpoints
+
+### Send Standard Email
+
+**POST** `/email/send`
+
+Send email with individual components.
+
+**Request:**
+```json
+{
+ "sender": "[email protected]",
+ "to": ["[email protected]"],
+ "subject": "Subject line",
+ "html_body": "<h1>HTML content</h1>",
+ "text_body": "Plain text content",
+ "cc": ["[email protected]"],
+ "bcc": ["[email protected]"],
+ "reply_to": "[email protected]",
+ "custom_headers": [
+ { "header": "X-Custom", "value": "value" }
+ ],
+ "attachments": [
+ {
+ "filename": "file.pdf",
+ "mimetype": "application/pdf",
+ "fileblob": "base64-encoded-content"
+ }
+ ],
+ "inlines": [
+ {
+ "filename": "logo.png",
+ "mimetype": "image/png",
+ "fileblob": "base64-encoded-content",
+ "cid": "logo-cid"
+ }
+ ],
+ "template_id": "template-uuid",
+ "template_data": {
+ "variable1": "value1"
+ },
+ "subaccount_id": "subaccount-uuid"
+}
+```
+
+**Response (200):**
+```json
+{
+ "request_id": "aa253464-0bd0-467a-b24b-6159dcd7be60",
+ "data": {
+ "succeeded": 1,
+ "failed": 0,
+ "failures": [],
+ "email_id": "1er8bV-6Tw0Mi-7h"
+ }
+}
+```
+
+**Limits:**
+- Max 100 recipients per To/CC/BCC field
+- Max 50 MB total email size
+
+---
+
+### Send MIME Email
+
+**POST** `/email/mime`
+
+Send pre-encoded MIME message.
+
+**Request:**
+```json
+{
+ "mime_email": "MIME-encoded-string"
+}
+```
+
+---
+
+### Search Sent Emails (Deprecated)
+
+**POST** `/email/search`
+
+**Note:** Deprecated - use `/activity/search` instead.
+
+Rate limit: 20/min
+
+---
+
+### Search Scheduled Emails
+
+**POST** `/email/scheduled`
+
+Search for scheduled emails.
+
+---
+
+### Remove Scheduled Email
+
+**POST** `/email/scheduled/remove`
+
+Cancel a scheduled email.
+
+---
+
+## Template Endpoints
+
+### Add Template
+
+**POST** `/template/add`
+
+```json
+{
+ "template_name": "welcome-email",
+ "html_body": "<h1>Welcome {{ name }}</h1>",
+ "text_body": "Welcome {{ name }}"
+}
+```
+
+### Edit Template
+
+**POST** `/template/edit`
+
+```json
+{
+ "template_id": "template-uuid",
+ "template_name": "updated-name",
+ "html_body": "<h1>Updated content</h1>"
+}
+```
+
+### Delete Template
+
+**POST** `/template/delete`
+
+```json
+{
+ "template_id": "template-uuid"
+}
+```
+
+### Search Templates
+
+**POST** `/template/search`
+
+```json
+{
+ "query": "welcome"
+}
+```
+
+### View Template
+
+**POST** `/template/view`
+
+```json
+{
+ "template_id": "template-uuid"
+}
+```
+
+---
+
+## Webhook Endpoints
+
+### View Webhooks
+
+**POST** `/webhook/view`
+
+Returns all configured webhooks.
+
+### Add Webhook
+
+**POST** `/webhook/add`
+
+```json
+{
+ "url": "https://api.example.com/webhooks/smtp2go",
+ "events": ["delivered", "bounce", "spam", "unsubscribe", "open", "click"]
+}
+```
+
+### Edit Webhook
+
+**POST** `/webhook/edit`
+
+```json
+{
+ "webhook_id": "webhook-uuid",
+ "url": "https://new-url.example.com/webhook",
+ "events": ["delivered", "bounce"]
+}
+```
+
+### Remove Webhook
+
+**POST** `/webhook/remove`
+
+```json
+{
+ "webhook_id": "webhook-uuid"
+}
+```
+
+---
+
+## Statistics Endpoints
+
+### Email Summary
+
+**POST** `/stats/email_summary`
+
+Combined report: bounces + cycles + spam + unsubscribes.
+
+```json
+{}
+```
+
+### Email Bounces
+
+**POST** `/stats/email_bounces`
+
+Bounce summary for last 30 days.
+
+### Email Cycle
+
+**POST** `/stats/email_cycle`
+
+Email cycle statistics.
+
+### Email History
+
+**POST** `/stats/email_history`
+
+Historical email data.
+
+### Email Spam
+
+**POST** `/stats/email_spam`
+
+Spam report statistics.
+
+### Email Unsubscribes
+
+**POST** `/stats/email_unsubs`
+
+Unsubscribe statistics.
+
+---
+
+## Activity Endpoints
+
+### Search Activity
+
+**POST** `/activity/search`
+
+Search for email events (opens, clicks, bounces, etc.).
+
+**Rate limit:** 60 requests/min
+**Max results:** 1,000
+
+```json
+{
+ "start_date": "2026-01-01",
+ "end_date": "2026-01-31",
+ "event_type": "delivered"
+}
+```
+
+---
+
+## Suppression Endpoints
+
+### Add Suppression
+
+**POST** `/suppression/add`
+
+```json
+{
+ "email": "[email protected]"
+}
+```
+
+Or suppress entire domain:
+```json
+{
+ "domain": "blocked-domain.com"
+}
+```
+
+### View Suppressions
+
+**POST** `/suppression/view`
+
+List suppressed addresses.
+
+### Remove Suppression
+
+**POST** `/suppression/remove`
+
+```json
+{
+ "email": "[email protected]"
+}
+```
+
+---
+
+## SMS Endpoints
+
+### Send SMS
+
+**POST** `/sms/send`
+
+```json
+{
+ "to": ["+61400000000"],
+ "message": "Your verification code is 123456"
+}
+```
+
+**Limits:** Max 100 phone numbers per request.
+
+### View Received SMS
+
+**POST** `/sms/received`
+
+### View Sent SMS
+
+**POST** `/sms/sent`
+
+### SMS Summary
+
+**POST** `/sms/summary`
+
+---
+
+## Sender Domain Endpoints
+
+### Add Sender Domain
+
+**POST** `/domain/add`
+
+```json
+{
+ "domain": "example.com"
+}
+```
+
+### Verify Sender Domain
+
+**POST** `/domain/verify`
+
+```json
+{
+ "domain": "example.com"
+}
+```
+
+### View Sender Domains
+
+**POST** `/domain/view`
+
+### Remove Sender Domain
+
+**POST** `/domain/remove`
+
+### Edit Tracking Subdomain
+
+**POST** `/domain/tracking`
+
+### Edit Return-Path Subdomain
+
+**POST** `/domain/returnpath`
+
+---
+
+## Single Sender Email Endpoints
+
+### Add Single Sender
+
+**POST** `/sender/add`
+
+```json
+{
+ "email": "[email protected]"
+}
+```
+
+### View Single Senders
+
+**POST** `/sender/view`
+
+### Remove Single Sender
+
+**POST** `/sender/remove`
+
+---
+
+## SMTP User Endpoints
+
+### Add SMTP User
+
+**POST** `/smtp/add`
+
+### Edit SMTP User
+
+**POST** `/smtp/edit`
+
+### Patch SMTP User
+
+**PATCH** `/smtp/patch`
+
+### Remove SMTP User
+
+**POST** `/smtp/remove`
+
+### View SMTP Users
+
+**POST** `/smtp/view`
+
+---
+
+## API Key Endpoints
+
+### View API Keys
+
+**POST** `/api_keys/view`
+
+### Add API Key
+
+**POST** `/api_keys/add`
+
+### Edit API Key
+
+**POST** `/api_keys/edit`
+
+### Patch API Key
+
+**PATCH** `/api_keys/patch`
+
+### Remove API Key
+
+**POST** `/api_keys/remove`
+
+### View Permissions
+
+**POST** `/api_keys/permissions`
+
+---
+
+## Subaccount Endpoints
+
+### Add Subaccount
+
+**POST** `/subaccount/add`
+
+### Update Subaccount
+
+**POST** `/subaccount/update`
+
+### Search Subaccounts
+
+**POST** `/subaccount/search`
+
+### Close Subaccount
+
+**POST** `/subaccount/close`
+
+### Reopen Subaccount
+
+**POST** `/subaccount/reopen`
+
+### Resend Invitation
+
+**POST** `/subaccount/resend_invite`
+
+---
+
+## Allowed Senders/Recipients Endpoints
+
+### Add Allowed Senders
+
+**POST** `/allowed_senders/add`
+
+### Update Allowed Senders
+
+**POST** `/allowed_senders/update`
+
+### View Allowed Senders
+
+**POST** `/allowed_senders/view`
+
+### Remove Allowed Senders
+
+**POST** `/allowed_senders/remove`
+
+### Add Allowed Recipients
+
+**POST** `/allowed_recipients/add`
+
+### Update Allowed Recipients
+
+**POST** `/allowed_recipients/update`
+
+### View Allowed Recipients
+
+**POST** `/allowed_recipients/view`
+
+### Remove Allowed Recipients
+
+**POST** `/allowed_recipients/remove`
+
+---
+
+## Email Archive Endpoints
+
+### Search Archived Emails
+
+**POST** `/archive/search`
+
+### View Archived Email
+
+**POST** `/archive/view`
+
+---
+
+## IP Allowlist Endpoints
+
+### View IP Allowlist
+
+**POST** `/ip_allowlist/view`
+
+### Add IP Allowlist
+
+**POST** `/ip_allowlist/add`
+
+### Edit IP Allowlist
+
+**POST** `/ip_allowlist/edit`
+
+### Remove IP Allowlist
+
+**POST** `/ip_allowlist/remove`
+
+---
+
+## IP Auth Endpoints
+
+### View IP Auth
+
+**POST** `/ip_auth/view`
+
+### Patch IP Auth
+
+**PATCH** `/ip_auth/patch`
+
+### Remove IP Auth
+
+**POST** `/ip_auth/remove`
+
+---
+
+## Dedicated IP Endpoints
+
+### View Dedicated IPs
+
+**POST** `/dedicated_ips/view`
+
+---
+
+## Response Codes
+
+| Code | Status | Description |
+|------|--------|-------------|
+| 200 | OK | Success |
+| 400 | Bad Request | Invalid parameters |
+| 401 | Unauthorized | Invalid/missing API key |
+| 402 | Request Failed | Valid params, request failed |
+| 403 | Forbidden | Insufficient permissions |
+| 404 | Not Found | Resource not found |
+| 429 | Too Many Requests | Rate limited |
+| 500-504 | Server Error | SMTP2GO server issue |
+
+---
+
+## Webhook Event Payloads
+
+### Email Events
+
+**Delivered:**
+```json
+{
+ "event": "delivered",
+ "time": "2026-02-06T10:30:00Z",
+ "sendtime": "2026-02-06T10:29:55Z",
+ "sender": "[email protected]",
+ "from_address": "[email protected]",
+ "rcpt": "[email protected]",
+ "recipients": ["[email protected]"],
+ "email_id": "1er8bV-6Tw0Mi-7h",
+ "subject": "Order Confirmation"
+}
+```
+
+**Bounce:**
+```json
+{
+ "event": "bounce",
+ "bounce": "hard",
+ "rcpt": "[email protected]",
+ "email_id": "1er8bV-6Tw0Mi-7h"
+}
+```
+
+**Open:**
+```json
+{
+ "event": "open",
+ "rcpt": "[email protected]",
+ "client": "Gmail",
+ "geoip-country": "AU"
+}
+```
+
+**Click:**
+```json
+{
+ "event": "click",
+ "rcpt": "[email protected]",
+ "url": "https://example.com/clicked-link"
+}
+```
+
+### SMS Events
+
+**Delivered:**
+```json
+{
+ "event": "delivered",
+ "destination_number": "+61400000000",
+ "message_id": "msg-uuid",
+ "status_code": "delivered"
+}
+```
+
+---
+
+## Rate Limits
+
+| Endpoint | Limit |
+|----------|-------|
+| `/activity/search` | 60/min |
+| `/email/search` | 20/min (deprecated) |
+| Other endpoints | Configurable per API key |
+
+---
+
+**Last Updated:** 2026-02-06
+**API Version:** v3.0.3
+**Source:** [SMTP2GO Developer Documentation](https://developers.smtp2go.com/)