> For the complete documentation index, see [llms.txt](https://kasplo.gitbook.io/kasplo-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kasplo.gitbook.io/kasplo-doc/channels/email-api.md).

# Email API

Kasplo Email API provides developer infrastructure to send transactional, operational, and application-generated emails at scale through **HTTP REST API** or **SMTP**.

Whether you are dispatching password resets, order confirmations, time-sensitive alerts, or dynamic AMP messages, Kasplo handles delivery optimization, bounce classification, real-time webhooks, and compliance tracking.

***

## Key Capabilities

* **Dual Integration Methods**: Send via modern HTTP REST API (`/v1/send-email`) or integrate existing systems using standard SMTP (`smtp.kasplo.com`).
* **Rich Content & AMP Support**: Full support for HTML, plain-text fallback, attachments (Base64 & URL-hosted), and interactive AMP for Email.
* **Flexible Recipient Routing**: Single recipient (`to`), grouped recipients (`toList`), CC, and BCC with independent tracking and delivery logging.
* **Compliance & Unsubscribe Automation**: Automated one-click unsubscribe headers (RFC 8058), recipient-specific placeholders, and unified Suppression APIs (`UNSUB`, `MANUALLY-DEACTIVATED`, `DOMAIN`).
* **Real-Time Webhooks & Monitoring**: Event-driven webhook streams (delivery attempts, bounces, opens, clicks, unsubscribes, spam complaints) and 30-day message tracing in Live Feed.

***

## Quick Navigation

| Section                                                                                | Description                                                                             |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [**Send via API**](/kasplo-doc/channels/email-api/send-via-api.md)                     | Authenticate, build payloads, configure headers, and submit emails over HTTPS.          |
| [**API Options**](/kasplo-doc/channels/email-api/send-via-api/api-options.md)          | Advanced sending: CC/BCC, scheduled sending, custom tracking IDs, and attachments.      |
| [**Code Samples**](/kasplo-doc/channels/email-api/send-via-api/code-samples.md)        | Copy-paste snippets in cURL, Node.js, Python, PHP, Java, Go, Ruby, and C#.              |
| [**Send via SMTP**](/kasplo-doc/channels/email-api/send-via-smtp.md)                   | Connect via SMTP ports 587 / 2525 with custom headers for tracking and scheduling.      |
| [**Suppression APIs**](/kasplo-doc/channels/email-api/suppression-apis.md)             | Programmatically add, search, list, and delete suppressed emails and domains.           |
| [**Unsubscribe Management**](/kasplo-doc/channels/email-api/unsubscribe-management.md) | Manage one-click unsubscribe links, placeholders, and custom opt-out endpoints.         |
| [**AMP Email**](/kasplo-doc/channels/email-api/amp-email.md)                           | Construct dynamic MIME structures and register with Gmail, Yahoo, and Mail.ru.          |
| [**Webhooks**](/kasplo-doc/channels/email-api/webhooks.md)                             | Configure webhook endpoints with OAuth2, Bearer, or API Key authentication.             |
| [**Delivery & Usage**](/kasplo-doc/channels/email-api/delivery-and-usage.md)           | Learn how Kasplo handles delivery lifecycles, billing boundaries, bounces, and limits.  |
| [**Monitoring**](/kasplo-doc/channels/email-api/monitoring.md)                         | Track sending health, inspect recipient timelines, and export 30-day Live Feed records. |

***

## Sending Environments & Base URLs

| Service             | Protocol | Endpoint / Host             | Port | Auth Type                                         |
| ------------------- | -------- | --------------------------- | ---- | ------------------------------------------------- |
| **REST API**        | HTTPS    | `https://api.kasplo.com/v1` | 443  | `api-key: <KEY>` or `Authorization: Bearer <KEY>` |
| **SMTP (STARTTLS)** | SMTP     | `smtp.kasplo.com`           | 587  | SMTP Username & Password                          |
| **SMTP (SSL/TLS)**  | SMTPS    | `smtp.kasplo.com`           | 2525 | SMTP Username & Password                          |

***

## Before Sending Production Traffic

Before sending emails through Kasplo in production, ensure your setup meets these requirements:

1. **Verify Sending Domain**: Add and verify your domain in the Kasplo dashboard.
2. **DNS Authentication**:
   * **SPF**: Authorize Kasplo sending IPs in your DNS SPF record.
   * **DKIM**: Add the public DKIM key records provided by Kasplo.
   * **DMARC**: Publish a DMARC policy (`p=none`, `p=quarantine`, or `p=reject`) aligned with your sending domain.
3. **Generate API / SMTP Credentials**: Generate account-specific API keys or SMTP user credentials.
4. **Understand Acceptance vs Delivery**:
   * A `200 OK` (HTTP) or `250 OK` (SMTP) response indicates that **Kasplo has accepted the message for processing**.
   * Final delivery status (Delivered, Deferred, Bounced, or Rejected) is confirmed asynchronously via **Webhooks** or **Live Feed**.
