Edit newsletter content or scheduling
Atomically edits only draft/future scheduled newsletters. Supplied audience intent replaces the snapshot; nullable content/sender values handled by isset retain stored values. A nonempty schedule or scheduled_at schedules the newsletter at least five minutes ahead and enforces the10 scheduled limit; status alone is validated but does not change lifecycle. attachment empty string clears it; fileName is the legacy fallback. Returns detail, adding eligibility counts when scheduled. Requires permission: one of newsletter.
curl --request PATCH \
--url https://api.gratona.com/v1/admin/newsLetters/{id}/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "admin@example.org",
"message": "<p>Thank you for supporting education.</p>",
"title": "Education field update",
"status": "draft",
"to": [
42
],
"tag": "Education",
"tags": [
"Education"
],
"audience_selection": {
"mode": "static",
"tags": [
"Education"
],
"individual_donor_ids": [
42
],
"excluded_tag_donor_ids": [
42
]
},
"select_all_donors": false,
"design": "<unknown>",
"attachment": "https://example.org/newsletter.pdf",
"fileName": "https://example.org/newsletter.pdf",
"scheduled_at": "2026-10-27T15:00:00",
"timezone": "Africa/Kampala"
}
'import requests
url = "https://api.gratona.com/v1/admin/newsLetters/{id}/edit"
payload = {
"from": "admin@example.org",
"message": "<p>Thank you for supporting education.</p>",
"title": "Education field update",
"status": "draft",
"to": [42],
"tag": "Education",
"tags": ["Education"],
"audience_selection": {
"mode": "static",
"tags": ["Education"],
"individual_donor_ids": [42],
"excluded_tag_donor_ids": [42]
},
"select_all_donors": False,
"design": "<unknown>",
"attachment": "https://example.org/newsletter.pdf",
"fileName": "https://example.org/newsletter.pdf",
"scheduled_at": "2026-10-27T15:00:00",
"timezone": "Africa/Kampala"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: 'admin@example.org',
message: '<p>Thank you for supporting education.</p>',
title: 'Education field update',
status: 'draft',
to: [42],
tag: 'Education',
tags: ['Education'],
audience_selection: {
mode: 'static',
tags: ['Education'],
individual_donor_ids: [42],
excluded_tag_donor_ids: [42]
},
select_all_donors: false,
design: '<unknown>',
attachment: 'https://example.org/newsletter.pdf',
fileName: 'https://example.org/newsletter.pdf',
scheduled_at: '2026-10-27T15:00:00',
timezone: 'Africa/Kampala'
})
};
fetch('https://api.gratona.com/v1/admin/newsLetters/{id}/edit', 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://api.gratona.com/v1/admin/newsLetters/{id}/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'from' => 'admin@example.org',
'message' => '<p>Thank you for supporting education.</p>',
'title' => 'Education field update',
'status' => 'draft',
'to' => [
42
],
'tag' => 'Education',
'tags' => [
'Education'
],
'audience_selection' => [
'mode' => 'static',
'tags' => [
'Education'
],
'individual_donor_ids' => [
42
],
'excluded_tag_donor_ids' => [
42
]
],
'select_all_donors' => false,
'design' => '<unknown>',
'attachment' => 'https://example.org/newsletter.pdf',
'fileName' => 'https://example.org/newsletter.pdf',
'scheduled_at' => '2026-10-27T15:00:00',
'timezone' => 'Africa/Kampala'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/newsLetters/{id}/edit"
payload := strings.NewReader("{\n \"from\": \"admin@example.org\",\n \"message\": \"<p>Thank you for supporting education.</p>\",\n \"title\": \"Education field update\",\n \"status\": \"draft\",\n \"to\": [\n 42\n ],\n \"tag\": \"Education\",\n \"tags\": [\n \"Education\"\n ],\n \"audience_selection\": {\n \"mode\": \"static\",\n \"tags\": [\n \"Education\"\n ],\n \"individual_donor_ids\": [\n 42\n ],\n \"excluded_tag_donor_ids\": [\n 42\n ]\n },\n \"select_all_donors\": false,\n \"design\": \"<unknown>\",\n \"attachment\": \"https://example.org/newsletter.pdf\",\n \"fileName\": \"https://example.org/newsletter.pdf\",\n \"scheduled_at\": \"2026-10-27T15:00:00\",\n \"timezone\": \"Africa/Kampala\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gratona.com/v1/admin/newsLetters/{id}/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"admin@example.org\",\n \"message\": \"<p>Thank you for supporting education.</p>\",\n \"title\": \"Education field update\",\n \"status\": \"draft\",\n \"to\": [\n 42\n ],\n \"tag\": \"Education\",\n \"tags\": [\n \"Education\"\n ],\n \"audience_selection\": {\n \"mode\": \"static\",\n \"tags\": [\n \"Education\"\n ],\n \"individual_donor_ids\": [\n 42\n ],\n \"excluded_tag_donor_ids\": [\n 42\n ]\n },\n \"select_all_donors\": false,\n \"design\": \"<unknown>\",\n \"attachment\": \"https://example.org/newsletter.pdf\",\n \"fileName\": \"https://example.org/newsletter.pdf\",\n \"scheduled_at\": \"2026-10-27T15:00:00\",\n \"timezone\": \"Africa/Kampala\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/newsLetters/{id}/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"admin@example.org\",\n \"message\": \"<p>Thank you for supporting education.</p>\",\n \"title\": \"Education field update\",\n \"status\": \"draft\",\n \"to\": [\n 42\n ],\n \"tag\": \"Education\",\n \"tags\": [\n \"Education\"\n ],\n \"audience_selection\": {\n \"mode\": \"static\",\n \"tags\": [\n \"Education\"\n ],\n \"individual_donor_ids\": [\n 42\n ],\n \"excluded_tag_donor_ids\": [\n 42\n ]\n },\n \"select_all_donors\": false,\n \"design\": \"<unknown>\",\n \"attachment\": \"https://example.org/newsletter.pdf\",\n \"fileName\": \"https://example.org/newsletter.pdf\",\n \"scheduled_at\": \"2026-10-27T15:00:00\",\n \"timezone\": \"Africa/Kampala\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"client_id": 42,
"title": "Education field update",
"message": "<p>Thank you for supporting education.</p>",
"design": "{`body`:{}}",
"status": "draft",
"type": "newsletter",
"sender_email": "admin@example.org",
"sender_name": "Jane Admin",
"attachment": "https://example.org/newsletter.pdf",
"scheduled_at": "2026-10-20T12:00:00Z",
"timezone": "Africa/Kampala",
"scheduled_timezone": "Africa/Kampala",
"schedule_source": "calendar",
"timing_recommendation_id": "550e8400-e29b-41d4-a716-446655440000",
"schedule_claim_id": "550e8400-e29b-41d4-a716-446655440000",
"claimed_at": "2026-10-20T12:00:00Z",
"recipient_count": 1,
"audience_selection": {
"version": 2,
"mode": "static",
"captured_at": "2026-10-20T12:00:00Z",
"tag_operator": "any",
"tags": [
"Education"
],
"tag_match_count": 1,
"individual_donor_ids": [
42
],
"excluded_tag_donor_ids": [
42
],
"recipient_count": 1
},
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"delivery_status": "partially_sent",
"delivery_total": 1,
"delivery_sent": 1,
"delivery_failed": 1,
"delivery_unconfirmed": 1,
"delivery_pending": 1,
"delivery_skipped": 1
},
"donors": [
{
"email": "jane@example.org",
"current_email": "jane.new@example.org",
"email_drifted": true,
"name": "Jane Donor",
"id": 42,
"tags": "Education,Monthly"
}
],
"recipient_pagination": {
"current_page": 1,
"per_page": 1,
"total": 1,
"last_page": 1
},
"audience": {
"version": 2,
"mode": "static",
"captured_at": "2026-10-20T12:00:00Z",
"capture_time_estimated": true,
"snapshot_recipient_count": 1,
"tag_operator": "any",
"tags": [
"Education"
],
"tag_match_count_at_capture": 1,
"current_tag_member_count": 1,
"not_included_count": 1,
"manual_exclusion_count": 1,
"new_tag_member_count": 1,
"no_longer_matches_count": 1
},
"status": "success",
"message": "Newsletter successfully updated"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Id in the current organization.
Body
Validated request fields for this operation.
Recorded actor/sender email; actual delivery uses organization email settings.
"admin@example.org"
Newsletter HTML; saved Impact Story evidence is checked when present.
"<p>Thank you for supporting education.</p>"
"Education field update"
draft, scheduled, null "draft"
Legacy/manual donor ids; selects server-owned current addresses when audience intent is present.
Organization-owned record identifier.
Legacy comma-separated tag selection; tags/audience_selection take priority.
"Education"
Server-resolved audience intent. all snapshots all active donors with nonblank email; static unions current ANY-tag matches with additions minus exclusions; manual uses individual ids. Unknown/non-tenant/no-email ids are omitted.
Show child attributes
Show child attributes
Overrides other selection fields with an all-donor snapshot.
false
Editor design object or serialized string; persisted as text.
Existing attachment reference; no multipart upload is performed.
"https://example.org/newsletter.pdf"
Legacy attachment alias; attachment takes priority.
"https://example.org/newsletter.pdf"
Legacy local/offset date-time; required for scheduling unless schedule is provided. Must be at least five minutes ahead.
"2026-10-27T15:00:00"
IANA timezone; otherwise stored/account/admin timezone fallback.
64"Africa/Kampala"
Show child attributes
Show child attributes
Response
Operation result.
Read/edit/audience-save payload. message is included only after mutations; detail includes at most the first50 recipient ids.
Derived delivery results; sent means provider acceptance, separate from delivered confirmation.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Snapshot-versus-current tag facts. All/manual fresh mode omits tag facts; legacy or manual selections can return null.
Show child attributes
Show child attributes
"success"
"Newsletter successfully updated"
curl --request PATCH \
--url https://api.gratona.com/v1/admin/newsLetters/{id}/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "admin@example.org",
"message": "<p>Thank you for supporting education.</p>",
"title": "Education field update",
"status": "draft",
"to": [
42
],
"tag": "Education",
"tags": [
"Education"
],
"audience_selection": {
"mode": "static",
"tags": [
"Education"
],
"individual_donor_ids": [
42
],
"excluded_tag_donor_ids": [
42
]
},
"select_all_donors": false,
"design": "<unknown>",
"attachment": "https://example.org/newsletter.pdf",
"fileName": "https://example.org/newsletter.pdf",
"scheduled_at": "2026-10-27T15:00:00",
"timezone": "Africa/Kampala"
}
'import requests
url = "https://api.gratona.com/v1/admin/newsLetters/{id}/edit"
payload = {
"from": "admin@example.org",
"message": "<p>Thank you for supporting education.</p>",
"title": "Education field update",
"status": "draft",
"to": [42],
"tag": "Education",
"tags": ["Education"],
"audience_selection": {
"mode": "static",
"tags": ["Education"],
"individual_donor_ids": [42],
"excluded_tag_donor_ids": [42]
},
"select_all_donors": False,
"design": "<unknown>",
"attachment": "https://example.org/newsletter.pdf",
"fileName": "https://example.org/newsletter.pdf",
"scheduled_at": "2026-10-27T15:00:00",
"timezone": "Africa/Kampala"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: 'admin@example.org',
message: '<p>Thank you for supporting education.</p>',
title: 'Education field update',
status: 'draft',
to: [42],
tag: 'Education',
tags: ['Education'],
audience_selection: {
mode: 'static',
tags: ['Education'],
individual_donor_ids: [42],
excluded_tag_donor_ids: [42]
},
select_all_donors: false,
design: '<unknown>',
attachment: 'https://example.org/newsletter.pdf',
fileName: 'https://example.org/newsletter.pdf',
scheduled_at: '2026-10-27T15:00:00',
timezone: 'Africa/Kampala'
})
};
fetch('https://api.gratona.com/v1/admin/newsLetters/{id}/edit', 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://api.gratona.com/v1/admin/newsLetters/{id}/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'from' => 'admin@example.org',
'message' => '<p>Thank you for supporting education.</p>',
'title' => 'Education field update',
'status' => 'draft',
'to' => [
42
],
'tag' => 'Education',
'tags' => [
'Education'
],
'audience_selection' => [
'mode' => 'static',
'tags' => [
'Education'
],
'individual_donor_ids' => [
42
],
'excluded_tag_donor_ids' => [
42
]
],
'select_all_donors' => false,
'design' => '<unknown>',
'attachment' => 'https://example.org/newsletter.pdf',
'fileName' => 'https://example.org/newsletter.pdf',
'scheduled_at' => '2026-10-27T15:00:00',
'timezone' => 'Africa/Kampala'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/newsLetters/{id}/edit"
payload := strings.NewReader("{\n \"from\": \"admin@example.org\",\n \"message\": \"<p>Thank you for supporting education.</p>\",\n \"title\": \"Education field update\",\n \"status\": \"draft\",\n \"to\": [\n 42\n ],\n \"tag\": \"Education\",\n \"tags\": [\n \"Education\"\n ],\n \"audience_selection\": {\n \"mode\": \"static\",\n \"tags\": [\n \"Education\"\n ],\n \"individual_donor_ids\": [\n 42\n ],\n \"excluded_tag_donor_ids\": [\n 42\n ]\n },\n \"select_all_donors\": false,\n \"design\": \"<unknown>\",\n \"attachment\": \"https://example.org/newsletter.pdf\",\n \"fileName\": \"https://example.org/newsletter.pdf\",\n \"scheduled_at\": \"2026-10-27T15:00:00\",\n \"timezone\": \"Africa/Kampala\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gratona.com/v1/admin/newsLetters/{id}/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"admin@example.org\",\n \"message\": \"<p>Thank you for supporting education.</p>\",\n \"title\": \"Education field update\",\n \"status\": \"draft\",\n \"to\": [\n 42\n ],\n \"tag\": \"Education\",\n \"tags\": [\n \"Education\"\n ],\n \"audience_selection\": {\n \"mode\": \"static\",\n \"tags\": [\n \"Education\"\n ],\n \"individual_donor_ids\": [\n 42\n ],\n \"excluded_tag_donor_ids\": [\n 42\n ]\n },\n \"select_all_donors\": false,\n \"design\": \"<unknown>\",\n \"attachment\": \"https://example.org/newsletter.pdf\",\n \"fileName\": \"https://example.org/newsletter.pdf\",\n \"scheduled_at\": \"2026-10-27T15:00:00\",\n \"timezone\": \"Africa/Kampala\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/newsLetters/{id}/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"admin@example.org\",\n \"message\": \"<p>Thank you for supporting education.</p>\",\n \"title\": \"Education field update\",\n \"status\": \"draft\",\n \"to\": [\n 42\n ],\n \"tag\": \"Education\",\n \"tags\": [\n \"Education\"\n ],\n \"audience_selection\": {\n \"mode\": \"static\",\n \"tags\": [\n \"Education\"\n ],\n \"individual_donor_ids\": [\n 42\n ],\n \"excluded_tag_donor_ids\": [\n 42\n ]\n },\n \"select_all_donors\": false,\n \"design\": \"<unknown>\",\n \"attachment\": \"https://example.org/newsletter.pdf\",\n \"fileName\": \"https://example.org/newsletter.pdf\",\n \"scheduled_at\": \"2026-10-27T15:00:00\",\n \"timezone\": \"Africa/Kampala\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"client_id": 42,
"title": "Education field update",
"message": "<p>Thank you for supporting education.</p>",
"design": "{`body`:{}}",
"status": "draft",
"type": "newsletter",
"sender_email": "admin@example.org",
"sender_name": "Jane Admin",
"attachment": "https://example.org/newsletter.pdf",
"scheduled_at": "2026-10-20T12:00:00Z",
"timezone": "Africa/Kampala",
"scheduled_timezone": "Africa/Kampala",
"schedule_source": "calendar",
"timing_recommendation_id": "550e8400-e29b-41d4-a716-446655440000",
"schedule_claim_id": "550e8400-e29b-41d4-a716-446655440000",
"claimed_at": "2026-10-20T12:00:00Z",
"recipient_count": 1,
"audience_selection": {
"version": 2,
"mode": "static",
"captured_at": "2026-10-20T12:00:00Z",
"tag_operator": "any",
"tags": [
"Education"
],
"tag_match_count": 1,
"individual_donor_ids": [
42
],
"excluded_tag_donor_ids": [
42
],
"recipient_count": 1
},
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"delivery_status": "partially_sent",
"delivery_total": 1,
"delivery_sent": 1,
"delivery_failed": 1,
"delivery_unconfirmed": 1,
"delivery_pending": 1,
"delivery_skipped": 1
},
"donors": [
{
"email": "jane@example.org",
"current_email": "jane.new@example.org",
"email_drifted": true,
"name": "Jane Donor",
"id": 42,
"tags": "Education,Monthly"
}
],
"recipient_pagination": {
"current_page": 1,
"per_page": 1,
"total": 1,
"last_page": 1
},
"audience": {
"version": 2,
"mode": "static",
"captured_at": "2026-10-20T12:00:00Z",
"capture_time_estimated": true,
"snapshot_recipient_count": 1,
"tag_operator": "any",
"tags": [
"Education"
],
"tag_match_count_at_capture": 1,
"current_tag_member_count": 1,
"not_included_count": 1,
"manual_exclusion_count": 1,
"new_tag_member_count": 1,
"no_longer_matches_count": 1
},
"status": "success",
"message": "Newsletter successfully updated"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}