Skip to content

Newsletter

Your own newsletter to your own contacts, written and sent for you.

Open Newsletter
Checked against the dashboard on December 2, 2026

Newsletter's methods are what its screens call, from a signed-in dashboard session, and two that your website calls to sign a reader up. Every one of them carries the private flag, so a general API key cannot call them. They are listed so you know what the screens do. From outside the dashboard, only the two sign up methods are within reach: mailer_subscribe from the form on your site, and mailer_add_subscriber from your site's own code through the SDK.

A screen method acts for the owner of one workspace (the home one, or the workspace_id it is given), needs a session at user clearance, and answers code 1 when it works. A refusal answers a negative code and says why in data. The month's emails, the newsletters a plan keeps and what a newsletter's sections may hold are checked on the server, whatever a screen offered.

Ids

The dashboard calls a template a newsletter: the one its issues are made from.

  • A newsletter reads mlt_ followed by 16 hex characters.
  • An issue reads mli_, the newsletter's 16 hex characters, an underscore and its number: the first issue of a newsletter is 1.
  • An issue's state is preparing, sending, paused, held_cap (waiting: the month's emails ran short), sent or cancelled.

Setup and plans

  • get_mailer_setup answers what the screens start from: the plan, this month's usage and what is left, the plan's limits, the senders ({ kind: 'platform' }, and { kind: 'mailbox', email_account_id, address, provider } for each mailbox of the workspace that can send now), the contact groups and tags, the Commerce stores of this workspace, the WebPilot pilots, and brand_default (the brand newsletters wear when they set none, the looks Branding allows and the website form token).
  • get_mailer_plans reads the plans with their prices, features and entitlements, the plan this workspace is on, whether Newsletter is switched on, and how many newsletters it holds.
  • mailer_set_plan switches Newsletter on, changes the plan (plan_id is mailer_free, mailer_starter, mailer_growth or mailer_business), or switches it off (an empty plan_id, or deactivate set to true). Switching off keeps every newsletter and subscriber. Both plan methods take an optional billing_workspace_id, a workspace you own whose plan to read or change.

Newsletters

  • get_mailer_templates lists the newsletters, newest change first, with how many are live and how many the plan allows. With archived set to true it lists the archived ones.
  • get_mailer_template reads one (template_id): its subject, sections, audience, look, sender, footer and schedule, with its last ten issues.
  • save_mailer_template creates a newsletter, or changes one. It takes template, the newsletter as a whole: its name, subject, preheader, language, audience (kind is all, group or tag, with group_ids, tags and exclude_tags), theme (style is plain, card, accent or minimal, and an accent colour), brand, sender (kind is platform or mailbox, with email_account_id, from_name and reply_to), postal address, footer, store_id (the store a Products for each reader section picks from) and up to 20 sections. A section's type is editor, ai, commerce, webpilot or drive. Keys it does not know are dropped. It is refused when the newsletter uses something the plan does not include.
  • archive_mailer_template archives a newsletter, which pauses its schedule (template_id, archived set to true), or restores one (archived set to false), which counts against the plan's newsletters again.
  • mailer_audience_count counts an audience as the Audience tab shows it: selected (the live contacts of the audience, one for each address), subscribed (those of them who said yes and are not suppressed: the ones an issue mails) and suppressed.

