Mail. 39 operations.
39 of them work. Page 2 of 2. Each needs a bearer token with its scope. All operations.
Operations
POST/api/v1/mail/mailings/{id}/pausemail.pause-mailingmail.write
POST/api/v1/mail/previewmail.previewmail.read
POST/api/v1/mail/mailings/{id}/resumemail.resume-mailingmail.write
GET/api/v1/mail/rulesmail.rulesmail.read
POST/api/v1/mail/mailingsmail.save-mailingmail.write
POST/api/v1/mail/segmentsmail.save-segmentmail.write
POST/api/v1/mail/topicsmail.save-topicmail.write
GET/api/v1/mail/schedule-checkmail.schedule-checkmail.read
POST/api/v1/mail/mailings/{id}/schedulemail.schedule-mailingmail.write
POST/api/v1/mail/segments/countmail.segment-countmail.read
GET/api/v1/mail/segmentsmail.segmentsmail.read
POST/api/v1/mail/testsmail.send-testmail.write
GET/api/v1/mail/setupmail.setupmail.read
GET/api/v1/mail/suppressions/importsmail.suppression-importsmail.read
GET/api/v1/mail/suppressionsmail.suppressionsmail.read
Read a page at a time: give limit (1 to 500; 100 when none is given) and after, the Next-Cursor of the page before. Follow the Link, rel next, to the rest.
Parameters
limitquery | integerThe most suppressions in the page: 1 to 500; 100 when the call gives no limit. The Next-Cursor and Link headers name the next page. |
afterquery | stringSee common parameters |
Answer
array of Suppression
Errors: 400, 401, 403, 405, 422, 429
curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/suppressions
GET/api/v1/mail/testsmail.testsmail.read
GET/api/v1/mail/topicsmail.topicsmail.read
GET/api/v1/mail/transactionalmail.transactionalmail.read
Parameters
mailquery | stringThe kind of transactional mail, as the contract names it, such as order_confirmation. |
examplequery | stringThe state of the kind, such as paid; the first state when left out. |
Answer
Errors: 401, 403, 405, 422, 429
curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/transactional
POST/api/v1/mail/mailings/{id}/unschedulemail.unschedule-mailingmail.write
Schemas 30
Actor
Actor is who performs an operation: user:<id> for an owner, the id store.yaml's owners: gives them, and integration:<id> for an integration calling the API door. Every order event an operation appends carries it.
string
MailHealth
MailHealth is a line of the health of the sending, for the top of the Mail section. Code names the finding: sender_not_verified. Level is warn. Since is when the provider last refused.
coderequired | string |
levelrequired | string |
sincerequired | string (date-time) |
streamrequired | string |
wordsrequired | string |
MailPreview
MailPreview is a mail as the store writes it: its subject, its preview line (the document's own, merge fields filled; empty when the mail uses its first words), its text and its HTML. The store's own name, logo, footer and products stand in it, a recent order or the store's own products for a flow's order and cart blocks; never an example. The HTML is one 600 px responsive column: a screen sets the width of its frame for a phone or a desktop.
htmlrequired | string |
preheader | string |
subjectrequired | string |
textrequired | string |
MailPreviewRequest
MailPreviewRequest asks for a mail to be written as the store would send it now, to a contact it knows no name of, and saved nowhere. Exactly one source is given: Mailing (a saved mailing by id), Flow with Step (the document of a flow's step, from 0, as the flow has it now: the owner's or the kind's default), or Document (a document posted, as the editor holds it). Context ("campaign", the default, or "flow") says what a posted Document is; a flow's block in a campaign is refused. Topic names the topic whose name the footer shows.
context | string |
document | any |
flow | string |
mailing | integer |
step | integer |
topic | string |
MailRecord
MailRecord is one DNS record of one From domain.
domainrequired | string |
kindrequired | string |
namerequired | string |
statusrequired | string |
value | string |
MailReplyRule
MailReplyRule is the address one kind of mail is answered to. Kind is "default" for every mail that has no address of its own, or orders, forms, marketing, module, or flow.<kind> for a flow's mail.
addressrequired | string |
kindrequired | string |
MailRoute
MailRoute is a stream's route and whether its server answers.
answersrequired | boolean |
error | string |
from | string |
reply_to | string |
sender_state | string |
sink | string |
streamrequired | string |
where | string |
MailRules
MailRules are the rules that decide when mail may go, as the store has them now: the quiet hours and the caps on how often a contact is mailed (marketing mail), and the caps of each stream. Words is the card "When mail may go", one sentence for each rule, ready to show.
cap_hoursrequired | integer |
lifetime_hoursrequired | integer |
per_weekrequired | integer |
quiet_from | string |
quiet_offrequired | boolean |
quiet_to | string |
reply_to | array of MailReplyRule |
streamsrequired | array of MailStreamRule |
wordsrequired | array of string |
zonerequired | string |
MailScheduleCheck
MailScheduleCheck says what the store would do with a mailing scheduled at At, before the owner schedules it: whether the time is past, whether it falls in the quiet hours of the marketing stream and then when the mail goes, and the other mailings that start within the hours of the frequency cap. Words is one sentence for the owner; it is empty when nothing needs saying.
atrequired | string (date-time) |
cap_hoursrequired | integer |
goes_atrequired | string (date-time) |
nearrequired | array of MailScheduleNear |
pastrequired | boolean |
quietrequired | boolean |
quiet_from | string |
quiet_to | string |
refusedrequired | boolean |
words | string |
zonerequired | string |
MailScheduleNear
MailScheduleNear is another mailing that starts near a time.
atrequired | string (date-time) |
idrequired | integer |
namerequired | string |
MailSetup
MailSetup is the mail's setup as last checked.
checked_atrequired | string (date-time) |
dns_error | string |
health | array of MailHealth |
recordsrequired | array of MailRecord |
ses | array of SESStep |
streamsrequired | array of MailRoute |
MailStreamRule
MailStreamRule is a stream's own limits and its sender: MaxPerHour is the most mails it hands over in any 60 minutes (0 for none); RatePerMin the most a minute, of the marketing stream alone (0 for the others). Routed is false for a stream the store has no route for. From and ReplyTo are the addresses its mail is from and answered to.
day_used | integer |
from | string |
hour_used | integer |
max_per_day | integer |
max_per_hourrequired | integer |
next_free | string (date-time) |
rate_per_min | integer |
reply_to | string |
routedrequired | boolean |
streamrequired | string |
MailTopic
MailTopic is a topic as it rules: its fields, the version of its wording (1, and one more for each wording saved after it), the contacts by the state of their consent to it (standing; withdrawn; asked and not yet confirmed), and whether the owner saved it, who did, and when.
audiencerequired | string |
double_opt_inrequired | array of string |
keyrequired | string |
namerequired | string |
pendingrequired | integer |
savedrequired | boolean |
saved_at | string (date-time) |
saved_by | string |
sourcesrequired | array of MailTopicSource |
subscribedrequired | integer |
withdrawnrequired | integer |
wordingrequired | string |
wording_versionrequired | integer |
MailTopicSave
MailTopicSave is a topic the owner saves: the key makes a new topic, or names a known one, whose other fields change; the key is never changed. Audience is consented or customers (consented when left out); DoubleOptIn lists the sources (form, checkout) whose consent stands only once confirmed.
audience | string |
double_opt_in | array of string |
keyrequired | string |
namerequired | string |
wordingrequired | string |
MailTopicSource
MailTopicSource is how many contacts' consent to a topic stands by one source.
contactsrequired | integer |
sourcerequired | string |
MailTransactional
MailTransactional is a transactional mail written as the store sends it, with the store's own data (MX1): for an order mail the latest real order of its kind (else the latest order), for a link mail the owner's own address and a sample link, else the contract's example with the store's name. A demo name is never in it: not the example store's, not the example buyer's. Subject, Text and HTML are the mail itself; Examples are the states of this kind of mail, the one shown among them.
examplerequired | string |
examplesrequired | array of string |
htmlrequired | string |
mailrequired | string |
order | integer |
sourcerequired | string |
streamrequired | string |
subjectrequired | string |
textrequired | string |
Mailing
Mailing is a mailing with its document: its summary, its document (JSON: a subject and blocks of heading, text, image, button, product, product_grid, coupon and divider), and when it was made.
audience | integer |
audience_frozen | boolean |
cancelled_at | string (date-time) |
createdrequired | string (date-time) |
documentrequired | any |
held_by | string |
held_until | string (date-time) |
held_why | string |
idrequired | integer |
left_out | MailingLeftOut |
namerequired | string |
preparing | boolean |
progressrequired | MailingProgress |
scheduled_by | string |
segment | string |
send_at | string (date-time) |
start_refusedrequired | array of string |
started | string (date-time) |
statusrequired | string |
subjectrequired | string |
topicrequired | string |
untracked_linksrequired | integer |
updatedrequired | string (date-time) |
view | string |
MailingLeftOut
MailingLeftOut are the contacts a mailing not yet started leaves out, by reason: Withdrew (their consent to its topic stands withdrawn), Suppressed (they consent, and their address is suppressed: bounced, complained, unsubscribed, imported, in a registry or by hand) and NoConsent (they never asked for the topic, or the request is not confirmed).
no_consentrequired | integer |
suppressedrequired | integer |
withdrewrequired | integer |
MailingProgress
MailingProgress is how far a mailing's sending has come: the recipients frozen at its start, those held for their batch, those released and not yet tried, and those sent, failed and withheld.
failedrequired | integer |
finish_at | string (date-time) |
finish_late | boolean |
queuedrequired | integer |
recipientsrequired | integer |
sentrequired | integer |
waitingrequired | integer |
withdrawn | integer |
withheldrequired | integer |
MailingSave
MailingSave saves a mailing's draft: its id (0 for a new one), a name of 1 to 80 characters, a topic the store lists, a saved segment ("" for every contact consenting to the topic) and its document.
documentrequired | any |
id | integer |
namerequired | string |
segment | string |
topicrequired | string |
MailingScheduleRequest
MailingScheduleRequest schedules a draft to start at a time from now to a year ahead.
atrequired | string (date-time) |
SESStep
SESStep is an SES step and how far the engine sees it done: done, not-done, or unseen, which the SES console says.
markrequired | string |
steprequired | string |
Segment
Segment is a saved segment's latest version: its name, its version, its tree (JSON: and, or, not, and conditions of a field, an op and a value), when it was saved, and how many contacts it selects now.
contactsrequired | integer |
namerequired | string |
saved_atrequired | string (date-time) |
treerequired | any |
versionrequired | integer |
SegmentCount
SegmentCount is what a tree selects: the contacts, and of them those whose consent to the topic asked stands. From the segment builder (MX2): Consenting counts a consent that stands, the contacts with a suppressed address among them (Suppressed counts those, so a send reaches Consenting less Suppressed). Withdrew is the contacts whose consent stands withdrawn. NeverAgreed is the contacts with no consent record for the topic at all; one asked and not yet confirmed is in none of the three. AllContacts is how many contacts the store holds, for "17 % of your contacts". Sample is five of the people a send reaches among the contacts selected, the same five for the same tree, their addresses masked by the engine (j***@m***.v***.co.za: the first letter of the name and of each label of the domain before the public suffix; nothing of a name or label of 3 letters or fewer); it is [] when fewer than five people are reached, so a small segment gives counts only.
all_contactsrequired | integer |
consentingrequired | integer |
contactsrequired | integer |
never_agreedrequired | integer |
samplerequired | array of string |
suppressedrequired | integer |
withdrewrequired | integer |
SegmentCountRequest
SegmentCountRequest asks what a tree selects, and of it the contacts who consent to the topic.
topicrequired | string |
treerequired | any |
SegmentSave
SegmentSave saves a tree under a name, 1 to 80 characters.
namerequired | string |
treerequired | any |
Suppression
Suppression is an address on the mail's suppression list: the hash it is kept by, the address while the store may keep it (absent once erased), why (hard_bounce, complaint, unsubscribed, imported, registry or manual), the mail of the log that caused it, if one did, and when.
address | string |
atrequired | string (date-time) |
hashrequired | string |
lifted_at | string (date-time) |
mail | integer |
reasonrequired | string |
registry_at | string (date-time) |
SuppressionImport
SuppressionImport is the last import of a list into the suppression list for one reason: the reason, a fixed code (registry, manual or imported), when, the list's rows, and how many it added.
addedrequired | integer |
atrequired | string (date-time) |
reasonrequired | string |
rowsrequired | integer |
TestMail
TestMail is a test mail an owner sent, or was refused.
actorrequired | Actor |
atrequired | string (date-time) |
error | string |
examplerequired | string |
idrequired | integer |
mailrequired | string |
outcomerequired | string |
streamrequired | string |
to | string |
TestMailRequest
TestMailRequest is the test mail an owner asks for: a mail type of the storefront contract, and one of its examples.
context | string |
document | any |
examplerequired | string |
flow | string |
mailrequired | string |
mailing | integer |
step | integer |
to | string |
topic | string |
Made from engine/internal/openapi/openapi.json at commit 6c4cbd921. The contract-only operations come from the engine’s stub file, engine/internal/ops.