const response = await fetch('https://api.emailit.com/v2/emails/em_abc123xyz789def456', {
method: 'POST',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
scheduled_at: '2026-01-10T15:00:00Z'
})
});
const result = await response.json();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.emailit.com/v2/emails/em_abc123xyz789def456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'scheduled_at' => '2026-01-10T15:00:00Z'
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
$result = json_decode($response, true);
print_r($result);
}
import requests
response = requests.post(
'https://api.emailit.com/v2/emails/em_abc123xyz789def456',
headers={
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
json={
'scheduled_at': '2026-01-10T15:00:00Z'
}
)
result = response.json()
print(result)
require 'net/http'
require 'json'
uri = URI('https://api.emailit.com/v2/emails/em_abc123xyz789def456')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer em_test_51RxCWJ...vS00p61e0qRE'
request['Content-Type'] = 'application/json'
request.body = {
scheduled_at: '2026-01-10T15:00:00Z'
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts result
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.emailit.com/v2/emails/em_abc123xyz789def456"
data := map[string]interface{}{
"scheduled_at": "2026-01-10T15:00:00Z",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
use reqwest;
use serde_json::{json, Value};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.post("https://api.emailit.com/v2/emails/em_abc123xyz789def456")
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.json(&json!({
"scheduled_at": "2026-01-10T15:00:00Z"
}))
.send()
.await?;
let result: Value = response.json().await?;
println!("{:?}", result);
Ok(())
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.http.HttpRequest.BodyPublishers;
public class UpdateEmail {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String jsonBody = "{\"scheduled_at\":\"2026-01-10T15:00:00Z\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emailit.com/v2/emails/em_abc123xyz789def456"))
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.POST(BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class UpdateEmail
{
public static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization",
"Bearer em_test_51RxCWJ...vS00p61e0qRE");
var data = new { scheduled_at = "2026-01-10T15:00:00Z" };
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.emailit.com/v2/emails/em_abc123xyz789def456", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
}
curl -X POST https://api.emailit.com/v2/emails/em_abc123xyz789def456 \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" \
-d '{
"scheduled_at": "2026-01-10T15:00:00Z"
}'
Update scheduled email
const response = await fetch('https://api.emailit.com/v2/emails/em_abc123xyz789def456', {
method: 'POST',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
scheduled_at: '2026-01-10T15:00:00Z'
})
});
const result = await response.json();
curl -X POST https://api.emailit.com/v2/emails/em_abc123xyz789def456 \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" \
-d '{
"scheduled_at": "tomorrow at 3pm"
}'
Using natural language
curl -X POST https://api.emailit.com/v2/emails/em_abc123xyz789def456 \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" \
-d '{
"scheduled_at": "tomorrow at 3pm"
}'
{
"object": "email",
"id": "em_abc123xyz789def456ghi012jkl345",
"status": "scheduled",
"scheduled_at": "2026-01-10T15:00:00.000Z",
"updated_at": "2026-01-08T12:00:00.123456Z",
"message": "Email schedule has been updated successfully"
}
{
"error": "Email not found",
"message": "Email with ID 'em_abc123' not found in your workspace"
}
{
"error": "Cannot update email",
"message": "Scheduled emails can only be updated at least 3 minutes before the scheduled time. This email is scheduled to send in 2 minute(s)."
}
{
"error": "Invalid scheduled_at",
"message": "The new scheduled time must be at least 3 minutes in the future."
}
Responses
{
"object": "email",
"id": "em_abc123xyz789def456ghi012jkl345",
"status": "scheduled",
"scheduled_at": "2026-01-10T15:00:00.000Z",
"updated_at": "2026-01-08T12:00:00.123456Z",
"message": "Email schedule has been updated successfully"
}