{ "openapi" : "3.0.1", "info" : { "title" : "Marketing Emails V3", "version" : "v3", "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE" }, "x-hubspot-api-use-case" : "You want to programmatically create marketing emails, then retrieve their send statistics at a later time.", "x-hubspot-related-documentation" : [ { "name" : "Marketing Emails Guide", "url" : "https://developers.hubspot.com/docs/guides/api/marketing/emails/marketing-emails" } ], "x-hubspot-introduction" : "Use the marketing email API to create, manage, and retrieve details about marketing emails. You can also this use API to retrieve statistics related to email sends, similar to what you can see in HubSpot." }, "servers" : [ { "url" : "https://api.hubapi.com" } ], "tags" : [ { "name" : "Public_VNext_Emails" }, { "name" : "Marketing Emails" }, { "name" : "Statistics" } ], "paths" : { "/marketing/v3/emails/statistics/list" : { "get" : { "tags" : [ "Statistics" ], "summary" : "Get aggregated statistics", "description" : "Use this endpoint to get aggregated statistics of emails sent in a specified time span. It also returns the list of emails that were sent during the time span.", "operationId" : "get-/marketing/v3/emails/statistics/list", "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/AggregateEmailStatistics" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/{emailId}/publish" : { "post" : { "tags" : [ "Public_VNext_Emails" ], "operationId" : "post-/marketing/v3/emails/{emailId}/publish", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "marketing-email" ] }, { "private_apps" : [ "marketing-email" ] }, { "oauth2" : [ "transactional-email" ] }, { "private_apps" : [ "transactional-email" ] } ], "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] } }, "/marketing/v3/emails/ab-test/create-variation" : { "post" : { "tags" : [ "Public_VNext_Emails" ], "summary" : "Create an A/B test variation", "description" : "Create a new variation for an email A/B test", "operationId" : "post-/marketing/v3/emails/ab-test/create-variation", "parameters" : [ ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/AbTestCreateRequestVNext" } } }, "required" : true }, "responses" : { "201" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/statistics/histogram" : { "get" : { "tags" : [ "Statistics" ], "summary" : "Get aggregated statistic intervals", "description" : "Get aggregated statistics in intervals for a specified time span. Each interval contains aggregated statistics of the emails that were sent in that time.", "operationId" : "get-/marketing/v3/emails/statistics/histogram", "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponseWithTotalEmailStatisticIntervalNoPaging" }, "example" : { "results" : [ { "aggregateStatistic" : { "counters" : { "bounce" : 0, "click" : 8, "contactslost" : 0, "delivered" : 704, "dropped" : 1, "hardbounced" : 0, "notsent" : 1, "open" : 443, "pending" : 0, "selected" : 705, "sent" : 704, "softbounced" : 0, "spamreport" : 0, "suppressed" : 0, "unsubscribed" : 0 }, "deviceBreakdown" : { "click_device_type" : { "computer" : 6, "mobile" : 2, "unknown" : 0 }, "open_device_type" : { "computer" : 44, "mobile" : 8, "unknown" : 391 } }, "qualifierStats" : { }, "ratios" : { "bounceratio" : 0, "clickratio" : 1.136, "clickthroughratio" : 1.806, "contactslostratio" : 0, "deliveredratio" : 100, "hardbounceratio" : 0, "notsentratio" : 0.142, "openratio" : 62.926, "pendingratio" : 0, "softbounceratio" : 0, "spamreportratio" : 0, "unsubscribedratio" : 0 } }, "interval" : { "end" : "2020-06-01T04:00:00Z", "start" : "2020-05-01T04:00:00Z" } }, { "aggregations" : { "counters" : { "bounce" : 1, "click" : 0, "contactslost" : 1, "delivered" : 4, "dropped" : 1, "hardbounced" : 1, "notsent" : 1, "open" : 4, "pending" : 0, "selected" : 6, "sent" : 5, "softbounced" : 0, "spamreport" : 0, "suppressed" : 0, "unsubscribed" : 0 }, "deviceBreakdown" : { "click_device_type" : { "computer" : 0, "mobile" : 0, "unknown" : 0 }, "open_device_type" : { "computer" : 0, "mobile" : 0, "unknown" : 4 } }, "qualifierStats" : { }, "ratios" : { "bounceratio" : 20, "clickratio" : 0, "clickthroughratio" : 0, "contactslostratio" : 20, "deliveredratio" : 80, "hardbounceratio" : 20, "notsentratio" : 16.667, "openratio" : 100, "pendingratio" : 0, "softbounceratio" : 0, "spamreportratio" : 0, "unsubscribedratio" : 0 } }, "interval" : { "end" : "2020-07-01T04:00:00Z", "start" : "2020-06-01T04:00:00Z" } }, { "aggregations" : { "counters" : { }, "deviceBreakdown" : { }, "qualifierStats" : { }, "ratios" : { } }, "interval" : { "end" : "2020-07-02T00:00:00Z", "start" : "2020-07-01T04:00:00Z" } } ], "total" : 3 } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/{emailId}/ab-test/get-variation" : { "get" : { "tags" : [ "Marketing Emails" ], "summary" : "Get the variation of a an A/B marketing email", "description" : "This endpoint lets you obtain the variation of an A/B marketing email. If the email is variation A (master) it will return variation B (variant) and vice versa.", "operationId" : "get-/marketing/v3/emails/{emailId}/ab-test/get-variation", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/{emailId}/draft/reset" : { "post" : { "tags" : [ "Marketing Emails" ], "summary" : "Reset Draft", "description" : "Resets the draft back to a copy of the live object.", "operationId" : "post-/marketing/v3/emails/{emailId}/draft/reset", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } } ], "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore-to-draft" : { "post" : { "tags" : [ "Marketing Emails" ], "summary" : "Restore a revision of a marketing email to DRAFT state", "description" : "Restores a previous revision of a marketing email to DRAFT state. If there is currently something in the draft for that object, it is overwritten. ", "operationId" : "post-/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore-to-draft", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } }, { "name" : "revisionId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/{emailId}/draft" : { "get" : { "tags" : [ "Marketing Emails" ], "summary" : "Get draft version of a marketing email", "description" : "Get the draft version of an email (if it exists). If no draft version exists, the published email is returned.", "operationId" : "get-/marketing/v3/emails/{emailId}/draft", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] }, "patch" : { "tags" : [ "Marketing Emails" ], "summary" : "Create or update draft version", "description" : "Create or update the draft version of a marketing email. If no draft exists, the system creates a draft from the current “live” email then applies the request body to that draft. The draft version only lives on the buffer—the email is not cloned.", "operationId" : "patch-/marketing/v3/emails/{emailId}/draft", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } } ], "requestBody" : { "description" : "A marketing email object with properties that should overwrite the corresponding properties in the email's current draft.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/EmailUpdateRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/{emailId}/revisions" : { "get" : { "tags" : [ "Marketing Emails" ], "summary" : "Get revisions of a marketing email", "description" : "Get a list of all versions of a marketing email, with each entry including the full state of that particular version. The current revision has the ID -1.", "operationId" : "get-/marketing/v3/emails/{emailId}/revisions", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponseWithTotalVersionPublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/{emailId}/unpublish" : { "post" : { "tags" : [ "Public_VNext_Emails" ], "operationId" : "post-/marketing/v3/emails/{emailId}/unpublish", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "marketing-email" ] }, { "private_apps" : [ "marketing-email" ] }, { "oauth2" : [ "transactional-email" ] }, { "private_apps" : [ "transactional-email" ] } ], "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] } }, "/marketing/v3/emails/{emailId}/revisions/{revisionId}" : { "get" : { "tags" : [ "Marketing Emails" ], "summary" : "Get a revision of a marketing email.", "description" : "Get a specific revision of a marketing email.", "operationId" : "get-/marketing/v3/emails/{emailId}/revisions/{revisionId}", "parameters" : [ { "name" : "emailId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } }, { "name" : "revisionId", "in" : "path", "required" : true, "schema" : { "pattern" : ".+", "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/VersionPublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/clone" : { "post" : { "tags" : [ "Public_VNext_Emails" ], "summary" : "Clone an email", "description" : "Clone an existing email", "operationId" : "post-/marketing/v3/emails/clone", "parameters" : [ ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/EmailCloneRequestVNext" } } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicEmail" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "private_apps" : [ "content" ] } ] } }, "/marketing/v3/emails/" : { "get" : { "tags" : [ "Marketing Emails" ], "summary" : "Get all marketing emails for a HubSpot account.", "description" : "The results can be filtered, allowing you to find a specific set of emails. See the table below for a full list of filtering options.", "operationId" : "get-/marketing/v3/emails/", "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponseWithTotalPublicEmailForwardPaging" }, "example" : { "paging" : { "next" : { "after" : "MjA%3D", "link" : "https://api.hubapi.com/marketing/v3/emails/emails?after=MjA%3D" }, "prev" : { "before" : "MTA%3D", "link" : "https://api.hubapi.com/marketing/v3/emails/emails?after=MTA%3D" } }, "results" : [ { "activeDomain" : "", "archived" : false, "content" : { "templatePath" : "generated_layouts/4701002617.html", "widgets" : { "Social_Sharing" : { "body" : { }, "child_css" : { }, "css" : { }, "id" : "Social_Sharing", "label" : "Social Sharing", "name" : "Social_Sharing", "type" : "social_sharing" }, "column1" : { "body" : { "html" : "" }, "child_css" : { }, "css" : { }, "id" : "column1", "label" : "Column Above Body", "name" : "column1", "type" : "rich_text" }, "hs_email_body" : { "body" : { "html" : "
Hi {{contact.firstname}},
\nThis is an example of an email in HubSpot. You can add and format text, include your own images, and even personalize the message with details about the recipient, like their {{contact.company}} or {{contact.city}}.
\nIn HubSpot, the Email tool is closely linked with the Lists and Workflows tools. You can create a list of recipients on the \"Sending\" tab up above. If you want this email to be part of a nurturing series, you can make it part of a workflow.
\nNeed help? Check out the documentation on creating an email, creating a list, or creating a workflow.
" }, "child_css" : { }, "css" : { }, "id" : "hs_email_body", "label" : "Main Email Body", "name" : "hs_email_body", "type" : "rich_text" }, "logo_image" : { "body" : { "alt" : "vast.png", "height" : 135, "link" : "", "override_inherited_src" : false, "src" : "", "suppress_company_name" : false, "width" : 413 }, "child_css" : { }, "css" : { }, "id" : "logo_image", "label" : "Logo", "name" : "logo_image", "type" : "logo" }, "module_148465958537693" : { "body" : { "html" : "The headline and subheader tells us what you're offering, and the form header closes the deal. Over here you can explain why your offer is so great it's worth filling out a form for.
\nRemember:
\nHello {{ contact.firstname }},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
Other contact information
Hello {{ contact.firstname }},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
Other contact information
Hello {{ contact.firstname }},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
Other contact information