Sending

  • preview_mailer_issue draws an issue as one contact reads it, without sending anything or spending credits: template_id, or a template not saved yet, with an optional contact_id (their name and their products) and an optional theme to try. AI and article sections show what they will be made from. It answers subject and html.
  • send_mailer_test sends a test to your own address or one of this workspace's mailboxes (template_id, an optional to). It reads as the issue will: its AI sections are written and paid in AI credits, and its article sections are not started. Up to 20 a day, each counted against the month's emails.
  • send_mailer_issue_to_contact sends an issue that went out, or is going out, to one contact of this workspace you pick (issue_id, contact_id), as their own copy: the mail a reader gets, with their own unsubscribe link, never a test. It is what putting a contact down on a newsletter's card does. It is refused for a contact with no email address, one who unsubscribed or whose address is suppressed, one who already got this issue, and past three newsletters to them in a week, and it counts against the month's emails and on the issue. It answers the issue's number and the contact's name.
  • mailer_send_issue sends the next issue of a newsletter to its audience: only contacts who said yes, never a suppressed address, at most three newsletters to a contact in a week. It takes template_id, a client_key (4 to 80 letters, digits, _, :, . or -: the same key twice is the same issue, so a double press or a retried call never sends twice), trigger ({ kind: 'now' }, the default, or { kind: 'workflow', id, run_id, step_id } for a workflow's step), an optional first_n and dry_run. It answers issue_id, state and readers. When the month has fewer emails left than readers, nothing is sent and the answer says how many are left: ask again with first_n to send to the first that many. With dry_run set to true it answers the issue's number and its readers and sends nothing.
  • get_mailer_issues lists the issues, newest first, with their state and counts; template_id keeps one newsletter's.
  • get_mailer_issue reads one issue (issue_id) with its counts and its readers a page at a time: state keeps the readers in one state (sending, sent, failed, skipped or bounced), limit is 1 to 200 (100 by default), and bookmark is the one the page before answered.
  • pause_mailer_issue pauses an issue being prepared or sent: nobody else is mailed until it is resumed. resume_mailer_issue sends the rest, from where it stopped: a paused issue, or one held because the month's emails ran out once the month has room again. cancel_mailer_issue ends an issue that has not finished: readers already mailed stay mailed. Each takes an issue_id.
  • get_mailer_subscribers lists the contacts by their newsletter consent, with where it came from and whether the address is suppressed. It takes an optional search (part of a name or an address), state (subscribed, the default, unsubscribed, pending or all), skip and limit (1 to 200, 50 by default).
  • set_mailer_consent subscribes or unsubscribes up to 500 contacts you picked (contact_ids, subscribed). Subscribing is an import and needs attest_text, your statement of how these people asked to receive the newsletter, kept with each contact. Someone who unsubscribed or complained is never subscribed again this way.
  • get_mailer_suppressions lists the addresses no newsletter goes to: hard bounces, repeated soft bounces, complaints, unsubscribes and the ones you added.
  • mailer_lift_suppression takes one email off the list. Only a bounce or one you added can be lifted: an unsubscribe or a complaint is the reader's to undo, by subscribing again.

The schedule

  • mailer_set_schedule sends a newsletter on a schedule: template_id, days (0 is Sunday to 6, Saturday), time (HH:MM, 24 hour), timezone (an IANA name such as Europe/Berlin, UTC by default) and enabled (false pauses it). They become a workflow with a schedule trigger (Monday at nine is 0 9 * * 1) and one Send issue step, and it answers the workflow_id. A schedule counts against your Workflows plan, and the first one switches Workflows Free on. A change made in Workflows shows in the newsletter's Schedule tab.

From your website

Neither method makes a subscriber at once: the address is recorded as waiting, and gets a mail to confirm. Nobody receives an issue before they press its link.

  • mailer_subscribe is the public method behind the form on your site, called with no session: form_token (the token the form was published with, which names the workspace and the tags a sign up may get), email, an optional name, tags (among the ones the form allows), hp (a field that must stay empty: a form that fills it is dropped quietly), captcha when the server asks for one, and ttoken, the human check token the form's page fetches when it opens (the same call with boot: true and the form token answers it; it must be at least 3 seconds and at most 2 hours old). The boot call takes lang (the page's <html lang>) and visitor_lang (the browser's) too, and answers the form's words, with their language and direction (lang, dir, words), in the first of the two that names a language the dashboard speaks, else in English; a refused boot call carries them too. A sign up takes page_lang and visitor_lang the same way, and the confirmation is written in the first that names a language, else in the workspace's newsletters' language, else the owner's. It checks the tokens, the hidden field and the rate limits, and answers the same way whether the address was new or already on the list. The form's own script calls it for you: mark a form data-xuda-subscribe, with an email field (type="email" or named email), an optional name, and tags from data-xuda-tags or checkboxes named tags; or put an empty element marked data-xuda-subscribe-box where a plain form should be drawn.
  • mailer_add_subscriber signs a reader up from your site's own code, with your site's key, through the SDK's xuda.mailer.subscribe(email, { name, tags, lang }): email, an optional name, up to five tags, source (website, the default, site_app or api) and lang, the language of the page the reader signed up on, which the confirmation is written in.

What is refused

The dashboard says each of these in words next to the control. In the method's answer they are a negative code with a sentence in data:

  • Only the owner of a workspace sends from it. Newsletter is switched off in the workspace, or the plan's number of newsletters is reached.
  • A section the plan does not hold: an AI or article section past the plan's number, Products for each reader on Free, a line for each reader below Growth, your own mailbox on Free, or the Xuda line taken off the footer below Growth.
  • The newsletter is not ready: no subject, no section, no postal address, products with no store of this workspace, or a mailbox that cannot send.
  • The month's emails would run short and no first_n was given, or nobody in the audience is subscribed.
  • A schedule fired again within 20 hours of the newsletter's last issue (Send now is not held), or the readers already got enough mail this week.
  • More than 5 in every 100 of an issue's first 200 mails bounced hard, and at least three did: the issue is paused, and says so.
  • There are not enough AI credits for an AI section, WebPilot is off for an article section, or a Drive file of the issue is gone or no longer public.

How is this guide?

Last updated on November 30, 2026