Emails · Sending
Update Email
Reschedule an email that hasn't been sent yet.
PATCH
/emails/{email_id}Only scheduled emails can be updated. Send one with
scheduled_at first (e.g. "scheduled_at": "in 1 hour"); its ID is filled in here automatically.Path Parameters
email_idstringrequiredID of a scheduled email.
Body Parameters
scheduled_atstringrequiredNew send time: ISO 8601 or e.g.
in 2 hours.import { Resend } from 'resend';
const client = new Resend('pw_xxxxxxxxx');
const { data, error } = await client.emails.update({ id: '{email_id}', scheduledAt: 'in 2 hours' });import requests
res = requests.patch(
"https://post-waves.com/emails/{email_id}",
headers={"Authorization": "Bearer pw_xxxxxxxxx"},
json={
"scheduled_at": "in 2 hours"
},
)
print(res.json())<?php
$ch = curl_init('https://post-waves.com/emails/{email_id}');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer pw_xxxxxxxxx',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'scheduled_at' => 'in 2 hours',
]),
]);
$response = json_decode(curl_exec($ch), true);require "net/http"
require "json"
uri = URI("https://post-waves.com/emails/{email_id}")
req = Net::HTTP::Patch.new(uri)
req["Authorization"] = "Bearer pw_xxxxxxxxx"
req["Content-Type"] = "application/json"
req.body = {
scheduled_at: "in 2 hours"
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"scheduled_at":"in 2 hours"}`)
req, _ := http.NewRequest("PATCH", "https://post-waves.com/emails/{email_id}", body)
req.Header.Set("Authorization", "Bearer pw_xxxxxxxxx")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}curl -X PATCH 'https://post-waves.com/emails/{email_id}' \
-H 'Authorization: Bearer pw_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{"scheduled_at":"in 2 hours"}'Try itPATCH
/emails/%7Bemail_id%7DNo key yet? Create one in the dashboard.