Skip to the page

Create broadcast

Creates a draft broadcast for one audience. Nothing is sent until you send it.

broadcasts_create
Needs the scopebroadcasts:write
Changes data

Arguments

  • namestringRequired

    A name to recognise the broadcast by. Recipients never see it. Up to 120 characters.

  • audienceIdstringRequired

    The id of the audience to send to. Up to 64 characters.

  • topicIdstring | null

    The id of a topic. The broadcast then only reaches the contacts who get that topic, and its unsubscribe link takes a reader out of the topic and not out of everything. Up to 64 characters.

  • subjectstring

    The subject line. {{first_name}}, {{last_name}} and {{email}} are filled in for each contact. Up to 500 characters.

  • fromstring

    The sender, on a verified domain, such as Acme <news@mail.example.com>. Up to 500 characters.

  • replyTo"" | string

    The address replies go to, when it is not the sender. Empty to leave it to the default of the workspace.

  • htmlstring

    The HTML of the message. The same variables as the subject, and {{unsubscribe_url}} for the unsubscribe link. Leave it out with design. Up to 200,000 characters.

  • textstring

    The plain text of the message, with the same variables. Leave it out with design. Up to 200,000 characters.

  • designobject | null

    The message as blocks, in place of html and text, which are then made from it. The same variables stand in the text of a block, and {{unsubscribe_url}} as the whole href of a link. null or nothing for a broadcast written as HTML.

  • design.previewstring

    The line a mail app shows beside the subject before the message is opened. {{NAME}} marks a variable. Up to 256 characters.

  • design.styleRecord<string, string | number>

    CSS for the whole message, by property name. A background colour fills the page, a maxWidth centres the content, and fontFamily, fontSize and lineHeight are what text gets unless a block sets its own.

  • design.darkRecord<string, string | number>

    Colours for the whole message for a reader in dark mode, by property name: backgroundColor fills the page, and color and borderColor go to the content. It takes: color, backgroundColor, borderColor.

  • design.fontsobject[]

    Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its family in fontFamily, and gets its fallback added for the mail apps that load no web fonts.

  • design.fonts[].familystringRequired

    The name of the font, such as Inter. A block or the page uses the font by naming it in fontFamily.

  • design.fonts[].fallbackstringRequired

    The fonts to use where this one does not load, the one you want most first, such as Helvetica, Arial, sans-serif. Pick fonts every device has.

  • design.fonts[].urlstringRequired

    The full https address of the font file, on your own domain or a CDN. It cannot be a variable. Up to 2,048 characters.

  • design.fonts[].formatstringRequired

    The format of the file: woff2, woff, truetype or opentype.

    One ofwoff2wofftruetypeopentype

  • design.fonts[].weightnumber | string

    The weight this file holds: a number from 100 to 900 in hundreds, or normal or bold. Without it, 400.

  • design.fonts[].stylestring

    The style this file holds: normal or italic. Without it, normal.

    One ofnormalitalic

  • design.cssstring

    CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its className. A rule that has to beat the style a block carries needs !important. </style, @import, expression(, javascript:, behavior:, -moz-binding are refused.

  • design.bodyobject[]Required

    The blocks of the message, from top to bottom. Up to 500 items.

  • design.body[].kindstringRequired

    What the block is. Section, Row, Column and Container hold other blocks. Text, Heading, Button, Link, Markdown, CodeBlock and CodeInline hold text. Img is an image, Hr a line and Html custom code: HTML of your own that goes into the message as it is.

    One ofSectionRowColumnContainerTextHeadingButtonLinkImgHrMarkdownCodeBlockCodeInlineHtml

  • design.body[].idstring

    A name for the block that no other block of the design has: lowercase letters, digits and hyphens. Leave it out and the block gets one.

  • design.body[].styleRecord<string, string | number>

    CSS for the block, by property name, such as { "fontSize": "16px", "color": "#111111" }. Only properties that work in mail are taken.

  • design.body[].alignstring

    Where the block sits across its line: left, center or right.

    One ofleftcenterright

  • design.body[].classNamestring

    Class names for the block, one or several with one space between them, such as hero wide, 200 characters at most. The css of the design reaches the block by them. A name cannot start with r-.

  • design.body[].onlystring

    The one kind of screen the block shows on: desktop hides it on a phone, and phone shows it on a phone and nowhere else. Without it, the block shows everywhere.

    One ofdesktopphone

  • design.body[].phoneRecord<string, string | number>

    CSS that takes the place of the style of the block on a phone, a screen up to 600 pixels wide, by property name, such as { "fontSize": "14px", "padding": "12px" }. It takes: fontSize, lineHeight, textAlign, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, marginLeft, width, maxWidth, height.

  • design.body[].darkRecord<string, string | number>

    Colours that take the place of the ones of the block for a reader in dark mode, by property name, such as { "color": "#f4f4f5" }. It takes: color, backgroundColor, borderColor.

  • design.body[].textstring

    The words of a block that holds text, up to 20000 characters. {{NAME}} marks a variable. A Markdown block takes Markdown here, a CodeBlock takes the code and an Html block takes its HTML, up to 60000 characters.

  • design.body[].childrenunknown[]

    The blocks inside a Section, a Row, a Column or a Container, each shaped like a block of body. A Row takes Column blocks only, and a Column sits in a Row only. Up to 500 items.

  • design.body[].hrefstring

    Where a Button or a Link leads: a full address, or one variable as the whole value, such as {{URL}}. Up to 2,048 characters.

  • design.body[].targetstring

    Where the link opens: _blank for a new tab or _self. Without it, _blank.

    One of_blank_self

  • design.body[].srcstring

    The address of the picture of an Img: a full address, or one variable as the whole value. Up to 2,048 characters.

  • design.body[].altstring

    What the picture of an Img shows, in words, for someone who cannot see it. Up to 512 characters.

  • design.body[].widthstring | number

    The width of an Img or a Column: a number of pixels, or a length such as 50%. Up to 32 characters.

  • design.body[].heightstring | number

    The height of an Img: a number of pixels, or a length. Up to 32 characters.

  • design.body[].valignstring

    Where the content of a Column sits: top, middle or bottom.

    One oftopmiddlebottom

  • design.body[].asstring

    The level of a Heading, from h1 to h6. Without it, h1.

    One ofh1h2h3h4h5h6

  • design.body[].languagestring

    The language of a CodeBlock, such as typescript or bash. One it does not know is shown as plain text. Up to 64 characters.

  • design.body[].themestring

    The colours of a CodeBlock: oneDark, oneLight, dracula, nord, vscDarkPlus, vs, ghcolors or materialLight. Without it, oneDark. Up to 64 characters.

  • design.body[].lineNumbersboolean

    Whether a CodeBlock numbers its lines.

  • design.body[].stackboolean

    true puts the columns of a Row under each other on a phone. Only a Row takes it.

Returns

The answer comes back under structuredContent, with the same JSON as text in content. A call the API refuses comes back with isError set, and the code and the message under structuredContent.error. MCP shows how to connect a client.

  • object"broadcast"

    Always broadcast.

  • idstring

    The id of the broadcast.

  • namestring

    The name of the broadcast. Recipients never see it.

  • subjectstring

    The subject line.

  • audienceIdstring

    The id of the audience it goes to.

  • audienceNamestring

    The name of that audience.

  • topicIdstring | null

    The id of the topic it is sent on, or null. On a topic it only reaches the contacts who get that topic.

  • statusstring

    draft until it is sent or scheduled, scheduled until its time, sending while it goes out, sent after that.

    One ofdraftscheduledsentsending

  • scheduledAtstring | null

    When it starts sending, or null when no time is set.

  • sentAtstring | null

    When the last message was handed over, or null.

  • recipientsinteger

    How many people are subscribed to its audience.

  • deliveredinteger

    How many messages were delivered.

  • failedinteger

    How many could not be sent.

  • fromstring

    The sender, such as Acme <news@mail.example.com>.

  • replyTostring

    The address replies go to. Empty when it is the default of the workspace, or the sender when there is none.

  • htmlstring | null

    The HTML of the message, or null.

  • textstring | null

    The plain text of the message, or null.

  • designobject | null

    The blocks the broadcast is built from, or null for a broadcast written as HTML. When it is set, html and text are made from it.

  • design.previewstringOptional

    The line a mail app shows beside the subject before the message is opened. {{NAME}} marks a variable.

  • design.styleRecord<string, string | number>Optional

    CSS for the whole message, by property name. A background colour fills the page, a maxWidth centres the content, and fontFamily, fontSize and lineHeight are what text gets unless a block sets its own.

  • design.darkRecord<string, string | number>Optional

    Colours for the whole message for a reader in dark mode, by property name: backgroundColor fills the page, and color and borderColor go to the content. It takes: color, backgroundColor, borderColor.

  • design.fontsobject[]Optional

    Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its family in fontFamily, and gets its fallback added for the mail apps that load no web fonts.

  • design.fonts[].familystring

    The name of the font, such as Inter. A block or the page uses the font by naming it in fontFamily.

  • design.fonts[].fallbackstring

    The fonts to use where this one does not load, the one you want most first, such as Helvetica, Arial, sans-serif. Pick fonts every device has.

  • design.fonts[].urlstring

    The full https address of the font file, on your own domain or a CDN. It cannot be a variable.

  • design.fonts[].formatstring

    The format of the file: woff2, woff, truetype or opentype.

    One ofwoff2wofftruetypeopentype

  • design.fonts[].weightnumber | stringOptional

    The weight this file holds: a number from 100 to 900 in hundreds, or normal or bold. Without it, 400.

  • design.fonts[].stylestringOptional

    The style this file holds: normal or italic. Without it, normal.

    One ofnormalitalic

  • design.cssstringOptional

    CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its className. A rule that has to beat the style a block carries needs !important. </style, @import, expression(, javascript:, behavior:, -moz-binding are refused.

  • design.bodyobject[]

    The blocks of the message, from top to bottom.

  • design.body[].kindstring

    What the block is. Section, Row, Column and Container hold other blocks. Text, Heading, Button, Link, Markdown, CodeBlock and CodeInline hold text. Img is an image, Hr a line and Html custom code: HTML of your own that goes into the message as it is.

    One ofSectionRowColumnContainerTextHeadingButtonLinkImgHrMarkdownCodeBlockCodeInlineHtml

  • design.body[].idstring

    The id of the block. No other block of the design has it.

  • design.body[].styleRecord<string, string | number>Optional

    CSS for the block, by property name, such as { "fontSize": "16px", "color": "#111111" }. Only properties that work in mail are taken.

  • design.body[].alignstringOptional

    Where the block sits across its line: left, center or right.

    One ofleftcenterright

  • design.body[].classNamestringOptional

    Class names for the block, one or several with one space between them, such as hero wide, 200 characters at most. The css of the design reaches the block by them. A name cannot start with r-.

  • design.body[].onlystringOptional

    The one kind of screen the block shows on: desktop hides it on a phone, and phone shows it on a phone and nowhere else. Without it, the block shows everywhere.

    One ofdesktopphone

  • design.body[].phoneRecord<string, string | number>Optional

    CSS that takes the place of the style of the block on a phone, a screen up to 600 pixels wide, by property name, such as { "fontSize": "14px", "padding": "12px" }. It takes: fontSize, lineHeight, textAlign, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, marginLeft, width, maxWidth, height.

  • design.body[].darkRecord<string, string | number>Optional

    Colours that take the place of the ones of the block for a reader in dark mode, by property name, such as { "color": "#f4f4f5" }. It takes: color, backgroundColor, borderColor.

  • design.body[].textstringOptional

    The words of a block that holds text, up to 20000 characters. {{NAME}} marks a variable. A Markdown block takes Markdown here, a CodeBlock takes the code and an Html block takes its HTML, up to 60000 characters.

  • design.body[].childrenunknown[]Optional

    The blocks inside a Section, a Row, a Column or a Container, each shaped like a block of body. A Row takes Column blocks only, and a Column sits in a Row only.

  • design.body[].hrefstringOptional

    Where a Button or a Link leads: a full address, or one variable as the whole value, such as {{URL}}.

  • design.body[].targetstringOptional

    Where the link opens: _blank for a new tab or _self. Without it, _blank.

    One of_blank_self

  • design.body[].srcstringOptional

    The address of the picture of an Img: a full address, or one variable as the whole value.

  • design.body[].altstringOptional

    What the picture of an Img shows, in words, for someone who cannot see it.

  • design.body[].widthstring | numberOptional

    The width of an Img or a Column: a number of pixels, or a length such as 50%.

  • design.body[].heightstring | numberOptional

    The height of an Img: a number of pixels, or a length.

  • design.body[].valignstringOptional

    Where the content of a Column sits: top, middle or bottom.

    One oftopmiddlebottom

  • design.body[].asstringOptional

    The level of a Heading, from h1 to h6. Without it, h1.

    One ofh1h2h3h4h5h6

  • design.body[].languagestringOptional

    The language of a CodeBlock, such as typescript or bash. One it does not know is shown as plain text.

  • design.body[].themestringOptional

    The colours of a CodeBlock: oneDark, oneLight, dracula, nord, vscDarkPlus, vs, ghcolors or materialLight. Without it, oneDark.

  • design.body[].lineNumbersbooleanOptional

    Whether a CodeBlock numbers its lines.

  • design.body[].stackbooleanOptional

    true puts the columns of a Row under each other on a phone. Only a Row takes it.

  • createdAtstring

    When the broadcast was made.