curl --request DELETE \
--url https://app.lettr.com/api/emails/scheduled/{transmissionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.lettr.com/api/emails/scheduled/{transmissionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.lettr.com/api/emails/scheduled/{transmissionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.lettr.com/api/emails/scheduled/{transmissionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.lettr.com/api/emails/scheduled/{transmissionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.lettr.com/api/emails/scheduled/{transmissionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.lettr.com/api/emails/scheduled/{transmissionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Scheduled transmission cancelled successfully.",
"data": {
"request_id": "sch_01JQZ3N2K8XW9V6M4TBRC7YHDE",
"transmission_id": null,
"state": "cancelled",
"scheduled_at": "2024-01-16T10:00:00Z",
"from": "sender@example.com",
"from_name": "Sender Name",
"subject": "Scheduled Newsletter",
"recipients": [
"recipient@example.com"
],
"num_recipients": 1,
"accepted": 1,
"rejected": 0,
"tag": null,
"failure_reason": null,
"events": []
}
}Cancel Scheduled Email
Cancel a scheduled email before it is injected into SparkPost, and return the cancelled email.
Breaking change. Cancellation used to be delegated to SparkPost’s per-transmission DELETE endpoint, which SparkPost retired — the call failed every time. Lettr now owns the schedule, so a cancellation either genuinely stops the send or says truthfully that it could not.
Only an email in state scheduled can be cancelled. Once the dispatcher has claimed it (sending), or it has already been injected (sent) or cancelled (cancelled), the request fails with 409 schedule_cancellation_failed — SparkPost offers no per-message recall after injection.
A sandbox key can only cancel the emails it scheduled itself.
curl --request DELETE \
--url https://app.lettr.com/api/emails/scheduled/{transmissionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.lettr.com/api/emails/scheduled/{transmissionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.lettr.com/api/emails/scheduled/{transmissionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.lettr.com/api/emails/scheduled/{transmissionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.lettr.com/api/emails/scheduled/{transmissionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.lettr.com/api/emails/scheduled/{transmissionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.lettr.com/api/emails/scheduled/{transmissionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Scheduled transmission cancelled successfully.",
"data": {
"request_id": "sch_01JQZ3N2K8XW9V6M4TBRC7YHDE",
"transmission_id": null,
"state": "cancelled",
"scheduled_at": "2024-01-16T10:00:00Z",
"from": "sender@example.com",
"from_name": "Sender Name",
"subject": "Scheduled Newsletter",
"recipients": [
"recipient@example.com"
],
"num_recipients": 1,
"accepted": 1,
"rejected": 0,
"tag": null,
"failure_reason": null,
"events": []
}
}scheduled can be cancelled; once it is sending, sent, cancelled or failed, the request returns 409 with the code schedule_cancellation_failed.Authorizations
API key for authentication
Path Parameters
The request_id returned when the email was scheduled (sch_...). A bare SparkPost transmission id is also accepted, for emails scheduled before Lettr owned the schedule.
"sch_01JQZ3N2K8XW9V6M4TBRC7YHDE"
Response
Scheduled transmission cancelled successfully. The email was never handed to SparkPost.
"Scheduled transmission cancelled successfully."
A scheduled email held by Lettr. This is the data object of POST /emails/scheduled, GET /emails/scheduled/{transmissionId} and DELETE /emails/scheduled/{transmissionId}, and each entry of scheduled_emails in GET /emails/scheduled.
Breaking change. Scheduled emails are no longer parked inside SparkPost with options.start_time — SparkPost retired its per-transmission GET and DELETE endpoints. Lettr now holds the email in its own store and injects it into SparkPost when it is due, so request_id is Lettr's own sch_... id, transmission_id is a separate field that stays null until injection, and state values are Lettr's own rather than SparkPost's pass-through states.
Show child attributes
Show child attributes
Was this page helpful?