Get an e-mail
const url = 'https://api.getsitecontrol.com/v1/sites/1/emails/1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.getsitecontrol.com/v1/sites/1/emails/1 \ --header 'Authorization: Bearer <token>'The current content of one e-mail: subject, preview text, the sender, the
header and footer, and the message as blocks top to bottom, each with its text
in markdown and its links, images, coupon codes, timers and product feeds.
It is the e-mail as it is now, not a copy of what each recipient got: merge
tags stay unfilled, store products are filled in at sending, and the sender
follows the site’s sending domains of today. Colours, sizes and spacing are
not included; fields that do not apply to a block are left out. Automation
e-mails are steps[].email_id of get_automation.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”E-mail id from a broadcast or an automation
E-mail id from a broadcast or an automation
Responses
Section titled “Responses”object
Internal name, not shown to recipients
The text inbox previews show next to the subject
object
The From display name; null when the e-mail has none
The From address the e-mail goes out with: the one set in the editor when its domain is verified for the site, the default Getsitecontrol address otherwise
Where replies go; null when replies go to address
The site’s sending domain of the address set in the editor; null when that address is not on one of them
object
Id in list_email_domains
True: e-mails go out from this domain; false: from the default address until it is verified
Where verification stands
object
object
Where a click on the logo leads
Leaves out the fields that do not apply, also when nested in a response.
object
The message, top to bottom
Leaves out the fields that do not apply, also when nested in a response.
object
Position in the e-mail: b3 is the third element of the message, b3.1 the first block inside the banner b3. Spacers are skipped, so numbers may have gaps
The block type; it says which other fields the block has
Markdown: bold, italic and links kept; merge tags like {{siteName}} stay as written and are filled per recipient
List items or animated phrases in markdown; for manual products, links to the products
Where a click leads
What a button does: type (OpenUrl, ContinueCheckout, …) and its settings
The coupon code; null for unique codes made per recipient
Coupon: text, shopify-static or shopify-unique; countdown: delay or fixed; animated_text: scroll, slide or animate; products: dynamic or manual
Prefix of unique codes
Deadline, ISO 8601
IANA time zone of until
Store products filled in at sending: bestsellers, newest, on-sale, collection, recommendations
What recommendations pick: related, complementary, customer
Image address
Image address
object
object
Markdown: bold, italic and links kept; merge tags like {{siteName}} stay as written and are filled per recipient
Leaves out the fields that do not apply, also when nested in a response.
object
Leaves out the fields that do not apply, also when nested in a response.
object
Facebook, Instagram, X, …
Text of the unsubscribe link; its address is set at sending
{ "sender": { "domain": { "state": "verified" } }, "blocks": [ { "kind": "heading" } ]}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Authentication scheme: Bearer
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
site_not_found: no such site in your account; email_not_found: the site has no e-mail with this id, or it was deleted
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Seconds until the bucket refills
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds