Tillwire Read the guide
API reference

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

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Answer

Mailing

Errors: 401, 403, 404, 405, 409, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/mailings/{id}/pause

POST/api/v1/mail/previewmail.previewmail.read

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

MailPreviewRequest

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/preview

POST/api/v1/mail/mailings/{id}/resumemail.resume-mailingmail.write

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Answer

Mailing

Errors: 401, 403, 404, 405, 409, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/mailings/{id}/resume

GET/api/v1/mail/rulesmail.rulesmail.read

Answer

MailRules

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/rules

POST/api/v1/mail/mailingsmail.save-mailingmail.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

MailingSave

Answer

Mailing

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/mailings

POST/api/v1/mail/segmentsmail.save-segmentmail.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

SegmentSave

Answer

Segment

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/segments

POST/api/v1/mail/topicsmail.save-topicmail.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

MailTopicSave

Answer

MailTopic

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/topics

GET/api/v1/mail/schedule-checkmail.schedule-checkmail.read

Parameters

atquerystringThe time the mailing would start, in RFC 3339.
mailingqueryintegerThe mailing being scheduled, left out of the mailings near it.

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/schedule-check

POST/api/v1/mail/mailings/{id}/schedulemail.schedule-mailingmail.write

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Answer

Mailing

Errors: 401, 403, 404, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/mailings/{id}/schedule

POST/api/v1/mail/segments/countmail.segment-countmail.read

Parameters

Idempotency-KeyheaderstringSee common parameters

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/segments/count

GET/api/v1/mail/segmentsmail.segmentsmail.read

Answer

array of Segment

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/segments

POST/api/v1/mail/testsmail.send-testmail.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

TestMailRequest

Answer

TestMail

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/tests

GET/api/v1/mail/setupmail.setupmail.read

Answer

MailSetup

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/setup

GET/api/v1/mail/suppressions/importsmail.suppression-importsmail.read

Answer

array of SuppressionImport

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/suppressions/imports

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

limitqueryintegerThe 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.
afterquerystringSee 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

Answer

array of TestMail

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/tests

GET/api/v1/mail/topicsmail.topicsmail.read

Answer

array of MailTopic

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/topics

GET/api/v1/mail/transactionalmail.transactionalmail.read

Parameters

mailquerystringThe kind of transactional mail, as the contract names it, such as order_confirmation.
examplequerystringThe state of the kind, such as paid; the first state when left out.

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

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Answer

Mailing

Errors: 401, 403, 404, 405, 409, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/mail/mailings/{id}/unschedule

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.

coderequiredstring
levelrequiredstring
sincerequiredstring (date-time)
streamrequiredstring
wordsrequiredstring
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.

htmlrequiredstring
preheaderstring
subjectrequiredstring
textrequiredstring
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.

contextstring
documentany
flowstring
mailinginteger
stepinteger
topicstring
MailRecord

MailRecord is one DNS record of one From domain.

domainrequiredstring
kindrequiredstring
namerequiredstring
statusrequiredstring
valuestring
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.

addressrequiredstring
kindrequiredstring
MailRoute

MailRoute is a stream's route and whether its server answers.

answersrequiredboolean
errorstring
fromstring
reply_tostring
sender_statestring
sinkstring
streamrequiredstring
wherestring
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_hoursrequiredinteger
lifetime_hoursrequiredinteger
per_weekrequiredinteger
quiet_fromstring
quiet_offrequiredboolean
quiet_tostring
reply_toarray of MailReplyRule
streamsrequiredarray of MailStreamRule
wordsrequiredarray of string
zonerequiredstring
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.

atrequiredstring (date-time)
cap_hoursrequiredinteger
goes_atrequiredstring (date-time)
nearrequiredarray of MailScheduleNear
pastrequiredboolean
quietrequiredboolean
quiet_fromstring
quiet_tostring
refusedrequiredboolean
wordsstring
zonerequiredstring
MailScheduleNear

MailScheduleNear is another mailing that starts near a time.

atrequiredstring (date-time)
idrequiredinteger
namerequiredstring
MailSetup

