> 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/transactional-api-smtp/email-api.md).

# Email API

Kasplo’s Email API enables developers to send transactional and marketing emails programmatically with speed, reliability, and full control. Designed for scale, our API is built to support high-volume email sending while ensuring top-tier deliverability through advanced infrastructure and intelligent routing.Whether you’re sending a password reset, order confirmation, or a promotional blast, our Email API gives you:

* Seamless integration with your backend system
* Real-time email delivery with status tracking
* Built-in support for custom headers, personalization, and tags
* Detailed analytics and bounce handling

In the sections below, you’ll find everything you need to get started: endpoint details, required headers, request structure, and sample responses to implement Kasplo’s Email API into your application with ease.

### Endpoint:

```
https://api.kasplo.com/v1/send-email
```

### Headers:

```

Unset      
Authorization: Bearer 
Content-Type: application/json
  
```

### Request Body (example):

```
{
    "email": {
        "from": "sender@yourdomain.com",
        "fromName": "sender name",
        "replyTo": [
            "abcd@yourdomain.com"
        ],
        "subject": "Custom subject line",
        "text": "This is a Multipart email",
        "html": "<h1>Test Email</h1>",
        "amp": "<AMP_TEMPLATE_HTML_CODE>",
        "recipients": {
            "to": [
                {
                    "email": "recipient@example.com"
                }
            ],
            "cc": [],
            "bcc": []
        },
        "attachments": []
    },
    "metadata": {
        "messageId": "custom-id-value"
    }
}

```

### Response (example for 200 Ok status):

```
{
    "statusCode": 1000,
    "status": "SUCCESS",
    "message": "Message accepted successfully.",
    "clickTrackingId": "a32993b8-cf2e-4ba7-beca-5297868478b3"
}
```

## Response Parameters Explained

| Parameter       | Description                                                            |
| --------------- | ---------------------------------------------------------------------- |
| statusCode      | Numeric status code representing the API response status               |
| status          | Indicates the request outcome (SUCCESS for accepted requests)          |
| message         | Human-readable confirmation message                                    |
| clickTrackingId | Unique tracking identifier generated for every successful (OK) request |

***

## What is clickTrackingId?

The clickTrackingId is a system-generated UUID associated with every successfully accepted API request.

Example:

`a32993b8-cf2e-4ba7-beca-5297868478b3`

This ID helps identify and trace a specific request throughout the system lifecycle.

***

## When is clickTrackingId Generated?

The clickTrackingId is generated only when:

* The request is successfully accepted by the API
* The response status is SUCCESS
* The status code indicates a successful request acceptance

For failed or rejected requests, the clickTrackingId may not be generated.

***

## How Clients Should Use clickTrackingId

Clients are strongly recommended to:

1. Capture the clickTrackingId from the API response
2. Store it alongside their internal transaction/request ID
3. Use it while raising support tickets or debugging issues
4. Maintain logs on their end for easier reconciliation

***

## Log Retention Policy

### 1. Raw Request Logs

The complete request payload and API request logs are retained internally for:

* 2 Days

These logs are primarily used for short-term debugging and request tracing.

***

### 2. Platform Entry Logs

The platform maintains processed entry logs and activity records for:

* 7 Days

These logs are accessible through the platform for operational visibility and monitoring.

***

### 3. Downloadable Historical Data

Exportable/downloadable reports and data are available for:

* Last 60 Days

Clients can download historical activity data directly from the platform export section.

<br>
