Schedule Emails
Schedule emails for future delivery with timezone support
Schedule emails to be sent at a specific time in the future with full timezone support.
Paid Feature: Email scheduling is available on LAUNCH, CUSTOM, and ENTERPRISE plans. Free tier users can only send immediate emails.
Email Scheduling Features:
- Schedule up to 365 days in advance
- Timezone support (IANA timezone identifiers)
- Works with both raw emails and templates
- Cancel scheduled emails before they're sent
Quick Start
Schedule a Simple Email
curl -X POST "https://api.keplars.com/api/v1/send-email/schedule" \
-H "Authorization: Bearer $KEPLARS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scheduled_at":"2026-01-20_10:00:00","timezone":"America/New_York","email":{"to":["[email protected]"],"subject":"Scheduled Newsletter","body":"Your Weekly Update"}}'const res = await fetch(
'https://api.keplars.com/api/v1/send-email/schedule',
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.KEPLARS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
scheduled_at: '2026-01-20_10:00:00',
timezone: 'America/New_York',
email: { to: ['[email protected]'], subject: 'Scheduled Newsletter', body: 'Your Weekly Update' },
}),
},
);
const { data } = await res.json();import requests, os
res = requests.post(
'https://api.keplars.com/api/v1/send-email/schedule',
json={
'scheduled_at': '2026-01-20_10:00:00',
'timezone': 'America/New_York',
'email': {'to': ['[email protected]'], 'subject': 'Scheduled Newsletter', 'body': 'Your Weekly Update'},
},
headers={'Authorization': f'Bearer {os.environ["KEPLARS_API_KEY"]}'},
)
data = res.json()['data']package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{"scheduled_at":"2026-01-20_10:00:00","timezone":"America/New_York","email":{"to":["[email protected]"],"subject":"Scheduled Newsletter","body":"Your Weekly Update"}}`)
req, _ := http.NewRequest("POST",
"https://api.keplars.com/api/v1/send-email/schedule", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KEPLARS_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, _ := (&http.Client{}).Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))
}<?php
$ch = curl_init('https://api.keplars.com/api/v1/send-email/schedule');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'scheduled_at' => '2026-01-20_10:00:00',
'timezone' => 'America/New_York',
'email' => ['to' => ['[email protected]'], 'subject' => 'Scheduled Newsletter', 'body' => 'Your Weekly Update'],
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('KEPLARS_API_KEY'),
'Content-Type: application/json',
],
]);
$data = json_decode(curl_exec($ch), true)['data'];
curl_close($ch);using System.Net.Http;
using System.Net.Http.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"Authorization", $"Bearer {Environment.GetEnvironmentVariable("KEPLARS_API_KEY")}"
);
var response = await client.PostAsJsonAsync(
"https://api.keplars.com/api/v1/send-email/schedule",
new
{
scheduled_at = "2026-01-20_10:00:00",
timezone = "America/New_York",
email = new { to = new[] { "[email protected]" }, subject = "Scheduled Newsletter", body = "Your Weekly Update" }
}
);
var body = await response.Content.ReadAsStringAsync();use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client
.post("https://api.keplars.com/api/v1/send-email/schedule")
.header("Authorization", format!("Bearer {}", std::env::var("KEPLARS_API_KEY")?))
.json(&json!({
"scheduled_at": "2026-01-20_10:00:00",
"timezone": "America/New_York",
"email": {
"to": [
"[email protected]"
],
"subject": "Scheduled Newsletter",
"body": "Your Weekly Update"
}
}))
.send()
.await?;
let data: serde_json::Value = res.json().await?;
println!("{}", data);
Ok(())
}#include <curl/curl.h>
#include <cstdlib>
#include <string>
int main() {
CURL* curl = curl_easy_init();
std::string auth = std::string("Authorization: Bearer ") + std::getenv("KEPLARS_API_KEY");
const char* payload = "{\"scheduled_at\":\"2026-01-20_10:00:00\",\"timezone\":\"America/New_York\",\"email\":{\"to\":[\"[email protected]\"],\"subject\":\"Scheduled Newsletter\",\"body\":\"Your Weekly Update\"}}";
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, auth.c_str());
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/schedule");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL* curl = curl_easy_init();
char auth[256];
snprintf(auth, sizeof(auth), "Authorization: Bearer %s", getenv("KEPLARS_API_KEY"));
const char* payload = "{\"scheduled_at\":\"2026-01-20_10:00:00\",\"timezone\":\"America/New_York\",\"email\":{\"to\":[\"[email protected]\"],\"subject\":\"Scheduled Newsletter\",\"body\":\"Your Weekly Update\"}}";
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, auth);
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/schedule");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return 0;
}Schedule with Template
curl -X POST "https://api.keplars.com/api/v1/send-email/schedule" \
-H "Authorization: Bearer $KEPLARS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scheduled_at":"2026-01-25_09:00:00","timezone":"UTC","email":{"to":["[email protected]"],"template_id":"019a83de-2fc2-7b5f-bfbc-c951fe1200f7","params":{"customerName":"John Doe"}}}'const res = await fetch(
'https://api.keplars.com/api/v1/send-email/schedule',
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.KEPLARS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
scheduled_at: '2026-01-25_09:00:00',
timezone: 'UTC',
email: { to: ['[email protected]'], template_id: '019a83de-2fc2-7b5f-bfbc-c951fe1200f7', params: { customerName: 'John Doe' } },
}),
},
);
const { data } = await res.json();import requests, os
res = requests.post(
'https://api.keplars.com/api/v1/send-email/schedule',
json={
'scheduled_at': '2026-01-25_09:00:00',
'timezone': 'UTC',
'email': {'to': ['[email protected]'], 'template_id': '019a83de-2fc2-7b5f-bfbc-c951fe1200f7', 'params': {'customerName': 'John Doe'}},
},
headers={'Authorization': f'Bearer {os.environ["KEPLARS_API_KEY"]}'},
)
data = res.json()['data']package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{"scheduled_at":"2026-01-25_09:00:00","timezone":"UTC","email":{"to":["[email protected]"],"template_id":"019a83de-2fc2-7b5f-bfbc-c951fe1200f7","params":{"customerName":"John Doe"}}}`)
req, _ := http.NewRequest("POST",
"https://api.keplars.com/api/v1/send-email/schedule", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KEPLARS_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, _ := (&http.Client{}).Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))
}<?php
$ch = curl_init('https://api.keplars.com/api/v1/send-email/schedule');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'scheduled_at' => '2026-01-25_09:00:00',
'timezone' => 'UTC',
'email' => ['to' => ['[email protected]'], 'template_id' => '019a83de-2fc2-7b5f-bfbc-c951fe1200f7', 'params' => ['customerName' => 'John Doe']],
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('KEPLARS_API_KEY'),
'Content-Type: application/json',
],
]);
$data = json_decode(curl_exec($ch), true)['data'];
curl_close($ch);using System.Net.Http;
using System.Net.Http.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"Authorization", $"Bearer {Environment.GetEnvironmentVariable("KEPLARS_API_KEY")}"
);
var response = await client.PostAsJsonAsync(
"https://api.keplars.com/api/v1/send-email/schedule",
new
{
scheduled_at = "2026-01-25_09:00:00",
timezone = "UTC",
email = new { to = new[] { "[email protected]" }, template_id = "019a83de-2fc2-7b5f-bfbc-c951fe1200f7", params = new { customerName = "John Doe" } }
}
);
var body = await response.Content.ReadAsStringAsync();use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client
.post("https://api.keplars.com/api/v1/send-email/schedule")
.header("Authorization", format!("Bearer {}", std::env::var("KEPLARS_API_KEY")?))
.json(&json!({
"scheduled_at": "2026-01-25_09:00:00",
"timezone": "UTC",
"email": {
"to": [
"[email protected]"
],
"template_id": "019a83de-2fc2-7b5f-bfbc-c951fe1200f7",
"params": {
"customerName": "John Doe"
}
}
}))
.send()
.await?;
let data: serde_json::Value = res.json().await?;
println!("{}", data);
Ok(())
}#include <curl/curl.h>
#include <cstdlib>
#include <string>
int main() {
CURL* curl = curl_easy_init();
std::string auth = std::string("Authorization: Bearer ") + std::getenv("KEPLARS_API_KEY");
const char* payload = "{\"scheduled_at\":\"2026-01-25_09:00:00\",\"timezone\":\"UTC\",\"email\":{\"to\":[\"[email protected]\"],\"template_id\":\"019a83de-2fc2-7b5f-bfbc-c951fe1200f7\",\"params\":{\"customerName\":\"John Doe\"}}}";
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, auth.c_str());
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/schedule");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL* curl = curl_easy_init();
char auth[256];
snprintf(auth, sizeof(auth), "Authorization: Bearer %s", getenv("KEPLARS_API_KEY"));
const char* payload = "{\"scheduled_at\":\"2026-01-25_09:00:00\",\"timezone\":\"UTC\",\"email\":{\"to\":[\"[email protected]\"],\"template_id\":\"019a83de-2fc2-7b5f-bfbc-c951fe1200f7\",\"params\":{\"customerName\":\"John Doe\"}}}";
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, auth);
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/schedule");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return 0;
}Date Format Examples
{
"scheduled_at": "2026-01-20T15:30:00",
"timezone": "Asia/Kolkata",
"email": { ... }
}{
"scheduled_at": "2026-01-20_15:30:00",
"timezone": "Asia/Kolkata",
"email": { ... }
}Both formats interpret the time in the specified timezone. In the example above, the email will be sent at 3:30 PM India time.
Schedule Request Format
Required Fields
- scheduled_at (string): Date and time when to send the email. Supports two formats:
- ISO 8601:
2026-01-20T10:00:00(standard format) - Simplified:
2026-01-20_10:00:00(easier to read/write) - Time is interpreted in the specified
timezone(or UTC if not provided)
- ISO 8601:
- email (object): Email configuration (same format as Send Emails)
Optional Fields
- timezone (string): IANA timezone identifier (default:
UTC)- Examples:
America/New_York,Europe/London,Asia/Tokyo,Asia/Kolkata,UTC - The
scheduled_attime will be interpreted in this timezone
- Examples:
Email Object
The email object supports all the same fields as the regular send email endpoints:
Raw Email:
{
"from": "[email protected]",
"from_name": "Your Company",
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"subject": "Scheduled Email",
"html": "<p>Your content here</p>"
}Template-based Email:
{
"from": "[email protected]",
"from_name": "Support Team",
"to": ["[email protected]"],
"template_id": "template-uuid",
"params": {
"variable1": "value1",
"variable2": "value2"
}
}Sender Information:
fromis mandatory when using custom domains or SMTP credentialsfrom_nameis mandatory for custom domain emails (sets the sender's display name)- For OAuth emails (Gmail/Microsoft),
fromdefaults to the connected email account from_nameis optional for OAuth emails but recommended for better recipient experience
Scheduling Constraints:
- Minimum: 1 minute in the future
- Maximum: 365 days in the future
- Cannot schedule emails in the past
Schedule Response
Success Response
{
"id": "scheduled_msg_1737307200_abc123",
"object": "scheduled_email",
"status": "scheduled",
"scheduled_at": "2026-01-20T10:00:00",
"timezone": "America/New_York",
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Scheduled Newsletter",
"created_at": "2026-01-19T18:00:00Z",
"metadata": {
"estimated_delivery": "Jan 20, 2026 at 10:00 AM (America/New_York)",
"recipients_count": 1
}
}Error Response
{
"error": {
"type": "validation_error",
"message": "scheduled_at must be at least 1 minute in the future"
}
}Cancel Scheduled Email
Cancel a scheduled email before it's sent:
curl -X DELETE https://api.keplars.com/api/v1/send-email/scheduled/{email_id} \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Campaign postponed"
}'Cancel Response
{
"success": true,
"message": "Scheduled email cancelled successfully"
}Important: You can only cancel emails with status scheduled. Once an email is sent, it cannot be cancelled.
List Scheduled Emails
Get all scheduled emails for your workspace:
curl -X GET https://api.keplars.com/api/v1/send-email/scheduled \
-H "Authorization: Bearer YOUR_API_KEY"Filter by Status
curl -X GET "https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled" \
-H "Authorization: Bearer YOUR_API_KEY"Available status values:
scheduled- Waiting to be sentsent- Successfully sentcancelled- Cancelled before sendingfailed- Failed to send
List Response
{
"object": "list",
"data": [
{
"id": "scheduled_msg_1737307200_abc123",
"workspace_id": "workspace-uuid",
"created_by_user_id": "user-uuid",
"scheduled_at": "2026-01-20T10:00:00Z",
"timezone": "America/New_York",
"status": "scheduled",
"created_at": "2026-01-19T18:00:00Z"
}
],
"count": 1
}Code Examples
Schedule an Email
curl -X POST "https://api.keplars.com/api/v1/send-email/schedule" \
-H "Authorization: Bearer $KEPLARS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scheduled_at":"2026-01-21_09:00:00","timezone":"America/New_York","email":{"to":["[email protected]"],"subject":"Welcome to our platform!","body":"We are excited to have you."}}'const res = await fetch(
'https://api.keplars.com/api/v1/send-email/schedule',
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.KEPLARS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
scheduled_at: '2026-01-21_09:00:00',
timezone: 'America/New_York',
email: { to: ['[email protected]'], subject: 'Welcome to our platform!', body: 'We are excited to have you.' },
}),
},
);
const { data } = await res.json();import requests, os
res = requests.post(
'https://api.keplars.com/api/v1/send-email/schedule',
json={
'scheduled_at': '2026-01-21_09:00:00',
'timezone': 'America/New_York',
'email': {'to': ['[email protected]'], 'subject': 'Welcome to our platform!', 'body': 'We are excited to have you.'},
},
headers={'Authorization': f'Bearer {os.environ["KEPLARS_API_KEY"]}'},
)
data = res.json()['data']package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{"scheduled_at":"2026-01-21_09:00:00","timezone":"America/New_York","email":{"to":["[email protected]"],"subject":"Welcome to our platform!","body":"We are excited to have you."}}`)
req, _ := http.NewRequest("POST",
"https://api.keplars.com/api/v1/send-email/schedule", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KEPLARS_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, _ := (&http.Client{}).Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))
}<?php
$ch = curl_init('https://api.keplars.com/api/v1/send-email/schedule');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'scheduled_at' => '2026-01-21_09:00:00',
'timezone' => 'America/New_York',
'email' => ['to' => ['[email protected]'], 'subject' => 'Welcome to our platform!', 'body' => 'We are excited to have you.'],
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('KEPLARS_API_KEY'),
'Content-Type: application/json',
],
]);
$data = json_decode(curl_exec($ch), true)['data'];
curl_close($ch);using System.Net.Http;
using System.Net.Http.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"Authorization", $"Bearer {Environment.GetEnvironmentVariable("KEPLARS_API_KEY")}"
);
var response = await client.PostAsJsonAsync(
"https://api.keplars.com/api/v1/send-email/schedule",
new
{
scheduled_at = "2026-01-21_09:00:00",
timezone = "America/New_York",
email = new { to = new[] { "[email protected]" }, subject = "Welcome to our platform!", body = "We are excited to have you." }
}
);
var body = await response.Content.ReadAsStringAsync();use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client
.post("https://api.keplars.com/api/v1/send-email/schedule")
.header("Authorization", format!("Bearer {}", std::env::var("KEPLARS_API_KEY")?))
.json(&json!({
"scheduled_at": "2026-01-21_09:00:00",
"timezone": "America/New_York",
"email": {
"to": [
"[email protected]"
],
"subject": "Welcome to our platform!",
"body": "We are excited to have you."
}
}))
.send()
.await?;
let data: serde_json::Value = res.json().await?;
println!("{}", data);
Ok(())
}#include <curl/curl.h>
#include <cstdlib>
#include <string>
int main() {
CURL* curl = curl_easy_init();
std::string auth = std::string("Authorization: Bearer ") + std::getenv("KEPLARS_API_KEY");
const char* payload = "{\"scheduled_at\":\"2026-01-21_09:00:00\",\"timezone\":\"America/New_York\",\"email\":{\"to\":[\"[email protected]\"],\"subject\":\"Welcome to our platform!\",\"body\":\"We are excited to have you.\"}}";
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, auth.c_str());
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/schedule");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL* curl = curl_easy_init();
char auth[256];
snprintf(auth, sizeof(auth), "Authorization: Bearer %s", getenv("KEPLARS_API_KEY"));
const char* payload = "{\"scheduled_at\":\"2026-01-21_09:00:00\",\"timezone\":\"America/New_York\",\"email\":{\"to\":[\"[email protected]\"],\"subject\":\"Welcome to our platform!\",\"body\":\"We are excited to have you.\"}}";
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, auth);
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/schedule");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return 0;
}Cancel a Scheduled Email
curl -X DELETE "https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123" \
-H "Authorization: Bearer $KEPLARS_API_KEY"const res = await fetch(
'https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123',
{
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.KEPLARS_API_KEY}`,
},
},
);import requests, os
res = requests.delete(
'https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123',
headers={'Authorization': f'Bearer {os.environ["KEPLARS_API_KEY"]}'},
)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE",
"https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KEPLARS_API_KEY"))
resp, _ := (&http.Client{}).Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))
}<?php
$ch = curl_init('https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('KEPLARS_API_KEY'),
],
]);
curl_exec($ch);
curl_close($ch);using System.Net.Http;
var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"Authorization", $"Bearer {Environment.GetEnvironmentVariable("KEPLARS_API_KEY")}"
);
var response = await client.DeleteAsync(
"https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123"
);use reqwest::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client
.delete("https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123")
.header("Authorization", format!("Bearer {}", std::env::var("KEPLARS_API_KEY")?))
.send()
.await?;
Ok(())
}#include <curl/curl.h>
#include <cstdlib>
#include <string>
int main() {
CURL* curl = curl_easy_init();
std::string auth = std::string("Authorization: Bearer ") + std::getenv("KEPLARS_API_KEY");
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, auth.c_str());
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL* curl = curl_easy_init();
char auth[256];
snprintf(auth, sizeof(auth), "Authorization: Bearer %s", getenv("KEPLARS_API_KEY"));
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, auth);
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/scheduled/scheduled_msg_1737307200_abc123");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return 0;
}List Scheduled Emails
curl "https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled" \
-H "Authorization: Bearer $KEPLARS_API_KEY"const res = await fetch(
'https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled',
{ headers: { Authorization: `Bearer ${process.env.KEPLARS_API_KEY}` } },
);
const { data } = await res.json();import requests, os
res = requests.get(
'https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled',
headers={'Authorization': f'Bearer {os.environ["KEPLARS_API_KEY"]}'},
)
data = res.json()['data']package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET",
"https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KEPLARS_API_KEY"))
resp, _ := (&http.Client{}).Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))
}<?php
$ch = curl_init('https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('KEPLARS_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true)['data'];
curl_close($ch);using System.Net.Http;
var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"Authorization", $"Bearer {Environment.GetEnvironmentVariable("KEPLARS_API_KEY")}"
);
var response = await client.GetAsync(
"https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled"
);
var body = await response.Content.ReadAsStringAsync();use reqwest::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client
.get("https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled")
.header("Authorization", format!("Bearer {}", std::env::var("KEPLARS_API_KEY")?))
.send()
.await?;
let data: serde_json::Value = res.json().await?;
println!("{}", data);
Ok(())
}#include <curl/curl.h>
#include <cstdlib>
#include <string>
int main() {
CURL* curl = curl_easy_init();
std::string auth = std::string("Authorization: Bearer ") + std::getenv("KEPLARS_API_KEY");
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, auth.c_str());
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL* curl = curl_easy_init();
char auth[256];
snprintf(auth, sizeof(auth), "Authorization: Bearer %s", getenv("KEPLARS_API_KEY"));
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, auth);
curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/scheduled?status=scheduled");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return 0;
}Common Use Cases
1. Weekly Newsletter
Schedule a newsletter to send every Monday at 9 AM:
// Using simplified format for clarity
await scheduleEmail(
'2026-01-27_09:00:00', // Next Monday
'America/New_York',
{
from: '[email protected]',
from_name: 'Weekly Newsletter',
to: subscribers,
template_id: 'weekly-newsletter-template',
params: { week: '2026-01-20' },
}
);2. Birthday Wishes
Schedule birthday emails in advance:
// Schedule for specific date and time
await scheduleEmail(
'2026-02-15_09:00:00',
'UTC',
{
from: '[email protected]',
from_name: 'Celebrations Team',
to: ['[email protected]'],
template_id: 'birthday-template',
params: { name: 'John', age: 30 },
}
);3. Event Reminders
Send reminders before an event:
// Send reminder a day before the event
await scheduleEmail(
'2026-02-28_14:00:00', // 24 hours before event
'Europe/London',
{
from: '[email protected]',
from_name: 'Event Reminders',
to: ['[email protected]'],
subject: 'Event Tomorrow!',
html: '<p>Reminder: Your event is tomorrow at 2 PM.</p>',
}
);Timezone Support
Email scheduling supports all IANA timezone identifiers. Common timezones:
| Region | Timezone Identifier |
|---|---|
| US Eastern | America/New_York |
| US Pacific | America/Los_Angeles |
| UK | Europe/London |
| Central Europe | Europe/Paris |
| India | Asia/Kolkata |
| Japan | Asia/Tokyo |
| Australia (Sydney) | Australia/Sydney |
| UTC | UTC |
Find the full list of IANA timezones at IANA Time Zone Database
Error Codes
| Error Type | Description |
|---|---|
validation_error | Invalid request format or constraints violated |
template_access_denied | Template not found or no access permission |
schedule_error | Failed to schedule email (system error) |
cancellation_error | Failed to cancel (not found or wrong status) |
Best Practices
- Always use timezone parameter - Specify the timezone for clarity, even if it's UTC
- Schedule well in advance - Don't schedule emails too close to the current time (minimum 1 minute)
- Test with templates - Test your templates before scheduling bulk emails
- Monitor scheduled emails - Regularly check the list of scheduled emails
- Cancel when needed - Cancel campaigns that are no longer relevant
Next Steps
- Send Emails - Learn about immediate email sending
- Email Templates - Create reusable templates
- Webhooks - Get notifications when scheduled emails are sent
- Examples - See integration examples for your programming language
Schedule emails effortlessly with Keplars Mail Service. Perfect for newsletters, campaigns, reminders, and automated communications.