MailSetup is the mail's setup as last checked.

checked_atrequiredstring (date-time)
dns_errorstring
healtharray of MailHealth
recordsrequiredarray of MailRecord
sesarray of SESStep
streamsrequiredarray 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_usedinteger
fromstring
hour_usedinteger
max_per_dayinteger
max_per_hourrequiredinteger
next_freestring (date-time)
rate_per_mininteger
reply_tostring
routedrequiredboolean
streamrequiredstring
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.

audiencerequiredstring
double_opt_inrequiredarray of string
keyrequiredstring
namerequiredstring
pendingrequiredinteger
savedrequiredboolean
saved_atstring (date-time)
saved_bystring
sourcesrequiredarray of MailTopicSource
subscribedrequiredinteger
withdrawnrequiredinteger
wordingrequiredstring
wording_versionrequiredinteger
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.

audiencestring
double_opt_inarray of string
keyrequiredstring
namerequiredstring
wordingrequiredstring
MailTopicSource

MailTopicSource is how many contacts' consent to a topic stands by one source.

contactsrequiredinteger
sourcerequiredstring
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.

examplerequiredstring
examplesrequiredarray of string
htmlrequiredstring
mailrequiredstring
orderinteger
sourcerequiredstring
streamrequiredstring
subjectrequiredstring
textrequiredstring
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.

audienceinteger
audience_frozenboolean
cancelled_atstring (date-time)
createdrequiredstring (date-time)
documentrequiredany
held_bystring
held_untilstring (date-time)
held_whystring
idrequiredinteger
left_outMailingLeftOut
namerequiredstring
preparingboolean
progressrequiredMailingProgress
scheduled_bystring
segmentstring
send_atstring (date-time)
start_refusedrequiredarray of string
startedstring (date-time)
statusrequiredstring
subjectrequiredstring
topicrequiredstring
untracked_linksrequiredinteger
updatedrequiredstring (date-time)
viewstring
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_consentrequiredinteger
suppressedrequiredinteger
withdrewrequiredinteger
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.

failedrequiredinteger
finish_atstring (date-time)
finish_lateboolean
queuedrequiredinteger
recipientsrequiredinteger
sentrequiredinteger
waitingrequiredinteger
withdrawninteger
withheldrequiredinteger
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.

documentrequiredany
idinteger
namerequiredstring
segmentstring
topicrequiredstring
MailingScheduleRequest

MailingScheduleRequest schedules a draft to start at a time from now to a year ahead.

atrequiredstring (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.

markrequiredstring
steprequiredstring
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.

contactsrequiredinteger
namerequiredstring
saved_atrequiredstring (date-time)
treerequiredany
versionrequiredinteger
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_contactsrequiredinteger
consentingrequiredinteger
contactsrequiredinteger
never_agreedrequiredinteger
samplerequiredarray of string
suppressedrequiredinteger
withdrewrequiredinteger
SegmentCountRequest

SegmentCountRequest asks what a tree selects, and of it the contacts who consent to the topic.

topicrequiredstring
treerequiredany
SegmentSave

SegmentSave saves a tree under a name, 1 to 80 characters.

namerequiredstring
treerequiredany
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.

addressstring
atrequiredstring (date-time)
hashrequiredstring
lifted_atstring (date-time)
mailinteger
reasonrequiredstring
registry_atstring (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.

addedrequiredinteger
atrequiredstring (date-time)
reasonrequiredstring
rowsrequiredinteger
TestMail

TestMail is a test mail an owner sent, or was refused.

actorrequiredActor
atrequiredstring (date-time)
errorstring
examplerequiredstring
idrequiredinteger
mailrequiredstring
outcomerequiredstring
streamrequiredstring
tostring
TestMailRequest

TestMailRequest is the test mail an owner asks for: a mail type of the storefront contract, and one of its examples.

contextstring
documentany
examplerequiredstring
flowstring
mailrequiredstring
mailinginteger
stepinteger
tostring
topicstring

Made from engine/internal/openapi/openapi.json at commit 6c4cbd921. The contract-only operations come from the engine’s stub file, engine/internal/ops.